45de6126 | 14-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Trick bugprone exception escape
Catching exceptions in main is annoying, because it prevents core dumps from happening in systemd. We initially did this so we could enable the bugprone-exception-es
Trick bugprone exception escape
Catching exceptions in main is annoying, because it prevents core dumps from happening in systemd. We initially did this so we could enable the bugprone-exception-escape check [1]. That documentation shows that
"Functions declared explicitly with noexcept(false) or throw(exception) will be excluded from the analysis,"
This seems like a better idea than catching all exceptions and printing.
Tested: bmcweb launches normally. clang-tidy passes.
[1] https://clang.llvm.org/extra/clang-tidy/checks/bugprone/exception-escape.html
Change-Id: I943b3b1c13bcbc21cd18f392cdc7574edf2f809e Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
a782e265 | 12-Aug-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
event logs: move route requests
The alternative routes declared depending on BMCWEB_REDFISH_DBUS_LOG can be closer together. This makes the route declarations more readable.
Tested: no, simple code
event logs: move route requests
The alternative routes declared depending on BMCWEB_REDFISH_DBUS_LOG can be closer together. This makes the route declarations more readable.
Tested: no, simple code move
Change-Id: Ia296a3391cc8476b4fa4a1198a7005aab000b4fa Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
show more ...
|
898f2aa2 | 07-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Consolidate LogEntry builders
We have copies of essentially the same code in two places for building a log entry from a given set of dbus interfaces. Consolidate them.
Tested: GET /redfish/v1/Syst
Consolidate LogEntry builders
We have copies of essentially the same code in two places for building a log entry from a given set of dbus interfaces. Consolidate them.
Tested: GET /redfish/v1/Systems/system/LogServices/EventLog/Entries Returns Entries
Get /redfish/v1/Systems/system/LogServices/EventLog/Entries/2 Returns the individual entry, matching the expected result.
Redfish service validator passes for log services. (Other failures present).
Change-Id: I58fb7a4b0af2229416d5efe903ca04771b289962 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
587090cd | 12-Aug-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
update service: use return path for task callback
Currently the update service is using the start update path for monitoring the activation interfaces, but instead it needs to use the object path re
update service: use return path for task callback
Currently the update service is using the start update path for monitoring the activation interfaces, but instead it needs to use the object path returned by start update API. By using the returned path the changes to the activation interface are passed over to the task status. For more details refer to design - https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/65738 https://gerrit.openbmc.org/c/openbmc/docs/+/65739
Tested: Start update with ApplyTime as onReset ``` > curl -k -H "X-Auth-Token: $token" -H "Content-Type:multipart/form-data" -X POST -F UpdateParameters="{\"Targets\":[\"/redfish/v1/UpdateService/FirmwareInventory/3c956be0\"],\"@Redfish.OperationApplyTime\":\"OnReset\"};type=application/json" -F "UpdateFile=@obmc-phosphor-image-romulus-20240529184214.static.mtd.tar;type=application/octet-stream" https://${bmc}/redfish/v1/UpdateService/update { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "Id": "0", "TaskState": "Running", "TaskStatus": "OK" }
...
> curl -k -H "X-Auth-Token: $token" -X GET https://${bmc}/redfish/v1/TaskService/Tasks/0 { "@odata.id": "/redfish/v1/TaskService/Tasks/0", "@odata.type": "#Task.v1_4_3.Task", "EndTime": "2024-08-12T07:35:42+00:00", "HidePayload": false, "Id": "0", "Messages": [ ... }, "PercentComplete": 100, "StartTime": "2024-08-12T07:35:15+00:00", "TaskMonitor": "/redfish/v1/TaskService/TaskMonitors/0", "TaskState": "Completed", "TaskStatus": "OK" } ```
Change-Id: Ib17c5da329361fc59b0a1923ace214a8bf9e8371 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
608fb7b7 | 09-Aug-2024 |
Potin Lai <potin.lai@quantatw.com> |
http_body: Implement static bmcweb::HttpBody::size() function
In boost::beast::http::message::prepare_payload(), if HttpBody does not implement a size() function, it defaults to calling chunked(true
http_body: Implement static bmcweb::HttpBody::size() function
In boost::beast::http::message::prepare_payload(), if HttpBody does not implement a size() function, it defaults to calling chunked(true) for HTTP/1.1 and chunked(false) for other versions.
We encountered an issue with request data (an extra final chunk) when `chunked(true)` is called with empty data. To ensure prepare_payload behaves as expected, we want it to follow the code path that handles the payload size correctly. Specifically, we want it to:
- Use `content_length(n)` for requests with data. - Use `chunked(false)` for requests without data.
By adding a static implementation of the bmcweb::HttpBody::size() function, we ensure the payload size is returned correctly, guiding prepare_payload to the expected code section[1]
Tested on Catalina with continuous Redfish aggregation queries; no errors or incorrect responses were observed.
[1] https://github.com/boostorg/beast/blob/fee9be0be10c9c9a22ac1505a710d1d8ed5a3dfb/include/boost/beast/http/impl/message.hpp#L364-L374
Signed-off-by: Potin Lai <potin.lai@quantatw.com> Signed-off-by: Ed Tanous <etanous@nvidia.com> Change-Id: I4d84c8b6b9b3d65ce97e010b875ea49b3e1fc9d0
show more ...
|
b729096d | 07-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Refactor large lambda into function
Per Common error #14, large lambdas cause problems. Refactor.
Tested: Inspection Only.
Change-Id: If1e939c55745cfb8c6efb5ec5ba005772e327c63 Signed-off-by: Ed T
Refactor large lambda into function
Per Common error #14, large lambdas cause problems. Refactor.
Tested: Inspection Only.
Change-Id: If1e939c55745cfb8c6efb5ec5ba005772e327c63 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
4f467963 | 06-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Add case default
Clang-18 notes that this doesn't have a case default. Rearrange.
Tested: unit test pass.
Change-Id: I0e1c9e5aa576ef48466a1ff98d12a3e0cbab3978 Signed-off-by: Ed Tanous <etanous@nv
Add case default
Clang-18 notes that this doesn't have a case default. Rearrange.
Tested: unit test pass.
Change-Id: I0e1c9e5aa576ef48466a1ff98d12a3e0cbab3978 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
4e338b23 | 14-Jun-2024 |
Jagpal Singh Gill <paligill@gmail.com> |
update service: remove tftp simple update flow
Remove the flow for tftp simple update as this is an insecure method and there is no active user for this.
Redfish service validator passing: ``` Elap
update service: remove tftp simple update flow
Remove the flow for tftp simple update as this is an insecure method and there is no active user for this.
Redfish service validator passing: ``` Elapsed time: 0:04:33 metadataNamespaces: 3727 pass: 5184 passAction: 16 passGet: 213 passRedfishUri: 205 skipNoSchema: 3 skipOptional: 3535 unvalidated: 1 warnDeprecated: 5 warningPresent: 6 ```
Change-Id: I466dcb09be4ee806451abe91ab86d8b3b001a333 Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
show more ...
|
ab34422d | 07-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Fix tabbing on readJsonPatch
Tabbing is wrong. Fix it.
Tested: Whitespace only.
Change-Id: I4ac63a8bdef4e65ff3a4056bc0fe16e55281222d Signed-off-by: Ed Tanous <etanous@nvidia.com> |
599b9af3 | 06-Aug-2024 |
Alexander Hansen <alexander.hansen@9elements.com> |
refactor log_services.hpp, separate handlers
Handlers are separated from bmcweb route declarations.
The decoupling separates the http side of things and the logic for handling the request.
As an a
refactor log_services.hpp, separate handlers
Handlers are separated from bmcweb route declarations.
The decoupling separates the http side of things and the logic for handling the request.
As an additional bonus this reduces the indentation needed and improves readability.
Tested: moving code with no logic change does not require testing
Change-Id: Ice5f62dca26fb46b35c3b26843fa25d3c6666258 Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com> Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
99da8c8e | 29-Jul-2024 |
George Liu <liuxiwei@ieisystem.com> |
scripts: csdl-to-json-converter: README.md: Fix MD034 warnings
The following warnings are generated by using markdownlint analysis: ``` MD034/no-bare-urls Bare URL used [Context: "https://github.com
scripts: csdl-to-json-converter: README.md: Fix MD034 warnings
The following warnings are generated by using markdownlint analysis: ``` MD034/no-bare-urls Bare URL used [Context: "https://github.com/openbmc/doc...";] ``` Refer to markdown-lint [1] to fix MD034 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/034-no-bare-urls.md
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I85dea378a1f08293b2ef071c949fd184dcc7c015
show more ...
|
22a1b15a | 05-Aug-2024 |
Konstantin Aladyshev <aladyshev22@gmail.com> |
Remove "Function wasn't a string?" messages for PCIe
Currently for every PCIe function bmcweb checks every property of the "xyz.openbmc_project.Inventory.Item.PCIeDevice" interface if it is a string
Remove "Function wasn't a string?" messages for PCIe
Currently for every PCIe function bmcweb checks every property of the "xyz.openbmc_project.Inventory.Item.PCIeDevice" interface if it is a string. And if it is not the message "Function wasn't a string?" is produced. This is wrong since the properties "MaxLanes" and "LanesInUse" are not strings but integers. Drop the error print statement to remove the false error messages.
Change-Id: I1cc082e5aaf392b0cc4c051ab0bc6d8418aed0f9 Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
show more ...
|
ea5e2242 | 06-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Fix overflow
Static analysis correctly notes that in the case of empty string, this can overflow. Given that this is coming from a constexpr expression, that would be impossible in practice, but hav
Fix overflow
Static analysis correctly notes that in the case of empty string, this can overflow. Given that this is coming from a constexpr expression, that would be impossible in practice, but having static analysis pass is helpful.
Refactor the code to account for index overflows.
Tested: Code compiles
Change-Id: I00a1e0661182a6fb15acd6822faabcc0ff8191b7 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
11cc7333 | 07-Aug-2024 |
Andrew Geissler <geissonator@yahoo.com> |
chassis: fix power state regression
Commit 539d8c6 introduced a regression on the reported chassis power state (caught by romulus qemu CI).
Tested: - None, simple fix
Change-Id: Iac5b27ae7103fc071
chassis: fix power state regression
Commit 539d8c6 introduced a regression on the reported chassis power state (caught by romulus qemu CI).
Tested: - None, simple fix
Change-Id: Iac5b27ae7103fc0717547cb3e6f124a1c75d65a8 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
show more ...
|
b0a7b571 | 06-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove unused code
This line was added in 055713e4b201b049cd6a2d9ca58b89dbf916759f but clang-18 correctly notes that it is unused. Remove it.
Tested: Code compiles.
Change-Id: I4fc836e4de4c29a22b
Remove unused code
This line was added in 055713e4b201b049cd6a2d9ca58b89dbf916759f but clang-18 correctly notes that it is unused. Remove it.
Tested: Code compiles.
Change-Id: I4fc836e4de4c29a22b26fad048309efa297d3412 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
e43512ab | 06-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Remove inline operator
Clang-18 flags this as a redundant inline operator, which is correct. Remove it.
Tested: Code compiles.
Change-Id: I89d808f05cfc123b7884d1e0652cdd3912e2a674 Signed-off-by: E
Remove inline operator
Clang-18 flags this as a redundant inline operator, which is correct. Remove it.
Tested: Code compiles.
Change-Id: I89d808f05cfc123b7884d1e0652cdd3912e2a674 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
b0b6152c | 06-Aug-2024 |
Ed Tanous <etanous@nvidia.com> |
Add missing nullptr check
Static analysis flags two missing nullptr checks. Add them.
Tested: dbus-rest is a deprecated option, so unit testing is the only difference there. Log services notify wa
Add missing nullptr check
Static analysis flags two missing nullptr checks. Add them.
Tested: dbus-rest is a deprecated option, so unit testing is the only difference there. Log services notify was added recently. Need help testing, otherwise inspection only.
Change-Id: If92153ffa9c9fdf8903ce386f025ceebcf7510eb Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
d5c0172e | 16-Jun-2024 |
Ed Tanous <etanous@nvidia.com> |
Add back odata support
/redfish/v1/odata/index.json was inadvertently moved to be not installed in a529a6aa44e04ae5845d1324f3e8c887ebd47f7b
This file is basically unused, and even this author doesn
Add back odata support
/redfish/v1/odata/index.json was inadvertently moved to be not installed in a529a6aa44e04ae5845d1324f3e8c887ebd47f7b
This file is basically unused, and even this author doesn't understand what it's used for, but it is technically required in the spec, so add it back using a runtime derived handler.
Tested: Get /redfish/v1/odata returns the appropriate struct.
Change-Id: I548abbdd9f0b1eb28299165202626feede41e363 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
ced552a9 | 29-Jul-2024 |
George Liu <liuxiwei@ieisystem.com> |
scripts: csdl-to-json-converter: README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a la
scripts: csdl-to-json-converter: README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] ``` Refer to markdown-lint [1] to fix MD040 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/040-fenced-code-language.md
Signed-off-by: George Liu <liuxiwei@ieisystem.com> Change-Id: I183c4e220b7fdcec9c235a04dcdd9b4f065863e8
show more ...
|
471cd249 | 19-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Remove EventType
EventType::Event doesn't exist in the Event schema.
Initially, we thought to change it to EventType::Alert, but further inspection of the Redfish schemas shows that the property it
Remove EventType
EventType::Event doesn't exist in the Event schema.
Initially, we thought to change it to EventType::Alert, but further inspection of the Redfish schemas shows that the property itself is deprecated, so rather than try to make it "correct" it is better to just remove it.
This is technically a breaking API change, but given that very few schema-correct implementations of Redfish clients exist, even fewer EventService receivers exist, and this hasn't been reported before, I'd be extremely surprised if this broke any implementation.
Tested: Sending test events shows no EventType generated.
Change-Id: I933b2cc1dc2fb71714392949dd6eb030fbdcf8aa Signed-off-by: Ed Tanous <ed@tanous.net>
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 ...
|
6d0b80be | 28-Jul-2024 |
Ravi Teja <raviteja28031990@gmail.com> |
Fix RemoteRoleMap PATCH operation
RemoteRoleMap "LocalRole" property update fails since there was conversion missing from redfish privilege to D-bus values
Looks like this commit dropped this chang
Fix RemoteRoleMap PATCH operation
RemoteRoleMap "LocalRole" property update fails since there was conversion missing from redfish privilege to D-bus values
Looks like this commit dropped this change https://gerrit.openbmc.org/c/openbmc/bmcweb/+/64325/
This commit fixes this issue
Tested by: Verified patch operation on RemoteRoleMap
Change-Id: Ic05aa3457a45e98ea5dc8e9dd83e0f1a42772070 Signed-off-by: Ravi Teja <raviteja28031990@gmail.com>
show more ...
|
6bd30813 | 26-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Change retry policy for redfish aggregator
Redfish aggregator should be a forwarding proxy, and return errors to the user on failure. That max retry parameter was set to one, presumably to fulfill
Change retry policy for redfish aggregator
Redfish aggregator should be a forwarding proxy, and return errors to the user on failure. That max retry parameter was set to one, presumably to fulfill that purpose. A max "retry" of one means that the aggregator will attempt twice to get a response, which can interact poorly with long timeouts, and end up not returning an error to the calling user. Change the code to implement a single attempt.
Tested: Basic aggregation paths work over HTTP between two qemu instances; Top level collections show aggregated resources.
Change-Id: I48d6b1195f94bed09de0e05ad3469c30b3973019 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
fa2d6ae7 | 26-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Upgrade select alpn callback
nghttp2 has added a new callback[1] which solves the issue we were seeing previously with const. This cleans up some NOLINT markers, but should have no functional chang
Upgrade select alpn callback
nghttp2 has added a new callback[1] which solves the issue we were seeing previously with const. This cleans up some NOLINT markers, but should have no functional changes
[1] https://nghttp2.org/documentation/nghttp2_select_alpn.html#c.nghttp2_select_alpn
Tested:
Curl shows HTTP2 upgrade works properly.
* ALPN, offering h2 * ALPN, offering http/1.1 * ALPN, server accepted to use h2 * Using HTTP2, server supports multiplexing * Connection state changed (HTTP/2 confirmed)
Change-Id: Ic41754c58e6166aac22ed5afca5371661db959da Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
724985ff | 05-Jun-2024 |
Ed Tanous <ed@tanous.net> |
Break out SSL key handler into a compile unit
This commit allows for no code to have to pull in openssl headers directly. All openssl code is now included in compile units, or transitively from boo
Break out SSL key handler into a compile unit
This commit allows for no code to have to pull in openssl headers directly. All openssl code is now included in compile units, or transitively from boost.
Because http2 is optional, no-unneeded-internal-declaration is needed to prevent clang from marking the functions as unused. Chromium has disabled this as well[1]
Tested: Redfish service validator passes.
[1] https://issues.chromium.org/issues/40340369
Change-Id: I327e8ffa45941c2282db804d0be56cf64155e67d Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|