| #
8d2f868c
|
| 03-Sep-2024 |
Ed Tanous <etanous@nvidia.com> |
Break out post codes
Similar to other patches, break out the post codes log services into their own file. log_services.hpp is far too large.
Change-Id: I3cb644d52a9d3b5f9a15a2f90c1b69c87491e5c8 Si
Break out post codes
Similar to other patches, break out the post codes log services into their own file. log_services.hpp is far too large.
Change-Id: I3cb644d52a9d3b5f9a15a2f90c1b69c87491e5c8 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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
055713e4
|
| 17-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Make journal log efficient
Journal logging currently loops over all entries to find even a single entry. This was reasonable at the time when bmc couldn't really store a lot, but now that BMCs are
Make journal log efficient
Journal logging currently loops over all entries to find even a single entry. This was reasonable at the time when bmc couldn't really store a lot, but now that BMCs are getting significantly more flash storage, this simplification is insufficient. In an example system with an AST2600, this API takes 32 seconds to respond. This is mediocre for obvious reasons.
This commit updates to use the sd_journal APIs to let journald do the skipping, which can use internal details and can be a lot more efficient. To get the total size, bmcweb still needs to pull the sequenceids of HEAD and TAIL to determine the complete size, but this is still reasonable.
Tested: Redfish service validator passes.
Various versions of top and skip return the correct result, pulling various top sizes from 0, omitted to the limit.
https://gerrit.openbmc.org/c/openbmc/openbmc-tools/+/72975
To test all corner cases.
Change-Id: I0456bca4e037529f70eaee0bdd9191e9d5839226 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
| #
b0983db2
|
| 17-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Break out Journal log into its own file
log_services.hpp probably shouldn't have been allowed to get as large as it has. This commit starts by breaking out functions from log_services.hpp, and move
Break out Journal log into its own file
log_services.hpp probably shouldn't have been allowed to get as large as it has. This commit starts by breaking out functions from log_services.hpp, and moves them to manager_logservices_journal.hpp. Code is moved as-is with no functional changes.
Tested: Journal GET works as before. Redfish service validator passes.
Change-Id: I93c372ae3e39967e1b0eaf0cf496f84ac4114b5c Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
9f565090
|
| 13-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Fix typo regression
This is an obvious typo introduced in 253f11b84347de6bff7c6b624bef270fefae5f5a
It's under a less used option, which is why it doesn't show up in tests, but is obviously wrong.
Fix typo regression
This is an obvious typo introduced in 253f11b84347de6bff7c6b624bef270fefae5f5a
It's under a less used option, which is why it doesn't show up in tests, but is obviously wrong. Fix it.
Tested: Inspection only.
Change-Id: Ic90f680890c32c0a2b698de61cc5caa99799e40b 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 ...
|
| #
20fa6a2c
|
| 20-May-2024 |
Ed Tanous <ed@tanous.net> |
Remove the last instances of json pattern
In the past, we've tried to erradicate the use of nlohmann::json(initiatlizer_list<...>) because it bloats binary sizes, as every type is given a new nlohma
Remove the last instances of json pattern
In the past, we've tried to erradicate the use of nlohmann::json(initiatlizer_list<...>) because it bloats binary sizes, as every type is given a new nlohmann constructor.
This commit hunts down the last few places where we call this. There is still 2 remaining in openbmc_dbus_rest after this, but those are variant accesses that are difficult to triage, and considering it's a less used api, they're left as is.
Tested: WIP
Change-Id: Iaac24584bb78bb238da69010b511c1d598bd38bc Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
253f11b8
|
| 16-May-2024 |
Ed Tanous <ed@tanous.net> |
Allow configuring "bmc" and "system"
In the early days of bmcweb, we made two pretty critical assumptions; First, is that a given platform would only have a single BMC instance (represented as "bmc"
Allow configuring "bmc" and "system"
In the early days of bmcweb, we made two pretty critical assumptions; First, is that a given platform would only have a single BMC instance (represented as "bmc") and a single host instance (represented as "system"). Second we assumed that, given that Redfish suggests against hardcoding URIs in client implementation and leaves them freeform, clients would code to the standard.
Our own webui-vue hardcodes Redfish URIs [1], and the documentation is littered with examples of hardcoded curl examples of hardcoding these URIs. That bug was filed in 2020, and the issue has only gotten worse over time.
This patchset is an attempt to give a target that we can start solving these issues, without trying to boil the ocean and fix all clients in parallel.
This commit adds the meson options redfish-manager-uri-name and redfish-system-uri-name
These are used to control the "name" that bmcweb places in the fixed locations in the ManagerCollection and ComputerSystemCollection schemas.
Note, managers is added, but is not currently testable. It will be iterated on over time.
Tested: Changed the URL options to "edsbmc" and "edssystem" in meson options.
Redfish service validator passes. URLs appear changed when walking the tree.
[1] https://github.com/openbmc/webui-vue/issues/43
Change-Id: I4b44685067051512bd065da8c2e3db68ae5ce23a Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
5ffd11f2
|
| 02-May-2024 |
Gunnar Mills <gmills@us.ibm.com> |
Fix regression in CrashDump
25b54db introduced a bug where CrashDump was not looking at the correct option. Was using BMCWEB_REDFISH_DUMP_LOG instead of the correct BMCWEB_REDFISH_CPU_LOG.
This was
Fix regression in CrashDump
25b54db introduced a bug where CrashDump was not looking at the correct option. Was using BMCWEB_REDFISH_DUMP_LOG instead of the correct BMCWEB_REDFISH_CPU_LOG.
This was caught in CI by a system that doesn't have CrashDump enabled but was hitting: 1 failGet errors in /redfish/v1/Systems/system/LogServices/Crashdump
Tested: None. Visually inspected and this matches redfish-core/src/redfish.cpp.
Change-Id: Ia6e72e5bbeaaa246fbbc5bcb2a525062e63d7d29 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
| #
25b54dba
|
| 17-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Bring consistency to config options
The configuration options that exist in bmcweb are an amalgimation of CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms and meson options usi
Bring consistency to config options
The configuration options that exist in bmcweb are an amalgimation of CROW options, CMAKE options using #define, pre-bmcweb ifdef mechanisms and meson options using a config file. This history has led to a lot of different ways to configure code in the codebase itself, which has led to problems, and issues in consistency.
ifdef options do no compile time checking of code not within the branch. This is good when you have optional dependencies, but not great when you're trying to ensure both options compile.
This commit moves all internal configuration options to: 1. A namespace called bmcweb 2. A naming scheme matching the meson option. hyphens are replaced with underscores, and the option is uppercased. This consistent transform allows matching up option keys with their code counterparts, without naming changes. 3. All options are bool true = enabled, and any options with _ENABLED or _DISABLED postfixes have those postfixes removed. (note, there are still some options with disable in the name, those are left as-is) 4. All options are now constexpr booleans, without an explicit compare.
To accomplish this, unfortunately an option list in config/meson.build is required, given that meson doesn't provide a way to dump all options, as is a manual entry in bmcweb_config.h.in, in addition to the meson_options. This obsoletes the map in the main meson.build, which helps some of the complexity.
Now that we've done this, we have some rules that will be documented. 1. Runtime behavior changes should be added as a constexpr bool to bmcweb_config.h 2. Options that require optionally pulling in a dependency shall use an ifdef, defined in the primary meson.build. (note, there are no options that currently meet this class, but it's included for completeness.)
Note, that this consolidation means that at configure time, all options are printed. This is a good thing and allows direct comparison of configs in log files.
Tested: Code compiles Server boots, and shows options configured in the default build. (HTTPS, log level, etc)
Change-Id: I94e79a56bcdc01755036e4e7278c7e69e25809ce Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
5b90429a
|
| 16-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit:
When that's done, these missing headers become compile errors. We should just fix the
Add missing headers
Most of these were found by breaking every redfish class handler into its own compile unit:
When that's done, these missing headers become compile errors. We should just fix them.
In addition, this allows us to enable automatic header checking in clang-tidy using misc-header-cleaner. Because the compiler can now "see" all the defines, it no longer tries to remove headers that it thinks are unused.
[1] https://github.com/openbmc/bmcweb/commit/4fdee9e39e9f03122ee16a6fb251a380681f56ac
Tested: Code compiles.
Change-Id: Ifa27ac4a512362b7ded7cc3068648dc4aea6ad7b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
6f056f24
|
| 07-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix post code parsing
If we use string_view with std::from_chars, we can use begin() and end() directly (because they return pointers) and not have to do silly things like dereference end(), which,
Fix post code parsing
If we use string_view with std::from_chars, we can use begin() and end() directly (because they return pointers) and not have to do silly things like dereference end(), which, while works in practice, is technically undefined behavior, and some static analyzers complain about it.
Tested: Unit tests pass against both old parsePostCode and new.
Change-Id: Icfdec3b81f4a9c9bed3599571a8bc8779f9bfb98 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
dc8cfa66
|
| 07-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Add nullptr check
Change-Id: If511f1210cca7bd1da3a8c5152688487d3036e2f Signed-off-by: Ed Tanous <ed@tanous.net>
|
| #
8cb2c024
|
| 27-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Fix moves/forward
Clang has new checks for std::move/std::forward correctness, which catches quite a few "wrong" things where we were making copies of callback handlers.
Unfortunately, the lambda s
Fix moves/forward
Clang has new checks for std::move/std::forward correctness, which catches quite a few "wrong" things where we were making copies of callback handlers.
Unfortunately, the lambda syntax of
callback{std::forward<Callback>(callback)}
in a capture confuses it, so change usages to callback = std::forward<Callback>(callback)
to be consistent.
Tested: Redfish service validator passes.
Change-Id: I7a111ec00cf78ecb7d5f5b102c786c1c14d74384 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
df254f2c
|
| 01-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Remove redundant static modifier
"inline static void func()"
Doesn't make sense when put in a header file. Find all instances, and make them inline like we do everywhere else.
Tested: Code compil
Remove redundant static modifier
"inline static void func()"
Doesn't make sense when put in a header file. Find all instances, and make them inline like we do everywhere else.
Tested: Code compiles.
Change-Id: I7da5821b1e372941680f82939627af39fdc2a4eb Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
099984c1
|
| 01-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix undefined behavior in getUniqueEntryID
Changing static bool getUniqueEntryID to inline bool getUniqueEntryID
Exposes the fact that there's some undefined behavior here, and unit tests start fa
Fix undefined behavior in getUniqueEntryID
Changing static bool getUniqueEntryID to inline bool getUniqueEntryID
Exposes the fact that there's some undefined behavior here, and unit tests start failing, likely due to stack being reused where it previously wasn't.
This commit cleans up the code to simplify it, and remove the problem.
Tested: Unit tests pass. Good coverage.
Change-Id: I5b9b8e8bb83c656560193e680d246c8513ed6c02 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
3eb66652
|
| 02-Apr-2024 |
Asmitha Karunanithi <asmitk01@in.ibm.com> |
log_services: Move to setProperty dbus util method
This commit changes sdbusplus setProperty calls in log_services.hpp file to "setDbusProperty" method in Redfish namespace that handles all DBus err
log_services: Move to setProperty dbus util method
This commit changes sdbusplus setProperty calls in log_services.hpp file to "setDbusProperty" method in Redfish namespace that handles all DBus errors in a consistent manner.
Change-Id: Icd9b0f0326c75a1421756d515408b303bdd738e3 Signed-off-by: Asmitha Karunanithi <asmitk01@in.ibm.com>
show more ...
|
| #
ddf3564e
|
| 27-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Enable readability check
readability-avoid-nested-conditional-operator
With one exception, we already pass this check. Update the log services code to make it pass, and update it to use the genera
Enable readability check
readability-avoid-nested-conditional-operator
With one exception, we already pass this check. Update the log services code to make it pass, and update it to use the generated enums.
Tested: Code inspection only.
Change-Id: Ic80a7382beb0f541de4916d7b51e42ed5d5dc542 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
| #
b5f288d2
|
| 08-Nov-2023 |
Abhilash Raju <abhilash.kollam@gmail.com> |
Make use of filebody for dump offload
Logservice has been rewritten to use file_body to offload dump files from BMC.
There are two kind of dump files, BMC dump and System dump.While BMC dump just r
Make use of filebody for dump offload
Logservice has been rewritten to use file_body to offload dump files from BMC.
There are two kind of dump files, BMC dump and System dump.While BMC dump just requires default support from beast::file_body, System dump requires base64 encoding support from beast. But beast::file_body do not have ready-made support for base64 encoding. So a custom file_body has been written for the base64 encoding.
The openFile apis in crow::Response do not have support for unix file descriptor. Since dump files are accesses via descriptors, added new openFile api that accepts descriptors.
Tested: Functionality test have been executed to verify the bmc dump offload. Did sanity test by invoking bmcweb pages via browser.
Change-Id: I24192657c03d8b2f0394d31e7424c6796ba3227a Signed-off-by: Abhilash Raju <abhilash.kollam@gmail.com>
show more ...
|
| #
18f8f608
|
| 18-Jul-2023 |
Ed Tanous <edtanous@google.com> |
Remove some boost includes
The less we rely on boost, and more on std algorithms, the less people have to look up, and the more likely that our code will deduplicate.
Replace all uses of boost::alg
Remove some boost includes
The less we rely on boost, and more on std algorithms, the less people have to look up, and the more likely that our code will deduplicate.
Replace all uses of boost::algorithms with std alternatives.
Tested: Redfish Service Validator passes.
Change-Id: I8a26f39b5709adc444b4178e92f5f3c7b988b05b Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|