#
504af5a0 |
| 03-Feb-2025 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <p
clang-format: update latest spec and reformat
Copy the latest format file from the docs repository and apply.
Change-Id: I2f0b9d0fb6e01ed36a2f34c750ba52de3b6d15d1 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
d7857201 |
| 28-Jan-2025 |
Ed Tanous <etanous@nvidia.com> |
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is
Fix includes
Clang-tidy misc-include-cleaner appears to now be enforcing significantly more headers than previously. That is overall a good thing, but forces us to fix some issues. This commit is largely just taking the clang-recommended fixes and checking them in. Subsequent patches will fix the more unique issues.
Note, that a number of new ignores are added into the .clang-tidy file. These can be cleaned up over time as they're understood. The majority are places where boost includes a impl/x.hpp and x.hpp, but expects you to use the later. include-cleaner opts for the impl, but it isn't clear why.
Change-Id: Id3fdd7ee6df6c33b2fd35626898523048dd51bfb Signed-off-by: Ed Tanous <etanous@nvidia.com> Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
40e9b92e |
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This pa
Use SPDX identifiers
SPDX identifiers are simpler, and reduce the amount of cruft we have in code files. They are recommended by linux foundation, and therefore we should do as they allow.
This patchset does not intend to modify any intent on any existing copyrights or licenses, only to standardize their inclusion.
[1] https://www.linuxfoundation.org/blog/blog/copyright-notices-in-open-source-software-projects
Change-Id: I935c7c0156caa78fc368c929cebd0f068031e830 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
deae6a78 |
| 11-Nov-2024 |
Ed Tanous <etanous@nvidia.com> |
Move getProperty calls to utility
Having all dbus calls run through the same utility reduces the amount of generated code, and more importantly, gives us a place where we can log the requests and re
Move getProperty calls to utility
Having all dbus calls run through the same utility reduces the amount of generated code, and more importantly, gives us a place where we can log the requests and responses to help with debugging.
Tested: Redfish service validator passes.
Change-Id: Ic1bf45130b5069cd57f7af26e12c8d3159c87c67 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
6be832e2 |
| 10-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that c
Remove duplicated block comments
Static analysis flags that these two comments are redundant[1], which seem to be duplicated a lot in copyright headers. Although there is a larger discussion that can likely be had.
[1] https://sonarcloud.io/project/issues?issueStatuses=OPEN%2CCONFIRMED&id=edtanous_bmcweb&open=AY9_HYjgKXKyw1ZFwgVP
Tested: Comment change only. Code compiles.
Change-Id: Ia960317761f558a87842347ca0b5f3da63f8e730 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
#
bd79bce8 |
| 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: Iceec1dc95b6c908ec6c21fb40093de9dd18bf11a Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
539d8c6b |
| 19-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are
Consistently use generated enumerations
This commit causes all of Redfish to use generated enum values for enum types. Using generated code prevents problems, and makes it more clear what types are allowed.
Doing this found two places where we had structs that didn't fulfill the schema. They have been commented, but will be fixed with a breaking change at some point in the future.
Tested: WIP
Change-Id: I5fdd2f2dfb6ec05606a522e1f4e331f982c8e476 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
e93abac6 |
| 14-Jun-2024 |
Ginu George <ginugeorge@ami.com> |
Pass redfishPropertyName earlier argument
It was pointed out that the setDbusProperty method should have an end that approximately matches dbus-send and busctl set-property in its arguments, to aid
Pass redfishPropertyName earlier argument
It was pointed out that the setDbusProperty method should have an end that approximately matches dbus-send and busctl set-property in its arguments, to aid with debug. This seems reasonable.
Tested: Redfish service validator passes.
Change-Id: Ic20295d93c71c957e3e76704e1eda9da187861b1 Signed-off-by: Ginu George <ginugeorge@ami.com> Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
87c44966 |
| 04-Apr-2024 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
Move to Redfish setProperty call
This commit changes sdbusplus setProperty calls (in various files) to setDbusProperty method in Redfish namespace that handles all DBus errors in a consistent manner
Move to Redfish setProperty call
This commit changes sdbusplus setProperty calls (in various files) to setDbusProperty method in Redfish namespace that handles all DBus errors in a consistent manner.
It also handles and translates additional DBus errors to Redfish specific errors in dbus_utils file.
Tested By: Not tested yet
Change-Id: If440774879413754f4c24f9b6572c3c9fa1fd033 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
#
8ece0e45 |
| 02-Jan-2024 |
Ed Tanous <ed@tanous.net> |
Fix spelling mistakes
These were found with: codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$")
At some point in the future, we might want to get this enabled in CI.
Change-Id: Iccb57b2adfd06a2
Fix spelling mistakes
These were found with: codespell -w $(git ls-files | grep "\.[hc]\(pp\)\?$")
At some point in the future, we might want to get this enabled in CI.
Change-Id: Iccb57b2adfd06a2e177e99db2923fe4e8e329118 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
59a17e4f |
| 07-Oct-2022 |
George Liu <liuxiwei@inspur.com> |
Rename getLocationIndicatorActive/setLocationIndicatorActive
This commit renames getLocationIndicatorActive/setLocationIndicatorActive No functional changes.
Tested: built bmcweb successfully and V
Rename getLocationIndicatorActive/setLocationIndicatorActive
This commit renames getLocationIndicatorActive/setLocationIndicatorActive No functional changes.
Tested: built bmcweb successfully and Validator passes
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I0c5d538c1dd9f0d8dd1e6ae4d8ba4f606b804373 Signed-off-by: Lakshmi Yadlapati <lakshmiy@us.ibm.com>
show more ...
|
#
5a39f77a |
| 20-Oct-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest
clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require additional settings for best compatibility and re-running the formatter. Copy the latest .clang-format from the docs repository and reformat the repository.
Change-Id: I2f9540cf0d545a2da4d6289fc87b754f684bc9a7 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
62598e31 |
| 17-Jul-2023 |
Ed Tanous <ed@tanous.net> |
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level
Replace logging with std::format
std::format is a much more modern logging solution, and gives us a lot more flexibility, and better compile times when doing logging.
Unfortunately, given its level of compile time checks, it needs to be a method, instead of the stream style logging we had before. This requires a pretty substantial change. Fortunately, this change can be largely automated, via the script included in this commit under scripts/replace_logs.py. This is to aid people in moving their patchsets over to the new form in the short period where old patches will be based on the old logging. The intention is that this script eventually goes away.
The old style logging (stream based) looked like.
BMCWEB_LOG_DEBUG << "Foo " << foo;
The new equivalent of the above would be: BMCWEB_LOG_DEBUG("Foo {}", foo);
In the course of doing this, this also cleans up several ignored linter errors, including macro usage, and array to pointer deconstruction.
Note, This patchset does remove the timestamp from the log message. In practice, this was duplicated between journald and bmcweb, and there's no need for both to exist.
One design decision of note is the addition of logPtr. Because the compiler can't disambiguate between const char* and const MyThing*, it's necessary to add an explicit cast to void*. This is identical to how fmt handled it.
Tested: compiled with logging meson_option enabled, and launched bmcweb
Saw the usual logging, similar to what was present before: ``` [Error include/webassets.hpp:60] Unable to find or open /usr/share/www/ static file hosting disabled [Debug include/persistent_data.hpp:133] Restored Session Timeout: 1800 [Debug redfish-core/include/event_service_manager.hpp:671] Old eventService config not exist [Info src/webserver_main.cpp:59] Starting webserver on port 18080 [Error redfish-core/include/event_service_manager.hpp:1301] inotify_add_watch failed for redfish log file. [Info src/webserver_main.cpp:137] Start Hostname Monitor Service... ``` Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: I86a46aa2454be7fe80df608cb7e5573ca4029ec8
show more ...
|
#
9ae226fa |
| 21-Jun-2023 |
George Liu <liuxiwei@inspur.com> |
Refactor setProperty method
SetProperty is a method we should use more, and use consistently in the codebase, this commit makes it consistently used from the utility namespace.
Tested: Refactor. C
Refactor setProperty method
SetProperty is a method we should use more, and use consistently in the codebase, this commit makes it consistently used from the utility namespace.
Tested: Refactor. Code compiles.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: I5939317d23483e16bd98a8298f53e75604ef374d
show more ...
|
#
ac106bf6 |
| 07-Jun-2023 |
Ed Tanous <edtanous@google.com> |
Consistently name AsyncResp variables
In about half of our code, AsyncResp objects take the name asyncResp, and in the other half they take the name aResp. While the difference between them is negl
Consistently name AsyncResp variables
In about half of our code, AsyncResp objects take the name asyncResp, and in the other half they take the name aResp. While the difference between them is negligeble and arbitrary, having two naming conventions makes it more difficult to do automated changes over time via grep.
This commit was generated automtatically with the command: git grep -l 'aResp' | xargs sed -i 's|aResp|asyncResp|g'
Tested: Code compiles.
Change-Id: Id363437b6a78f51e91cbf60aa0a0c2286f36a037 Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
5e7e2dc5 |
| 16-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a co
Take boost error_code by reference
By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae
show more ...
|
#
3ccb3adb |
| 13-Jan-2023 |
Ed Tanous <edtanous@google.com> |
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't
Fix a boatload of #includes
Most of these missing includes were found by running clang-tidy on all files, including headers. The existing scripts just run clang-tidy on source files, which doesn't catch most of these.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ic741fbb2cc9e5e92955fd5a1b778a482830e80e8
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 ...
|
#
1e1e598d |
| 11-Jun-2021 |
Jonathan Doman <jonathan.doman@intel.com> |
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with:
https://gerrit.openbmc-project.xyz/c/o
Using sdbusplus::asio::getProperty
It simplifies a lot of code and after changing sdbusplus implementation slightly reduces binary size if used together with:
https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/49467
* Uncompressed size: 3033148 -> 3012164, -20984 B * gzip compressed size: 1220586 -> 1214625, -5961 B
Tested: - Redfish validator output is the same before and after the change
Change-Id: Ibe3227d3f4230de2363ba3d9396e51130c8240a5 Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
show more ...
|
#
168e20c1 |
| 13-Dec-2021 |
Ed Tanous <edtanous@google.com> |
Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb due to reduced template instantiations. This amounts to a 2.5% reduction in the overall size.
Note, the
Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb due to reduced template instantiations. This amounts to a 2.5% reduction in the overall size.
Note, there were a few places where we broke const-correctness in the form of pulling a non-const reference out of a const variant. This new variant now requires const correctness, so some consts are added where required.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2
show more ...
|
#
7e860f15 |
| 08-Apr-2021 |
John Edward Broadbent <jebr@google.com> |
Remove Redfish Node class
Reduces the total number of lines and will allow for easier testing of the redfish responses.
A main purpose of the node class was to set app.routeDynamic(). However now a
Remove Redfish Node class
Reduces the total number of lines and will allow for easier testing of the redfish responses.
A main purpose of the node class was to set app.routeDynamic(). However now app.routeDynamic can handle the complexity that was once in critical to node. The macro app.routeDynamic() provides a shorter cleaner interface to the unerlying app.routeDyanic call. The old pattern set permissions for 6 interfaces (get, head, patch, put, delete_, and post) even if only one interface is created. That pattern creates unneeded code that can be safely removed with no effect. Unit test for the responses would have to mock the node the class in order to fully test responses.
see https://github.com/openbmc/bmcweb/issues/181
The following files still need node to be extracted.
virtual_media.hpp account_service.hpp redfish_sessions.hpp ethernet.hpp
The files above use a pattern that is not trivial to address. Often their responses call an async lambda capturing the inherited class. ie (https://github.com/openbmc/bmcweb/blob/ffed87b5ad1797ca966d030e7f979770 28d258fa/redfish-core/lib/account_service.hpp#L1393) At a later point I plan to remove node from the files above.
Tested: I ran the docker unit test with the following command. WORKSPACE=$(pwd) UNIT_TEST_PKG=bmcweb ./openbmc-build-scripts/run-unit-test-docker.sh
I ran the validator and this change did not create any issues. python3 RedfishServiceValidator.py -c config.ini
Signed-off-by: John Edward Broadbent <jebr@google.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I147a0289c52cb4198345b1ad9bfe6fdddf57f3df
show more ...
|
#
8d1b46d7 |
| 31-Mar-2021 |
zhanghch05 <zhanghch05@inspur.com> |
Using AsyncResp everywhere
Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response getting ended a
Using AsyncResp everywhere
Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response getting ended after the first tree is done populating. Don't use res.end() anymore.
Tested: 1. Validator passed.
Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
show more ...
|
#
1d40ef69 |
| 26-Feb-2021 |
Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> |
led: Fix for Chassis IndicatorLED patch response
While Patching Chassis Indicator LED from Redfish, response is showing as empty but HTTPS status code is "200 OK" on successful case. So provided fix
led: Fix for Chassis IndicatorLED patch response
While Patching Chassis Indicator LED from Redfish, response is showing as empty but HTTPS status code is "200 OK" on successful case. So provided fix for Proper response on Success.
Tested: 1. Verified RedFish validator passed 2. Verified the response on Redfish by updating IndicatorLED status. PATCH: https://<BMC-IP>/redfish/v1/Chassis/<Baseboard-ID> Body: { "IndicatorLED": "Blinking" } Response: { "@Message.ExtendedInfo": [ { "@odata.type": "#Message.v1_1_1.Message", "Message": "Successfully Completed Request", "MessageArgs": [], "MessageId": "Base.1.8.1.Success", "MessageSeverity": "OK", "Resolution": "None" } ] }
Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com> Change-Id: I2e1281e6c06c445fe8d0c350bb74ea18f3461a35
show more ...
|
#
9f8bfa7c |
| 28-Sep-2020 |
Gunnar Mills <gmills@us.ibm.com> |
Add new Location Indicator property
In ComputerSystem 1.13 and Chassis 1.14 as well as in many other schemas IndicatorLED is replaced with LocationIndicatorActive.
LocationIndicatorActive is a bool
Add new Location Indicator property
In ComputerSystem 1.13 and Chassis 1.14 as well as in many other schemas IndicatorLED is replaced with LocationIndicatorActive.
LocationIndicatorActive is a bool while IndicatorLED had 3 states: Lit, Blink, and off. Map Lit and Blink both to LocationIndicatorActive true.
led.hpp was calling both enclosure_identify_blink and enclosure_identify, continue this.
Keep the deprecated IndicatorLED and implement the new LocationIndicatorActive property. Have both properties for the time being. This new property makes the same calls.
This does add a new Redfish warning for the deprecated IndicatorLED. Other warning are there today.
Tested: Validator passes Could use help testing on Chassis. Our systems don't have a IndicatorLED on chassis. See chassis bumped. curl -k https://$bmc/redfish/v1/Systems/system { "@odata.id": "/redfish/v1/Systems/system", "@odata.type": "#ComputerSystem.v1_13_0.ComputerSystem", ... "IndicatorLED": "Off", "LastResetTime": "2020-10-29T09:01:03+00:00", "Links": { "Chassis": [ { "@odata.id": "/redfish/v1/Chassis/chassis" } ], "ManagedBy": [ { "@odata.id": "/redfish/v1/Managers/bmc" } ] }, "LocationIndicatorActive": false,
curl -X PATCH -d '{ "LocationIndicatorActive":true}' -k \ https://$bmc/redfish/v1/Systems/system
curl -X PATCH -d '{ "IndicatorLED":"Off"}' -k \ https://$bmc/redfish/v1/Systems/system
Change-Id: I105bed5794912c575aa9a00e0442461bfdee6180 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
b5a76932 |
| 29-Sep-2020 |
Ed Tanous <ed@tanous.net> |
Lots of performance improvements
(In the voice of the kid from sixth sense) I see string copies...
Apparently there are a lot of places we make unnecessary copies. This fixes all of them.
Not sure
Lots of performance improvements
(In the voice of the kid from sixth sense) I see string copies...
Apparently there are a lot of places we make unnecessary copies. This fixes all of them.
Not sure how to split this up into smaller patches, or if it even needs split up. It seems pretty easy to review to me, because basically every diff is identical.
Change-Id: I22b4ae4f96f7e4082d2bc701098a04f7bed95369 Signed-off-by: Ed Tanous <ed@tanous.net> Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
show more ...
|