summaryrefslogtreecommitdiff
path: root/include/vm_websocket.hpp
AgeCommit message (Collapse)AuthorFilesLines
2024-05-17Fix mounting in proxy mode in virtual mediaBoleslaw Ogonczyk Makowski1-4/+12
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>
2024-05-15Check sizeEd Tanous1-3/+4
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>
2024-05-09std::remove to std::filesystem::removeEd Tanous1-1/+3
Change-Id: Ie7729554e438f3af9ddb58941297525c50c6b419 Signed-off-by: Ed Tanous <ed@tanous.net>
2024-05-01Bring consistency to config optionsEd Tanous1-3/+3
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>
2024-04-30Fix bad merge conflictEd Tanous1-11/+2
nbd proxy and vm websocket options got reversed in 36c0f2a35e670a4b798b7b42fd18455085e9d9c0 Change them back. Change-Id: I7c54e66f88aee956bd20f2139d110e64998a4ef5 Signed-off-by: Ed Tanous <ed@tanous.net>
2024-04-30Break out lambdas into real methodsEd Tanous1-156/+144
Tested: Need help Change-Id: I28cc1626212ec746b5345490ec285706eb386e65 Signed-off-by: Ed Tanous <ed@tanous.net>
2024-04-30Consolidate Vm implementationsEd Tanous1-39/+434
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>
2024-04-27Move to process v2Ed Tanous1-12/+12
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>
2024-04-11Fix buffer_copyEd Tanous1-3/+4
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>
2023-10-24clang-format: copy latest and re-formatPatrick Williams1-43/+43
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>
2023-09-08Fixes bmcweb crashed when mounting virtual mediaTroy Lee1-1/+1
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>
2023-07-20Replace logging with std::formatEd Tanous1-12/+11
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
2023-05-25Fix some includesEd Tanous1-1/+1
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
2023-05-19Capture all boost::system::error_codes by refEd Tanous1-1/+1
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
2023-02-28Fixing blocking system call to async modeTroy Lee1-0/+2
Signed-off-by: Troy Lee <troy_lee@aspeedtech.com> Change-Id: Id81db4d512b5ea1222a145dc2b9e9907e8b0f084
2023-01-18Fix a boatload of #includesEd Tanous1-1/+2
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
2023-01-17Add check for globalsEd Tanous1-0/+2
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
2022-06-01Try to fix the lambda formatting issueEd Tanous1-39/+38
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
2022-05-24bmcweb: fixes virtual media buffer overflowTroy Lee1-2/+3
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
2022-03-29Remove AsyncResp from openHandlerzhanghch051-2/+1
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
2022-02-17Prepare for clang-tidy-14Ed Tanous1-2/+2
clang-tidy 14 now detects some more stuff that it couldn't before. These are all pretty reasonable and things that we enforce today. All changes were made by the robot. Tested: Code compiles and unit tests pass. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I880d714c97adc38a190472766fb922fbfb30e82a
2022-02-15Enable readability-implicit-bool-conversion checksEd Tanous1-1/+1
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
2022-01-12Enable cppcoreguidelines-special-member-functions checksEd Tanous1-0/+5
Part of enforcing cpp core guidelines involves explicitly including all constructors required on a non-trivial class. We were missing quite a few. In all cases, the copy/move/and operator= methods are simply deleted. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie8d6e8bf2bc311fa21a9ae48b0d61ee5c1940999
2021-11-16Revert "Remove AsyncResp from openHandler"Gunnar Mills1-1/+2
This reverts commit 0f3d3a01aed4040ef73a977a958ecdf4f68111f6. Seeing bumps fail. Change-Id: Ida7b1bae48abbed2e00a5259e8f94b64168d4788 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2021-11-16Remove AsyncResp from openHandlerzhanghch051-2/+1
This change, moving the openHandler back to only supporting websocket disconnects and not 404s.Because AsyncResp is removed from openHandler. Tested: Opened KVM in webui-vue and it works. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I90811f4ab91ad41cb298877f76252dce80932b2b
2021-10-18Use less specific includesEd Tanous1-1/+3
Some of the vm includes pull in large portions of boost::process. Use more specific headers as the coding standard recomments. Tested: Code compiles. No functional changes. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I3e90d516c48fe01a29bfdfed272f5e4cc28e5493
2021-06-16Remove ambiguous privileges constructorEd Tanous1-1/+1
There are a number of endpoints that assume that a given routes privileges are governed by a single set of privileges, instead of multiple sets ORed together. To handle this, there were two overloads of the privileges() method, one that took a vector of Privileges, and one that took an initializer_list of const char*. Unfortunately, this leads some code in AccountService to pick the wrong overload when it's called like this .privileges( {{"ConfigureUsers"}, {"ConfigureManager"}, {"ConfigureSelf"}}) This is supposed to be "User must have ConfigureUsers, or ConfigureManager, or ConfigureSelf". Currently, because it selects the wrong overload, it computes to "User must have ConfigureUsers AND ConfigureManager AND ConfigureSelf. The double braces are supposed to cause this to form a vector of Privileges, but it appears that the initializer list gets consumed, and the single invocation of initializer list is called. Interestingly, trying to put in a privileges overload of intializer_list<initializer_list<const char*>> causes the compilation to fail with an ambiguous call error, which is what I would've expected to see previously in this case, but alas, I'm only a novice when it comes to how the C++ standard works in these edge cases. This is likely due in part to the fact that they were templates of an unused template param (seemingly copied from the previous method) and SFINAE rules around templates. This commit functionally removes one of the privileges overloads, and adds a second set of braces to every privileges call that previously had a single set of braces. Previous code will not compile now, which is IMO a good thing. This likely popped up in the Node class removal, because the Node class explicitly constructs a vector of Privilege objects, ensuing it can hit the right overload Tested: Ran Redfish service validator Tested the specific use case outlined on discord with: Creating a new user with operator privilege: ``` redfishtool -S Always -u root -p 0penBmc -vvvvvvvvv -r 192.168.7.2 AccountService adduser foo mysuperPass1 Operator ``` Then attempting to list accounts: ``` curl -vvvv --insecure --user foo:mysuperPass1 https://192.168.7.2/redfish/v1/AccountService/Accounts/foo ``` Which succeeded and returned the account in question. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I83e62b70e97f56dc57d43b9081f333a02fe85495
2020-10-23fix include namesEd Tanous1-3/+2
cppcheck isn't smart enough to recognize these are c++ headers, not c headers. Considering we're already inconsistent about our naming, it's easier to just be consistent, and move the last few files to use .hpp instead of .h. Tested: Code builds, no changes. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: Ic348d695f8527fa4a0ded53f433e1558c319db40
2020-10-15Lots of performance improvementsEd Tanous1-1/+1
(In the voice of the kid from sixth sense) I see string copies... Apparently there are a lot of places we make unnecessary copies. This fixes all of them. Not sure how to split this up into smaller patches, or if it even needs split up. It seems pretty easy to review to me, because basically every diff is identical. Change-Id: I22b4ae4f96f7e4082d2bc701098a04f7bed95369 Signed-off-by: Ed Tanous <ed@tanous.net> Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
2020-09-29Fix naming conventionsEd Tanous1-1/+1
Lots of code has been checked in that doesn't match the naming conventions. Lets fix that. Tested: Code compiles. Variable/function renames only. Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: I6bd107811d0b724f1fad990016113cdf035b604b
2020-08-17Enable unused variable warnings and resolveEd Tanous1-10/+15
This commit enables the "unused variables" warning in clang. Throughout this, it did point out several issues that would've been functional bugs, so I think it was worthwhile. It also cleaned up several unused variable from old constructs that no longer exist. Tested: Built with clang. Code no longer emits warnings. Downloaded bmcweb to system and pulled up the webui, observed webui loads and logs in properly. Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8 Signed-off-by: Ed Tanous <ed@tanous.net>
2020-08-17Enable clang warningsEd Tanous1-2/+2
This commit enables clang warnings, and fixes all warnings that were found. Most of these fall into a couple categories: Variable shadow issues were fixed by renaming variables unused parameter warnings were resolved by either checking error codes that had been ignored, or removing the name of the variable from the scope. Other various warnings were fixed in the best way I was able to come up with. Note, the redfish Node class is especially insidious, as it causes all imlementers to have variables for parameters, regardless of whether or not they are used. Deprecating the Node class is on my list of things to do, as it adds extra overhead, and in general isn't a useful abstraction. For now, I have simply fixed all the handlers. Tested: Added the current meta-clang meta layer into bblayers.conf, and added TOOLCHAIN_pn-bmcweb = "clang" to my local.conf Signed-off-by: Ed Tanous <ed@tanous.net> Change-Id: Ia75b94010359170159c703e535d1c1af182fe700
2020-08-17Remove middlewaresEd Tanous1-3/+1
Middlewares, while kinda cool from an academic standpoint, make our build times even worse than they already are. Given that we only really use 1 real middleware today (token auth) and it needs to move into the parser mode anyway (for security limiting buffer sizes), we might as well use this as an opportunity to delete some code. Some other things that happen: 1. Persistent data now moves out of the crow namespace 2. App is no longer a template 3. All request_routes implementations no longer become templates. This should be a decent (unmeasured) win on compile times. This commit was part of a commit previously called "various cleanups". This separates ONLY the middleware deletion part of that. Note, this also deletes about 400 lines of hard to understand code. Change-Id: I4c19e25491a153a2aa2e4ef46fc797bcb5b3581a Signed-off-by: Ed Tanous <ed@tanous.net>
2020-06-19Drop the boost 1.7 related dependencyManojkiran Eda1-5/+0
- There are few pieces in the code, that depends on boost 1.71 & 1.70 library. - Now, that bmcweb is moving towards 1.73, we can safely remove those dependencies. Tested By: - Compiled in all sdks & unittests passed. Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com> Change-Id: I9ac6a002bf389afcad0ddb92f2e0205043ddb347
2020-06-11clang-format: update to latest from docs repoGunnar Mills1-4/+5
This is from openbmc/docs/style/cpp/.clang-format Other OpenBMC repos are doing the same. Tested: Built and validator passed. Change-Id: Ief26c755c9ce012823e16a506342b0547a53517a Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
2019-11-21Implement nbd-proxy as a part of bmcwebIwona Klimaszewska1-1/+2
Nbd-proxy is responsible for exposing websocket endpoint in bmcweb. It matches WS endpoints with unix socket paths using configuration exposed on D-Bus by Virtual-Media. Virtual-Media is then notified about unix socket availability through mount/unmount D-Bus methods. Currently, this feature is disabled by default. Tested: Integrated with initial version of Virtual-Media. Change-Id: I9c572e9841b16785727e5676fea1bb63b0311c63 Signed-off-by: Iwona Klimaszewska <iwona.klimaszewska@intel.com> Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
2019-11-11Move default destructors to = default syntaxEd Tanous1-3/+1
Modern c++ prefers setting default destructors to =default Tested: clang-tidy modernize-use-equals-default now passes Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I9ca746473263abfe2330b7c3e2fe645cf96112f3 Signed-off-by: James Feist <james.feist@linux.intel.com>
2019-10-28Move to more modern headersEd Tanous1-1/+1
We had a couple places where the c style headers got checked in for Tested: Code builds. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iebfbd846033618ff972825a0a9f89e8d05395ce8
2019-10-21Add "requires" handlers to all non-trivial routesEd Tanous1-0/+1
This commit is the result of an audit to add user levels to the various components that need them. As written: KVM requires admin privilege Virtual media requires admin privilege image upload requires admin privilege /subscribe API requies Login privilege Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I6384f23769a5ac23f653519656721da7373f088f
2019-10-18Make references to crow less obviousEd Tanous1-2/+2
Recently, a number of people in the community have made the (admittedly easy) mistake that we use a significant portion of crow. Today, we use crow for the router, and the "app" structure, and even those have been significantly modified to meet the bmc needs. All other components have been replaced with Boost beast. This commit removes the crow mentions from the Readme, and moves the crow folder to "http" to camouflage it a little. No code content has changed. Tested: Code compiles. No functional change made to any executable code. Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: Iceb57b26306cc8bdcfc77f3874246338864fd118
2019-10-11Fix a bunch of warningsEd Tanous1-2/+2
using the list of warnings from here: https://github.com/lefticus/cppbestpractices/blob/e73393f25a85f83fed7399d8b65cb117d00b2231/02-Use_the_Tools_Available.md#L100 Seems like a good place to start, and would improve things a bit type-wise. This patchset attempts to correct all the issues in one shot. Tested: It builds. Will test various subsystems that have been touched Signed-off-by: Ed Tanous <ed.tanous@intel.com> Change-Id: I588c26440e5a97f718a0f0ea74cc84107d53aa1e
2019-05-21vm_websocket: Add websocket handlerAdriana Kobylak1-0/+218
On receiving a websocket request on endpoint /vm/0/0, connect to the nbd-proxy app and send/receive stdio. Tested: Verified that the host could see the virtual media usb device, mounted it manually and checked the contents of the iso file used for the test were there. To test, used the html and js script: https://github.com/openbmc/jsnbd/tree/master/web and an Ubuntu iso image file. Verified that it worked after closing the websocket (using the stop function from the html file), to check that the processes were cleaned up and freed up for a subsequent request. Change-Id: I0b070310b070c086d67d0ae3e2c165551d6b87cc Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>