77665bda | 12-Oct-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
header cleanups
This commit fixed several places (but not all) where wrong include directory is specified and prevent the clean up in the chidren changes.
Signed-off-by: Nan Zhou <nanzhoumails@gmai
header cleanups
This commit fixed several places (but not all) where wrong include directory is specified and prevent the clean up in the chidren changes.
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ibbba62e2c0cfe3583a65f1befa1b233bd3eebf19
show more ...
|
bb759e3a | 02-Aug-2022 |
Ed Tanous <edtanous@google.com> |
Move ClientID parameter out of OEM
In 2022.2, Redfish added support for the Context parameter on the Session Resource. This parameter has the same function that the OemSession.ClientId field served
Move ClientID parameter out of OEM
In 2022.2, Redfish added support for the Context parameter on the Session Resource. This parameter has the same function that the OemSession.ClientId field served. This commit moves all the existing ClientId code to produce Context as well.
Functionally, this has one important difference, in that Context in Redfish is optionally provided by the user, which means we need to omit it if not given by the user. The old implementation left it set to empty string ("").
Because of this, a few minor interfaces need to change to use std::optional. Existing uses of clientId are moved to using value_or("") to keep the same behavior as before.
Tested: curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\": \"0penBmc\"}" https://192.168.7.2/redfish/v1/SessionService/Sessions
Returns a Session object with no Context key present
curl --insecure -X POST -d "{\"UserName\": \"root\", \"Password\": \"0penBmc\", \"Context\": \"Foobar\"}" https://192.168.7.2/redfish/v1/SessionService/Sessions
Returns a Session object with: "Context": "Foobar"
Subsequent Gets of /redfish/v1/SessionService/Sessions/<sid> return the same session objects, both with and without Context.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4df358623f93f3e6cb659e99970ad909cefebc62
show more ...
|
3e7ab708 | 08-Aug-2022 |
Sunitha Harish <sunithaharish04@gmail.com> |
IBM Mgmt console lock algorithm improvement
This commit optimizes the release lock code and adds some traces to give more data for lock conflict scenarios
Tested by: 1. With dual client connected,
IBM Mgmt console lock algorithm improvement
This commit optimizes the release lock code and adds some traces to give more data for lock conflict scenarios
Tested by: 1. With dual client connected, verified the conflicts are returned 2. Tested releaseLock usecase
Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I3cf99aaa5cc7c2967ae8dbc9c76c9f7378ecebdd
show more ...
|
f8a4347e | 08-Aug-2022 |
Sunitha Harish <sunithaharish04@gmail.com> |
Fixes for IBM Management Console usecases
This commit fixes the below issues
1. Bump up the ConfigFile directory max limit For large configurations on the system, the current directory size u
Fixes for IBM Management Console usecases
This commit fixes the below issues
1. Bump up the ConfigFile directory max limit For large configurations on the system, the current directory size upper limit of 10MB was exceeding and BMC was sending the error back to the client. This fails the entire large config support. This commit Increases this upper limit of the configFile dir to 25MB
2. Return 409 Error for a lock conflict
Tested by: 1. ConfigFile read 2. Single file upload 3. AcquireLock from the same client returns 409
Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: I9218e8263f31e519d76683822290dfe259c57192
show more ...
|
41bb02bb | 08-Aug-2022 |
Sunitha Harish <sunithaharish04@gmail.com> |
IBM Mgmt console writeLock conflict fix
The isConflictRecord method was returning false by default which is causing ignoring the same resourceId conflicts. Same resourceId case will pass all the con
IBM Mgmt console writeLock conflict fix
The isConflictRecord method was returning false by default which is causing ignoring the same resourceId conflicts. Same resourceId case will pass all the conditions and reach to the end of the function. Returning true means that there is a conflict.
This commit fixes this by returning true by default
Tested by: 1. Send writeLock requests with same resourceId and segment length
Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com> Change-Id: Ie65c6394988a357a8c811b621e113c14924bb8f6
show more ...
|
d9f6c621 | 17-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Use enum overload for field setting
There are two overloads of addHeader, one that takes a string, and one that takes a boost enum. For most common headers, boost contains a string table with all o
Use enum overload for field setting
There are two overloads of addHeader, one that takes a string, and one that takes a boost enum. For most common headers, boost contains a string table with all of those entries anyway, so there's no point in duplicating the strings, and ensures that we don't make trivial mistakes, like capitalization or - versus underscore that aren't caught at compile time.
Tested: This saves a trivial amount (572 bytes) of compressed binary size.
curl --insecure -vvv --user root:0penBmc https://192.168.7.2/redfish/v1
returns < Content-Type: application/json
curl --insecure -vvv -H "Accept: text/html" --user root:0penBmc https://192.168.7.2/redfish/v1
Returns < Content-Type: text/html;charset=UTF-8
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I34c198b4f9e219247fcfe719f9b3616d35aea3dc
show more ...
|
11ba3979 | 11-Jul-2022 |
Ed Tanous <edtanous@google.com> |
Remove usages of boost::starts/ends_with
Per the coding standard, now that C++ supports std::string::starts_with and std::string::ends_with, we should be using them over the boost alternatives. Thi
Remove usages of boost::starts/ends_with
Per the coding standard, now that C++ supports std::string::starts_with and std::string::ends_with, we should be using them over the boost alternatives. This commit goes through and updates all usages.
Arguably some of these are incorrect, and instances of common error 13, but because this is mostly a mechanical it intentionally doesn't try to handle it.
Tested: Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic4c6e5d0da90f7442693199dc691a47d2240fa4f
show more ...
|
02cad96e | 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix const correctness issues
cppcheck correctly notes that a lot of variables in the new code can be const. Make most of them const.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com> Cha
Fix const correctness issues
cppcheck correctly notes that a lot of variables in the new code can be const. Make most of them const.
Tested: WIP
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8f37b6353fd707923f533e1d61c5b5419282bf23
show more ...
|
9d335096 | 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Remove unused variables
cppcheck finds a few variables that were unused in a few modules. Clean them up.
Tested: Code compiles, unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Cha
Remove unused variables
cppcheck finds a few variables that were unused in a few modules. Clean them up.
Tested: Code compiles, unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7a95025891bb537b45b99b3cd649ad05533e78f4
show more ...
|
8a592810 | 04-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Fix shadowed variable issues
This patchset is the conclusion of a multi-year effort to try to fix shadowed variable names. Variables seem to be shadowed all over, and in most places they exist, the
Fix shadowed variable issues
This patchset is the conclusion of a multi-year effort to try to fix shadowed variable names. Variables seem to be shadowed all over, and in most places they exist, there's a "code smell" of things that aren't doing what the author intended.
This commit attempts to clean up these in several ways by: 1. Renaming variables where appropriate. 2. Preferring to refer to member variables directly when operating within a class 3. Rearranging code so that pass through variables are handled in the calling scope, rather than passing them through.
These patterns are applied throughout the codebase, to the point where -Wshadow can be enabled in meson.build.
Tested: Code compiles, unit tests pass. Still need to run redfish service validator.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If703398c2282f9e096ca2694fd94515de36a098b
show more ...
|
002d39b4 | 31-May-2022 |
Ed Tanous <edtanous@google.com> |
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels
Try to fix the lambda formatting issue
clang-tidy has a setting, LambdaBodyIndentation, which it says: "For callback-heavy code, it may improve readability to have the signature indented two levels and to use OuterScope."
bmcweb is very callback heavy code. Try to enable it and see if that improves things. There are many cases where the length of a lambda call will change, and reindent the entire lambda function. This is really bad for code reviews, as it's difficult to see the lines changed. This commit should resolve it. This does have the downside of reindenting a lot of functions, which is unfortunate, but probably worth it in the long run.
All changes except for the .clang-format file were made by the robot.
Tested: Code compiles, whitespace changes only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ib4aa2f1391fada981febd25b67dcdb9143827f43
show more ...
|
1476687d | 15-Mar-2022 |
Ed Tanous <edtanous@google.com> |
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies.
Remove brace initialization of json objects
Brace initialization of json objects, while quite interesting from an academic sense, are very difficult for people to grok, and lead to inconsistencies. This patchset aims to remove a majority of them in lieu of operator[]. Interestingly, this saves about 1% of the binary size of bmcweb.
This also has an added benefit that as a design pattern, we're never constructing a new object, then moving it into place, we're always adding to the existing object, which in the future _could_ make things like OEM schemas or properties easier, as there's no case where we're completely replacing the response object.
Tested: Ran redfish service validator. No new failures.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iae409b0a40ddd3ae6112cb2d52c6f6ab388595fe
show more ...
|
8cc8edec | 28-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Don't rely on operator << for object logging
In the upcoming fmt patch, we remove the use of streams, and a number of our logging statements are relying on them. This commit changes them to no long
Don't rely on operator << for object logging
In the upcoming fmt patch, we remove the use of streams, and a number of our logging statements are relying on them. This commit changes them to no longer rely on operator>> or operator+ to build their strings. This alone isn't very useful, but in the context of the next patch makes the automation able to do a complete conversion of all log statements automatically.
Tested: enabled logging on local and saw log statements print to console
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I0e5dc2cf015c6924037e38d547535eda8175a6a1
show more ...
|
15ed6780 | 14-Dec-2021 |
Willy Tu <wltu@google.com> |
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty
json_utils: Add support jsonRead Patch/Action
Added support for readJson for Patch and Action. The only difference is that Patch does not allow empty json input while Action does. Action with empty input will use the default value based on the implementation and return 200 OK response code.
readJsonPatch will replace the existing readJson and be used for path requests. It will not allow empty json input and all requested keys are required in the json input.
readJsonAction will be used for Action requests where it is possible for all of the properties to be optional and allow empty request. The optional properties are determined by the requested values type.
All current Action readJson are replaced with readJsonAction. It does not change the existing behavior since it needs `std::optional`. This will have to be updated later as we define the default behavior.
Tested: Added unit tests and readJsonAction allows empty empty json object.
No Change to Redfish Tree.
Change-Id: Ia5e1f81695c528a20f1dc985aee19c920d8adaea Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
e662eae8 | 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-implicit-bool-conversion checks
These checks ensure that we're not implicitly converting ints or pointers into bools, which makes the code easier to read.
Tested: Ran series thro
Enable readability-implicit-bool-conversion checks
These checks ensure that we're not implicitly converting ints or pointers into bools, which makes the code easier to read.
Tested: Ran series through redfish service validator. No changes observed. UUID failing in Qemu both before and after.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1ca0be980d136bd4e5474341f4fd62f2f6bbdbae
show more ...
|
e05aec50 | 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@go
Add readability-redundant-* checks
There's a number of redundancies in our code that clang can sanitize out. Fix the existing problems, and enable the checks.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie63d7b7f0777b702fbf1b23a24e1bed7b4f5183b
show more ...
|
9eb808c1 | 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-avoid-const-params-in-decls
This check involves explicitly declaring variables const when they're declared auto, which helps in readability, and makes it more clear that the varia
Enable readability-avoid-const-params-in-decls
This check involves explicitly declaring variables const when they're declared auto, which helps in readability, and makes it more clear that the variables are const.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I71198ea03850384a389a56ad26f2c4a48c75b148
show more ...
|
dcf2ebc0 | 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-redundant-control-flow checks
These checks are a nice addition to our static analysis, as they simplify code quite a bit, as can be seen by this diff being negative lines.
Signed
Enable readability-redundant-control-flow checks
These checks are a nice addition to our static analysis, as they simplify code quite a bit, as can be seen by this diff being negative lines.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I60ede4ad23d7e5337e811d70ddcab24bf8986891
show more ...
|
104f09c9 | 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-named-parameter checks
We don't have too many violations here, probably because we don't have many optional parameters. Fix the existing instances, and enable the check.
Signed-
Enable readability-named-parameter checks
We don't have too many violations here, probably because we don't have many optional parameters. Fix the existing instances, and enable the check.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I4d512f0ec90b060fb60a42fe3cd6ba72fb6c6bcb
show more ...
|
26f6976f | 25-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131a
Enable readability-container-size-empty tests
This one is a little trivial, but it does help in readability.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5366d4eec8af2f781b3bad804131ae2eb806e3aa
show more ...
|
ca45aa3c | 07-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable checks for pointer arithmetic
Quite a few places we've disobeyed this rule, so simply ignore them for now to avoid new issues popping up.
Signed-off-by: Ed Tanous <edtanous@google.com> Chang
Enable checks for pointer arithmetic
Quite a few places we've disobeyed this rule, so simply ignore them for now to avoid new issues popping up.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3e518a8e8742279afb3ad1a9dad54006ed109fb1
show more ...
|
46ff87ba | 07-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable reinterpre_cast checks
We seem to use reinterpret cast in a few cases unfortunately. For the moment, simply ignore most of them, and make it so we don't get more.
Signed-off-by: Ed Tanous <
Enable reinterpre_cast checks
We seem to use reinterpret cast in a few cases unfortunately. For the moment, simply ignore most of them, and make it so we don't get more.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic860cf922576b18cdc8d51d6132f5a9cbcc1d9dc
show more ...
|
ecd6a3a2 | 07-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable cppcoreguidelines-special-member-functions checks
Part of enforcing cpp core guidelines involves explicitly including all constructors required on a non-trivial class. We were missing quite
Enable cppcoreguidelines-special-member-functions checks
Part of enforcing cpp core guidelines involves explicitly including all constructors required on a non-trivial class. We were missing quite a few. In all cases, the copy/move/and operator= methods are simply deleted.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie8d6e8bf2bc311fa21a9ae48b0d61ee5c1940999
show more ...
|
543f4400 | 06-Jan-2022 |
Ed Tanous <edtanous@google.com> |
Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is something we already enforce to some extent, but getting CI to enforce it will help reviews move faster.
T
Enable init checker
clang-tidy added cppcoreguidelines-init-variables as a check, which is something we already enforce to some extent, but getting CI to enforce it will help reviews move faster.
Tested: Code compiles. Noop changes.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7e10950de617b1d3262265572b1703f2e60b69d0
show more ...
|
5107ac42 | 12-Oct-2021 |
Patrick Williams <patrick@stwcx.xyz> |
ibm: remove unused tinyxml2 include
Fixes openbmc/bmcweb#226.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Id8d30c23556fe445c3233f47406d14a6173d568c |