#
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 ...
|
#
3515fd14 |
| 12-Dec-2024 |
Ed Tanous <etanous@nvidia.com> |
Replace unique ptrs with concrete classes
Static analysis notes that these constructors should be using make_unique. While it's right, these don't need to be pointers at all.
Tested: No tests for
Replace unique ptrs with concrete classes
Static analysis notes that these constructors should be using make_unique. While it's right, these don't need to be pointers at all.
Tested: No tests for this code available.
Change-Id: Ia7383da573e8ffeed7542c94556f59b1e4022d16 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 ...
|
#
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 ...
|
#
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 ...
|
#
5ec22842 |
| 16-May-2024 |
Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com> |
Fix mounting in proxy mode in virtual media
Broken by [1], interface and path were incorrect after changing getManagedObjects to getAllProperties.
Tested: Mounting in proxy mode works
[1]: https:/
Fix mounting in proxy mode in virtual media
Broken by [1], interface and path were incorrect after changing getManagedObjects to getAllProperties.
Tested: Mounting in proxy mode works
[1]: https://github.com/openbmc/bmcweb/commit/e4b32753a7ce7ca436bf751f390ee01f02b9efd5
Change-Id: I06f36e8fc864fe13200d5d13a12639ebba9d9be1 Signed-off-by: Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com>
show more ...
|
#
43498813 |
| 15-May-2024 |
Ed Tanous <ed@tanous.net> |
Check size
Static analysis flags that we're ignoring a return value here. Use it.
Tested: Code compiles.
Change-Id: I2b37286b5a7b549b483ed5669fa0c24a628adc98 Signed-off-by: Ed Tanous <ed@tanous.n
Check size
Static analysis flags that we're ignoring a return value here. Use it.
Tested: Code compiles.
Change-Id: I2b37286b5a7b549b483ed5669fa0c24a628adc98 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
80ba22fa |
| 06-May-2024 |
Ed Tanous <ed@tanous.net> |
std::remove to std::filesystem::remove
Change-Id: Ie7729554e438f3af9ddb58941297525c50c6b419 Signed-off-by: Ed Tanous <ed@tanous.net>
|
#
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 ...
|
#
ccb05564 |
| 29-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix bad merge conflict
nbd proxy and vm websocket options got reversed in 36c0f2a35e670a4b798b7b42fd18455085e9d9c0
Change them back.
Change-Id: I7c54e66f88aee956bd20f2139d110e64998a4ef5 Signed-off
Fix bad merge conflict
nbd proxy and vm websocket options got reversed in 36c0f2a35e670a4b798b7b42fd18455085e9d9c0
Change them back.
Change-Id: I7c54e66f88aee956bd20f2139d110e64998a4ef5 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
e4b32753 |
| 09-Feb-2024 |
Ed Tanous <ed@tanous.net> |
Break out lambdas into real methods
Tested: Need help
Change-Id: I28cc1626212ec746b5345490ec285706eb386e65 Signed-off-by: Ed Tanous <ed@tanous.net>
|
#
36c0f2a3 |
| 09-Feb-2024 |
Ed Tanous <ed@tanous.net> |
Consolidate Vm implementations
As much as the two vm implementations SEEM different, the differences largely lie in how we're getting the nbd proxy socket. One is relying on launching a process (nb
Consolidate Vm implementations
As much as the two vm implementations SEEM different, the differences largely lie in how we're getting the nbd proxy socket. One is relying on launching a process (nbd-proxy), the other is getting the fd from dbus. Given [1] exists and is in process, we need to have a plan for getting these two VM implementations into one, once that patchset is complete.
This commit: Splits the vm-websocket option into vm-websocket-provider, providing two options, nbd-proxy, and virtual-media (the names of the respective apps). To accomplish this, it moves the contents of nbd-proxy into include/vm-websocket, so we can compare the similarities and start consolidating.
The longer term intent is that the nbd-proxy option will be completely removed, and the code deleted. This has the additional advantage that we will no longer require the boost::process dependency, as all info will be available on dbus.
As part of this, the nbd proxy websocket is also registered at /vm/0/0, to be backward compatible with the old interfaces.
Tested: Code compiles. Need some help here.
[1] https://gerrit.openbmc.org/c/openbmc/jsnbd/+/49944
Change-Id: Iedbca169ea40d45a8775f843792b874a248bb594 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
3bfa3b29 |
| 31-Jan-2024 |
Ed Tanous <ed@tanous.net> |
Move to process v2
Boost process v2 brings some significant benefits to our launching of processes[1]. In bmcweb terms: 1. The code is radically simpler, which decreaeses compile times, and redu
Move to process v2
Boost process v2 brings some significant benefits to our launching of processes[1]. In bmcweb terms: 1. The code is radically simpler, which decreaeses compile times, and reduces the scope for code scanning tools. 2. The code now uses standard asio pipes instead of inventing its own. 3. Separate compilation.
Tested: We don't have a lot of unit tests for the virtual media stuff that I can run, but we do have unit tests for credentials pipe, which in this change have been ported over, so the feature works. Unit tests are passing.
[1] https://www.boost.org/doc/libs/1_80_0/doc/html/boost_process/v2.html#boost_process.v2.introduction Change-Id: Ia20226819d75ff6e492f8852185f0b73e8f5cf83 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
#
44106f34 |
| 06-Apr-2024 |
Ed Tanous <ed@tanous.net> |
Fix buffer_copy
boost::asio::buffer_copy returns an integer of the number of values copied. Some static analysis tools mark that value as nodiscard, although it should never fail. Audit all uses o
Fix buffer_copy
boost::asio::buffer_copy returns an integer of the number of values copied. Some static analysis tools mark that value as nodiscard, although it should never fail. Audit all uses of buffer_copy, and make sure that they're using the return value. In theory this should have no change on the behavior.
Change-Id: I6af39b5347954c2932cf3d4e48e96ff9ae01583a Signed-off-by: Ed Tanous <ed@tanous.net>
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 ...
|
#
e1bf8bb6 |
| 07-Sep-2023 |
Troy Lee <troy_lee@aspeedtech.com> |
Fixes bmcweb crashed when mounting virtual media
After upgrading jsnbd to meson.build, the nbd-proxy path will change from /usr/sbin to /usr/bin. - https://gerrit.openbmc.org/c/openbmc/jsnbd/+/65434
Fixes bmcweb crashed when mounting virtual media
After upgrading jsnbd to meson.build, the nbd-proxy path will change from /usr/sbin to /usr/bin. - https://gerrit.openbmc.org/c/openbmc/jsnbd/+/65434 - https://gerrit.openbmc.org/c/openbmc/openbmc/+/65466
Error message: ``` bmcweb[220]: [DEBUG http_connection.hpp:561] 0x235bad0 Clearing response bmcweb[220]: [DEBUG http_response.hpp:181] 0x235dd90 Clearing response containers bmcweb[220]: [DEBUG http_connection.hpp:403] 0x235bad0 doReadHeaders bmcweb[220]: [DEBUG http_connection.hpp:71] 0x22c20c8 Connection open, total 8 bmcweb[220]: [DEBUG http_connection.hpp:625] 0x23dc940 timer started [FAILED] Failed to start Wait for Network to be Configured. See 'systemctl status systemd-networkd-wait-online.service' for details. [ OK ] Reached target Network is Online. Starting System Logging Service... [ OK ] Started System Logging Service. systemd-journald[160]: Received SIGTERM from PID 220 (bmcweb). systemd[1]: avahi-daemon.service: Deactivated successfully. systemd[1]: bmcweb.service: Main process exited, code=exited, status=255/EXCEPTION systemd[1]: bmcweb.service: Failed with result 'exit-code'. systemd[1]: bmcweb.service: Consumed 1.940s CPU time. systemd[1]: obmc-dump-monitor.service: Deactivated successfully. systemd[1]: phosphor-certificate-manager@authority.service: Deactivated successfully. ```
After this fix: ``` bmcweb[219]: [DEBUG http_connection.hpp:268] Setting completion handler bmcweb[219]: [DEBUG http_response.hpp:238] 0xfb23e0 setting completion handler bmcweb[219]: [DEBUG http_response.hpp:238] 0xfb23e0 setting completion handler bmcweb[219]: [DEBUG routing.hpp:601] Matched rule (upgrade) '/vm/0/0' 1 / 2 bmcweb[219]: [DEBUG dbus_privileges.hpp:51] userName = root userRole = priv-admin bmcweb[219]: [DEBUG websocketrule.hpp:50] Websocket handles upgrade bmcweb[219]: [DEBUG websocket.hpp:78] Creating new connection 0xe641ec bmcweb[219]: [DEBUG websocket.hpp:89] starting connection 0xe641ec bmcweb[219]: [DEBUG http_response.hpp:223] 0xfb23e0 calling completion handler bmcweb[219]: [DEBUG http_response.hpp:226] 0xfb23e0 completion handler was valid bmcweb[219]: [DEBUG http_response.hpp:238] 0x108b008 setting completion handler bmcweb[219]: [DEBUG http_connection.hpp:81] 0x1088d48 Connection closed, total 8 bmcweb[219]: [DEBUG websocket.hpp:226] Websocket accepted connection bmcweb[219]: [DEBUG vm_websocket.hpp:172] Connection 0xe641ec opened bmcweb[219]: [DEBUG vm_websocket.hpp:85] inputBuffer empty. Bailing out bmcweb[219]: [DEBUG vm_websocket.hpp:94] Wrote 18bytes bmcweb[219]: [DEBUG vm_websocket.hpp:85] inputBuffer empty. Bailing out bmcweb[219]: [DEBUG vm_websocket.hpp:125] Read done. Read 26 bytes ```
Change-Id: Ic5dc3d0c32517add158d5354b712c166bc6bf204 Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Signed-off-by: Vince Chang <vince.chang@vertiv.com>
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 ...
|
#
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 ...
|
#
81c4e330 |
| 18-May-2023 |
Ed Tanous <edtanous@google.com> |
Capture all boost::system::error_codes by ref
Capturing these possibly overloaded values by reference can avoid a copy in some cases, and it's good to be consistent.
This change was made automatica
Capture all boost::system::error_codes by ref
Capturing these possibly overloaded values by reference can avoid a copy in some cases, and it's good to be consistent.
This change was made automatically by grep/sed.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Iafeaca2a5dc52f39753b5a3880419d6bc943f81b
show more ...
|
#
36ecbf35 |
| 17-Aug-2021 |
Troy Lee <troy_lee@aspeedtech.com> |
Fixing blocking system call to async mode
Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Change-Id: Id81db4d512b5ea1222a145dc2b9e9907e8b0f084
|
#
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 ...
|
#
cf9e417d |
| 21-Dec-2022 |
Ed Tanous <edtanous@google.com> |
Add check for globals
We don't follow this cpp core guidelines rule well. This is something that we should aspire to cleaning up in the future, but for the moment, lets turn the rule on in clang-ti
Add check for globals
We don't follow this cpp core guidelines rule well. This is something that we should aspire to cleaning up in the future, but for the moment, lets turn the rule on in clang-tidy to stop the bleeding, add ignores for the things that we know need some better abstractions, and work on these over time.
Most of this commit is just adding NOLINTNEXTLINE exceptions for all of our globals. There was one case in the sensor code where clang correctly noted that those globals weren't actually const, which got missed because of the use of auto.
Tested: CI should be good enough for this. Passes clang-tidy.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ieda08fee69a3b209d4b3e9771809a6c41524f066
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 ...
|
#
4ee8f0b7 |
| 01-Aug-2021 |
Troy Lee <troy_lee@aspeedtech.com> |
bmcweb: fixes virtual media buffer overflow
The bmcweb is implementated as async i/o access, sometimes the input buffer still has unprocessed data, and the next websocket message comes in. The input
bmcweb: fixes virtual media buffer overflow
The bmcweb is implementated as async i/o access, sometimes the input buffer still has unprocessed data, and the next websocket message comes in. The input buffer originally reserved only 1 nbd request packet size, so it will cause buffer overflow exception. Extend the buffer size and correctly check the remaining buffer size.
v8: fix coding style v7: remove debug log and proxy.wait() change to keep this change simple v4: fix coding style v3: fix coding style v2: fix coding style
Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Change-Id: I8df2445503393f63401678d9f2486a80d31aee16
show more ...
|
#
7772638e |
| 21-Oct-2021 |
zhanghch05 <zhanghch05@inspur.com> |
Remove AsyncResp from openHandler
This change, moving the openHandler back to only supporting websocket disconnects and not 404s.Because AsyncResp is removed from openHandler.
Tested: (from previou
Remove AsyncResp from openHandler
This change, moving the openHandler back to only supporting websocket disconnects and not 404s.Because AsyncResp is removed from openHandler.
Tested: (from previous commit) Opened KVM in webui-vue and it works.
Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I793f05836aeccdc275b7aaaeede41b3a2c276595
show more ...
|