#
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 ...
|
#
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 ...
|
#
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 ...
|
#
3cd7072b |
| 06-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Move run and redfish to compile units
Meson supports unity builds[1] natively. There's no reason to continue with the pseudo unity build we've been using by putting implementations in header files.
Move run and redfish to compile units
Meson supports unity builds[1] natively. There's no reason to continue with the pseudo unity build we've been using by putting implementations in header files.
This commit is the first in a long series of starting to break this up into smaller compile units, in the hopes of dropping incremental compile times for developers, and reduce the total per-core memory usage that gcc requires.
This commit breaks out the run() function from main() and the constructor of RedfishService from redfish.hpp into their own compile units. According to tracing, even after broken out, these are still by far the two longest to compile units in the build.
Tested: Code compiles. Debug build on a 24 core build server results in a decrease in compile time for compiling just bmcweb from 1m38s to 1m22s.
[1] https://mesonbuild.com/Unity-builds.html
Change-Id: Ibf352e8aba61d64c9a41a7a76e94ab3b5a0dde4b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
f0b59af4 |
| 20-Mar-2024 |
Ed Tanous <ed@tanous.net> |
Add misc-include-cleaner
And fix the includes that are wrong.
Note, there is a very large ignore list included in the .clang-tidy configcfile. These are things that clang-tidy doesn't yet handle w
Add misc-include-cleaner
And fix the includes that are wrong.
Note, there is a very large ignore list included in the .clang-tidy configcfile. These are things that clang-tidy doesn't yet handle well, like knowing about a details include.
Change-Id: Ie3744f2c8cba68a8700b406449d6c2018a736952 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
59ba6388 |
| 01-Aug-2023 |
Gunnar Mills <gmills@us.ibm.com> |
Revert "Cache user role in session object"
This reverts commit 8ed41c35a314580bb794fa0fff2e01b0bf7efcf7.
In discord, it was posted 2 systems are hitting 403 Forbidden for all endpoints.
Reverting
Revert "Cache user role in session object"
This reverts commit 8ed41c35a314580bb794fa0fff2e01b0bf7efcf7.
In discord, it was posted 2 systems are hitting 403 Forbidden for all endpoints.
Reverting fixed the problem, until time is given to dive into this, just revert.
One of the things wrong is this is missing an After/Want xyz.openbmc_project.User.Manager.service.
Change-Id: I1766a6ec2dbc9fb52da3940b07ac002a1a6d269a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
show more ...
|
#
8ed41c35 |
| 09-May-2021 |
Ed Tanous <edtanous@google.com> |
Cache user role in session object
There is an async call within the router that leads to a small, but pervasive performance issue for all queries. Removing that call from the router has the potentia
Cache user role in session object
There is an async call within the router that leads to a small, but pervasive performance issue for all queries. Removing that call from the router has the potential to increase the performance of every authenticated query, and significantly reduce our dbus traffic for "simple" operations.
This commit re-implements the role cache in session object that existed previously many years ago. Each users role is fetched during authentication and persisted in session object. Each successive request can then be matched against the privilege which is there in the in-memory session object.
This was discussed on below commit https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/39756
Tested by: ``` POST /redfish/v1/SessionService/Sessions {"UserName":"root", "Password": “0penBmc”} ```
Followed by redfish queries
Get /redfish/v1/AccountService
Tested user role persistency
Redfish service validator passes.
Signed-off-by: Ravi Teja <raviteja28031990@gmail.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I575599c29358e32849446ce6ee7f62c8eb3885f6
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 ...
|
#
f8ca6d79 |
| 28-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Allow async resolver to be optional
This commit adds a meson option to allow selecting which dns resolver bmcweb uses. There are use cases, like Open Compute Project Inband Management Agent, that w
Allow async resolver to be optional
This commit adds a meson option to allow selecting which dns resolver bmcweb uses. There are use cases, like Open Compute Project Inband Management Agent, that would require not using dbus, which would require us to fall back to the asio resolver. This commit makes the existing asio resolver constructor, and async_resolve methods match the equivalents in asio (which we intended to do anyway), then adds a macro and configure option for being able to select which resolver backend to rely on.
Tested: Code can now compile without sdbusplus.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3220214367179f131a60082bdfaf7e725d35c125
show more ...
|
#
faf100f9 |
| 25-May-2023 |
Ed Tanous <edtanous@google.com> |
Fix some includes
System includes should be included with <>, in-tree includes should be included with "". This was found manually, with the help of the following grep statement[1].
git grep -o -h
Fix some includes
System includes should be included with <>, in-tree includes should be included with "". This was found manually, with the help of the following grep statement[1].
git grep -o -h "#include .*" | sort | uniq
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I1a6b2a5ba35ccbbb61c67b7c4b036a2d7b3a36a3
show more ...
|
#
662aa6e3 |
| 10-Jan-2023 |
Myung Bae <myungbae@us.ibm.com> |
Update Logging option for the setting log level
In order to be able to more easily debug bmcweb related issue, a new meson option is added to set a specific logging level Which generates the targete
Update Logging option for the setting log level
In order to be able to more easily debug bmcweb related issue, a new meson option is added to set a specific logging level Which generates the targeted logging traces rather than all of debug traces.
The current option -Dbmcweb-logging which can be either disabled or enabled is changed to allow to set the log level for the specific level traces (e.g. error or critical traces) to be written to the journal.
-Dbmcweb-logging=<log-level>
where <log-level> can be disabled, enabled, debug, info, warning, error, or critical.
- `disabled`: Turns off all bmcweb log traces. - `enabled` : treated as `debug` - Other option can be described in [Logging Levels](DEVELOPING.md).
For an example, to enable only 'error', 'critical' log entries, bmcweb can be built with
-Dbmcweb-logging=error
Testing: - Verified that only the specific logs (e.g. error and critical logs) were displayed by compiling bmcweb with the specific bmcweb-logging level.
Change-Id: I522ca26700ea420fee1a5cf688d3e8c6661f2f55 Signed-off-by: Myung Bae <myungbae@us.ibm.com>
show more ...
|
#
d14a48ff |
| 21-Feb-2023 |
Carson Labrado <clabrado@google.com> |
Aggregation: Increase response read limit to 50MB
With Redfish aggregation, responses from satellite BMCs can be on the order of MBs due to use cases like logging or binary payloads. Offloading $exp
Aggregation: Increase response read limit to 50MB
With Redfish aggregation, responses from satellite BMCs can be on the order of MBs due to use cases like logging or binary payloads. Offloading $expand could similar result in responses that exceed the current read limit of 128 KB.
Splits the connection pools used for aggregation and EventService so that the response read limit is 50MB for responses associated with aggregation. Pools used by EventService keep the current limit of 2^17 bytes or 128 KB. It also propogates a ConnectionPolicy object that gets instantiated within HttpClient, which allows per-client policies for retry/byte limits. This allows EventService and aggregation to have different policies.
Tested: With aggregation enabled I was able to return a response from a satellite BMC which was than 2MB. Ran the Redfish Mockup Creator and it was able to successfully query all aggregated resources as part of walking the tree. Also verified that HTTP push events still work with EventListener.
Change-Id: I91de6f82aadf8ad6f7bc3f58dfa0d14c0759dd47 Signed-off-by: Carson Labrado <clabrado@google.com> Signed-off-by: Ed Tanous <edtanous@google.com>
show more ...
|
#
9fa06f19 |
| 29-Jun-2022 |
Xie Ning <xiening.xll@bytedance.com> |
Remove sessions when user is deleted
An Internal server Error will happen if you delete the login user. Match the "InterfacesRemoved" signal for monitoring the user status and delete the session to
Remove sessions when user is deleted
An Internal server Error will happen if you delete the login user. Match the "InterfacesRemoved" signal for monitoring the user status and delete the session to fix this bug.
Tested: 1. Add a new user such as test 2. Login with the new user in web 3. Delete or rename the user by web and ipmi command 4. Refresh the web and a new user was needed to login in the web
Signed-off-by: Xie Ning <xiening.xll@bytedance.com> Change-Id: I2b53edb71d9a4e904c7da54393539f87eeb2d7a3
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 ...
|
#
45248ba3 |
| 14-Jul-2022 |
Josh Lehan <krellan@google.com> |
bmcweb: Show exception what() before exiting
Although exceptions should not happen in bmcweb, the underlying Crow code sometimes throws, and so do bugs caused by accidental usage of functions that t
bmcweb: Show exception what() before exiting
Although exceptions should not happen in bmcweb, the underlying Crow code sometimes throws, and so do bugs caused by accidental usage of functions that throw.
Adding e.what() output when std::exception is thrown.
Tested: Accidentally tested more often than I would care to admit....
Signed-off-by: Josh Lehan <krellan@google.com> Change-Id: Ifcd30dc53369708b21bf958c627755651422f18a
show more ...
|
#
6f2cd97a |
| 30-Jun-2022 |
Ed Tanous <edtanous@google.com> |
Move errant logging statement
Log statement was after the return, so therefore didn't do anything. cppcheck found.
Tested: No way to test without a bug that causes an uncaught exception. Code revie
Move errant logging statement
Log statement was after the return, so therefore didn't do anything. cppcheck found.
Tested: No way to test without a bug that causes an uncaught exception. Code review only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I5a4ae7d5ac83065040e3c4d9e390b5883fd0f1f9
show more ...
|
#
6384e323 |
| 23-Jun-2022 |
Nan Zhou <nanzhoumails@gmail.com> |
dbus_singleton: use stack variable and extern
Currently, the |systemBus| connection is a static variable declared in headers. This has a problem that every translation unit will keep its own copy. I
dbus_singleton: use stack variable and extern
Currently, the |systemBus| connection is a static variable declared in headers. This has a problem that every translation unit will keep its own copy. It's not a problem today because there's only one translation unit "webserver_main.cpp.o". This issue was brounght up in https://gerrit.openbmc.org/c/openbmc/bmcweb/+/54758
Actually, the |systemBus| doesn't need to be a singleton. It can just be a stack variable, which is normally more efficient than heap variables.
To keep minimum changes treeside, this commits keeps the existing |systemBus| variable as an external variable. It is defined in its own translation unit. It is initialized in the main translation unit.
Reference: 1. Extern https://stackoverflow.com/questions/1433204/how-do-i-use-extern-to-share-variables-between-source-files
Tested: 1. Romulus QEMU robot Redfish test passed; 2. Start and restart service on real hardware, no issues; 3. No new validator failures 4. Code compies
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: I03b387bd5f218a86c9d1765415a46e3c2ad83ff9
show more ...
|
#
e3009e46 |
| 16-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Make nbd-proxy header build in all cases
We very intentionally don't do this "only include header if option is enabled" thing to make sure that compile issues are seen across all builds.
Tested: Co
Make nbd-proxy header build in all cases
We very intentionally don't do this "only include header if option is enabled" thing to make sure that compile issues are seen across all builds.
Tested: Code compiles. Header changes only.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I749aed62ed6cd73690f3d89d75df65bec77562c2
show more ...
|
#
f65fca6a |
| 24-May-2022 |
Ed Tanous <edtanous@google.com> |
Move redfish/v1 instantiation
Make /redfish/v1 get instantiated in the same place as the other redfish routes, and not in main().
Tested: curl -vvvv --insecure --user root:0penBmc https://192.168.7
Move redfish/v1 instantiation
Make /redfish/v1 get instantiated in the same place as the other redfish routes, and not in main().
Tested: curl -vvvv --insecure --user root:0penBmc https://192.168.7.2/redfish
returns the same value as previously.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Icb93954c00a4cf41708f1b323ddbd83e61146e5d
show more ...
|
#
7fb33566 |
| 18-Apr-2022 |
Carson Labrado <clabrado@google.com> |
bmcweb: Fetch Satellite Config from D-Bus
Adds a RedfishAggregator class which is able to pull configuration information from D-Bus for Satellite BMCs. These BMCs will be aggregated by Redfish Aggr
bmcweb: Fetch Satellite Config from D-Bus
Adds a RedfishAggregator class which is able to pull configuration information from D-Bus for Satellite BMCs. These BMCs will be aggregated by Redfish Aggregation. Also added is a new compiler option which will be used to enable Redfish Aggregation.
This patch only allows configurations with unencrypted and unauthenticated satellite BMC communication. Support for encryption and authentication willneed to be added in future patches.
Note that this patch does not actually use the config information after it has been fetched. That functionality will be added in future patches.
Tested: I made this example config information available on D-Bus busctl introspect xyz.openbmc_project.EntityManager \ /xyz/openbmc_project/inventory/system/board/SatelliteBMC/aggregated0 \ xyz.openbmc_project.Configuration.SatelliteController NAME TYPE SIGNATURE RESULT/VALUE FLAGS .AuthType property s "None" emits-change .Hostname property s "127.0.0.1" emits-change .Name property s "aggregated0" emits-change .Port property t 443 emits-change .Type property s "SatelliteController" emits-change
That information was picked up by the changes in this CL: [DEBUG "redfish_aggregator.hpp":80] Found Satellite Controller at /xyz/openbmc_project/inventory/system/board/SatelliteBMC/aggregated0 [DEBUG "redfish_aggregator.hpp":209] Added satellite config aggregated0 at http://127.0.0.1:443 [DEBUG "redfish_aggregator.hpp":52] Redfish Aggregation enabled with 1 satellite BMCs [DEBUG "redfish_aggregator.hpp":21] There were 1 satellite configs found at startup
Signed-off-by: Carson Labrado <clabrado@google.com> Change-Id: Ib5eee2c93aeb209157191055975c127759d73627
show more ...
|
#
2119e270 |
| 17-Feb-2022 |
Ed Tanous <edtanous@google.com> |
Make run() static
clang correctly notes that this should be static, as it's not used outside the compile unit.
Tested: code compiles with clang.
Signed-off-by: Ed Tanous <edtanous@google.com> Chan
Make run() static
clang correctly notes that this should be static, as it's not used outside the compile unit.
Tested: code compiles with clang.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I7c540fe74b9fce1f3e498fb75089a143c7af4581
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 ...
|
#
24b2fe81 |
| 06-Jan-2022 |
Ed Tanous <edtanous@google.com> |
enable bugprone exception escape check
clang-13 includes new checks, and finds some issues. The first is that the boost::vector constructor can possibly throw, so replace the underlying flat_map co
enable bugprone exception escape check
clang-13 includes new checks, and finds some issues. The first is that the boost::vector constructor can possibly throw, so replace the underlying flat_map container with std::vector instead.
The others are places where we could possibly throw in destructors, which would be bad. Ideally we wouldn't use the destructor pattern, but that would be non-trivial to clean up at this point, so just catch the exception, and log it. At the same time, catch exceptions thrown to main and log them.
Tested: Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I77b86eaa2fc79e43d1ca044c78ca3b0ce0a7c38c
show more ...
|
#
735ef6d8 |
| 19-Mar-2021 |
Feras Aldahlawi <faldahlawi@gmail.com> |
Add google service root
This commit introduces the following => Service root for Google => compiler option for the Google Root of Trust specific functionalities
Tested: curl -vvvv --insecure --user
Add google service root
This commit introduces the following => Service root for Google => compiler option for the Google Root of Trust specific functionalities
Tested: curl -vvvv --insecure --user $user_pass https://${bmc}/google/v1
Desing Doc can be found here https://github.com/openbmc/docs/blob/master/designs/oem/google/root_of_trust.md
Change-Id: I941b5cab55179279d0eff18aa29df62c3f226e47 Signed-off-by: Feras Aldahlawi <faldahlawi@gmail.com>
show more ...
|
#
85bf8908 |
| 12-Jul-2021 |
P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> |
Fix Klocwork Issues - Return from int main()
Add return 0 for int main()
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Change-Id: Ifa3216ae1b4cd0eb422679149ace6a1b59dbf85e
|