#
7f3e84a1
|
| 28-Dec-2022 |
Ed Tanous <ed@tanous.net> |
Add an option flag for multi-computersystem
A number of discussions have occurred, and it's clear that multi-computer system is not a transition that can be done in a single series of commits, and n
Add an option flag for multi-computersystem
A number of discussions have occurred, and it's clear that multi-computer system is not a transition that can be done in a single series of commits, and needs to be done incrementally over time. This commit adds the initial option for multi-computer system support, with an option flag that can be enabled when the new behavior is desired. This is to prevent needing a long-lived fork.
This option operatates such that if enabled, all ComputerSystem route options will now return 404. This is to allow the redfish service validator to pass, and to be used for incremental development. As the routes are moved over, they will be enabled, and service validator re-run.
Per the description in the meson options, this option flag, and all code beneath of it will be removed on 9/1/23. The expectation is that by this date, given the appropriate level of effort in implementation, there will be no code remaining under that option flag. After this date, code beneath this option flag will be removed.
Tested: No functional changes without option.
With option enabled, /redfish/v1/Systems produces no entries. Spot check of various routes returns 404.
Redfish service validator passes.
Change-Id: I3b58642cb76d61df668076c2e0f1e7bed110ae25 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
5eb468da
|
| 20-Jun-2023 |
George Liu <liuxiwei@inspur.com> |
Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in dbus_utility and this commit is to integrate all the places where the GetManagedObjects method is obtaine
Refactor getManagedObjects method
Since the getManagedObjects method has been implemented in dbus_utility and this commit is to integrate all the places where the GetManagedObjects method is obtained, and use the method in dbus_utility uniformly.
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ic13f2bef7b30f805cd3444a75d7df17b031f2eb0
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 ...
|
#
dfbf7de5
|
| 13-Apr-2023 |
Chris Cain <cjcain@us.ibm.com> |
Processor: Add processor throttle status
- Update Processor Schema to 18.0 - Add processor throttle status and cause https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/63063 Throttl
Processor: Add processor throttle status
- Update Processor Schema to 18.0 - Add processor throttle status and cause https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/63063 Throttled: An indication of whether the processor is throttled. ThrottledCauses: An array of reasons that the processor is throttled.
Ran validator and no new errors were found.
Change-Id: Ia4a58ae0f26ffc6177f418420ba45063471323da Signed-off-by: Chris Cain <cjcain@us.ibm.com>
show more ...
|
#
ef4c65b7
|
| 24-Apr-2023 |
Ed Tanous <edtanous@google.com> |
Boost::urls::format
Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot like our urlFromPieces method, but better in that it makes the resulting uris more readable, and allows d
Boost::urls::format
Boost 1.82 dropped a lovely new toy, boost::urls::format, which is a lot like our urlFromPieces method, but better in that it makes the resulting uris more readable, and allows doing things like fragments in a single line instead of multiple. We should prefer it in some cases.
Tested: Redfish service validator passes. Spot checks of URLs work as expected. Unit tests pass.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia7b38f0a95771c862507e7d5b4aa68aa1c98403c
show more ...
|
#
b2ba3072
|
| 12-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could be used instead of a push. Use a few grep/sed pairs to find and fix up some common patterns.
fix more push vs emplace calls
It seems like clang-tidy doesn't catch every place that an emplace could be used instead of a push. Use a few grep/sed pairs to find and fix up some common patterns.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I93eaec26b8e3be240599e92b66cf54947073dc4c
show more ...
|
#
89492a15
|
| 10-May-2023 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: copy latest and re-format
clang-format-16 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-16 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: I75f89d2959b0f1338c20d72ad669fbdc1d720835 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
#
39662a3b
|
| 06-Feb-2023 |
Ed Tanous <edtanous@google.com> |
Make url by value in Request
There's some tough-to-track-down safety problems in http Request. This commit is an attempt to make things more safe, even if it isn't clear how the old code was wrong.
Make url by value in Request
There's some tough-to-track-down safety problems in http Request. This commit is an attempt to make things more safe, even if it isn't clear how the old code was wrong.
Previously, the old code took a url_view from the target() string for a given URI. This was effectively a pointer, and needed to be updated in custom move/copy constructors that were error prone to write.
This commit moves to taking the URI by non-view, which involves a copy, but allows us to use the default move and copy constructors, as well as have no internal references within Request, which should improve the safety and reviewability.
There's already so many string copies in bmcweb, that this is unlikely to show up as any sort of performance regression, and simple code is much better in this case.
Note, because of a bug in boost::url, we have to explicitly construct a url_view in any case where we want to use segments() or query() on a const Request. This has been reported to the boost maintainers, and is being worked for a long term solution.
https://github.com/boostorg/url/pull/704
Tested: Redfish service validator passed on last commit in series.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I49a7710e642dff624d578ec1dde088428f284627
show more ...
|
#
b9d679d1
|
| 12-Feb-2023 |
Michael Shen <gpgpgp@google.com> |
processor: Change `Step` default value to USHRT_MAX
Change `Step` default value to USHRT_MAX due to https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60717
For a new processor, it's p
processor: Change `Step` default value to USHRT_MAX
Change `Step` default value to USHRT_MAX due to https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60717
For a new processor, it's possible that the stepping is really `0`. In this case, the `Step` will still be ignored which is not expected.
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/60717 changes the `Step` default value to `maxint`. Thus the `Step` can correctly display 0 on redfish.
Tested: 1. Redfish service validator passing. 2. bmcweb works fine without errors. 3. Step was hidden when its value is 65535 (max uint16_t). 4. Step also displayed even the value is `0`. ``` root@machine:~# curl localhost/redfish/v1/Systems/system/Processors/cpu0 ... "Step": "0x0000" ... ```
Change-Id: I1857fc597ef2ab13256dc60e534c23d452e5d695 Signed-off-by: Michael Shen <gpgpgp@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 ...
|
#
eddfc437
|
| 26-Sep-2022 |
Willy Tu <wltu@google.com> |
Update most resources to use urlFromPieces
Only id in event_service and account_service have not been updated due to the risk of it breaking the username/id. It will require further testing to verif
Update most resources to use urlFromPieces
Only id in event_service and account_service have not been updated due to the risk of it breaking the username/id. It will require further testing to verify.
Use urlFromPieces wherever that is needed to insert a variable in the URI. Don't use urlFromPieces when it is hardcoded values. This allow us to control all resource URIs that is dynamically added and to sync with the current recommanded method for `@odata.id`. The goal is to have a common place to manage the url created from dbus-paths in order to manage/update it easily when needed.
Tested: RedfishValidtor Passed for all resource including the sensors with the fragments.
Change-Id: I95cdfaaee58fc7f21c95f5944e1e5c813b3215f2 Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
e99073f5
|
| 08-Dec-2022 |
George Liu <liuxiwei@inspur.com> |
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method i
Refactor GetSubTree method
Since the GetSubTree method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTree method is called, and use the method in dbus_utility uniformly.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: If3852b487d74e7cd8f123e0efffbd4affe92743c
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 ...
|
#
7a1dbc48
|
| 07-Dec-2022 |
George Liu <liuxiwei@inspur.com> |
Refactor GetSubTreePaths method
Since the GetSubTreePaths method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTreePaths method is called, and u
Refactor GetSubTreePaths method
Since the GetSubTreePaths method has been implemented in dbus_utility and this commit is to integrate all the places where the GetSubTreePaths method is called, and use the method in dbus_utility uniformly.
Requires https://gerrit.openbmc.org/c/openbmc/sdbusplus/+/60020 to build.
Tested: Redfish Validator Passed
Signed-off-by: George Liu <liuxiwei@inspur.com> Change-Id: Ie4140d4484a7e4f4b943013f4371ffd2d44a22e9
show more ...
|
#
f8fe53e7
|
| 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Change variable scopes
cppcheck correctly notes that a lot of our variables can be declared at more specific scopes, and in every case, it seems to be correct.
Tested: Redfish service validator pas
Change variable scopes
cppcheck correctly notes that a lot of our variables can be declared at more specific scopes, and in every case, it seems to be correct.
Tested: Redfish service validator passes. Unit test coverage on others.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia4414410d0e8f74a3bd40fdc0e0232450d1a6416
show more ...
|
#
71a24ca4
|
| 10-Nov-2022 |
Nikhil Namjoshi <nikhilnamjoshi@google.com> |
Processor: Implement links and HEAD
Adds Links and Head handler for Processor and ProcessorCollection
Tested: All of the below return a link header HEAD /redfish/v1/Systems/system/Processors HEAD /
Processor: Implement links and HEAD
Adds Links and Head handler for Processor and ProcessorCollection
Tested: All of the below return a link header HEAD /redfish/v1/Systems/system/Processors HEAD /redfish/v1/Systems/system/Processors/cpu0 GET /redfish/v1/Systems/system/Processors GET /redfish/v1/Systems/system/Processors/cpu0
Change-Id: Iad19d577afb7cd9d5e652bed2d5884b6ea8260da Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
show more ...
|
#
ae9031f0
|
| 27-Sep-2022 |
Willy Tu <wltu@google.com> |
Update CollectionMembers to use UrlFromPieces
Refactor getCollectionMembers to make sure all Url created with dbus paths are generated via UrlFromPieces helper function. This allow us to manage all
Update CollectionMembers to use UrlFromPieces
Refactor getCollectionMembers to make sure all Url created with dbus paths are generated via UrlFromPieces helper function. This allow us to manage all URL generated from dbus in one place and allow us to make future changes to affect all resources.
We can make changes to all resources easier if they are all managed by one function.
Tested: Redfish Validator Passed. All Collections working as expected and match previous implmentation.
Change-Id: I5d3b2b32f047ce4f20a2287a36a3e099efd6eace Signed-off-by: Willy Tu <wltu@google.com>
show more ...
|
#
22d268cb
|
| 19-May-2022 |
Ed Tanous <edtanous@google.com> |
Make routes start matching Redfish
This is preliminary patch to set up the route handling such that it's ready for the addition of multiple hosts, multiple managers in the future. Routes previously
Make routes start matching Redfish
This is preliminary patch to set up the route handling such that it's ready for the addition of multiple hosts, multiple managers in the future. Routes previously took the form of
/redfish/v1/Systems/system
which essentially hardcoded the name "system" into a number of places. As the stack evolves to support multiple systems, this needs to change.
This patchset changes all the ComputerSystem resources to the form: /redfish/v1/Systems/<str>
and adds 404 checks to each route such that they will be handled properly still. This means that as we evolve our multi-host support, each individual route can be moved one at a time to support multi-host.
In the future, moving these to redfish-spec-defined routing would likely mean that we could generate this code in the future at some point, which reduces the likelihood that people do it incorrectly.
This patch currently sets the resource id and resource type in the resourceNotFound message to empty string (""). This handling is still arguably more correct than what we had before, which just returned 404 with an empty payload, although this will be corrected in the future.
Tested: None yet. RFC to see if this is a pattern we'd like to propogate
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: If9c07ad69f5287bb054645f460d7e370d433dc27
show more ...
|
#
6169de2c
|
| 14-Sep-2022 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
processor: Don't display DBus defaults
EffectiveFamily, EffectiveModel, MicrocodeInfo, Id, and SparePartNumber all have default values specified in the OpenBMC DBus data model. Do not populate thes
processor: Don't display DBus defaults
EffectiveFamily, EffectiveModel, MicrocodeInfo, Id, and SparePartNumber all have default values specified in the OpenBMC DBus data model. Do not populate these attributes as outlined in DBUS_USAGE.md.
Tested: Compiled. bmcweb does not crash at startup. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I8bfb7a8fef28d2ab6a7d77fb809c0b3e51e368f8
show more ...
|
#
351053f2
|
| 28-Jul-2022 |
Krzysztof Grobelny <krzysztof.grobelny@intel.com> |
used sdbusplus::unpackPropertiesNoThrow part 1
used sdbusplus::unpackPropertiesNoThrow in processor.hpp, also replaced all usages of "GetAll" with sdbusplus::asio::getAllProperties
bmcweb size:
used sdbusplus::unpackPropertiesNoThrow part 1
used sdbusplus::unpackPropertiesNoThrow in processor.hpp, also replaced all usages of "GetAll" with sdbusplus::asio::getAllProperties
bmcweb size: 2681176 -> 2677080 (-4096) compressed size: 1129892 -> 1128633 (-1259)
Tested: Performed get on: - redfish/v1/Systems/system/Processors - redfish/v1/Systems/system/Processors/cpu0
Get result before and after the change was the same
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com> Change-Id: Ib28d842e348ebd8f160ec23b629ee4c4b280329b
show more ...
|
#
59d494ee
|
| 22-Jul-2022 |
Patrick Williams <patrick@stwcx.xyz> |
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are
sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types. Switch to using them to provide better code clarity and shorter lines. Possible replacements are for: * bus_t * exception_t * manager_t * match_t * message_t * object_t * slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I46a5eec210002af84239af74a93c830b1d4a13f1
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 ...
|
#
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 ...
|
#
3ba00073
|
| 06-Jun-2022 |
Carson Labrado <clabrado@google.com> |
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation op
Expose AsyncResp shared_ptr when handling response
For Redfish Aggregation, we need a common point to check the D-Bus for satellite configs. If they are available then we perform the aggregation operations. The functions in query.hpp are used by all endpoints making them the logical location. The aggregation code requires a shared_ptr to the AsyncResp so these functions need to be able to supply that.
This patch is broken out of a future patch for routing Redfish Aggregation requests https://gerrit.openbmc.org/c/openbmc/bmcweb/+/53310
The follow commands can be used to perform most of the replacements: find . -type f | xargs sed -i 's/setUpRedfishRoute(app, req, asyncResp->res/setUpRedfishRoute(app, req, asyncResp/g' find . -type f | xargs sed -i 's/setUpRedfishRouteWithDelegation(app, req, asyncResp->res/setUpRedfishRouteWithDelegation(app, req, asyncResp/g'
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: I4f4f9f22cdcfb14a3bd94b9a8f3d64aae34e57bc
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 ...
|