diff options
author | Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com> | 2024-05-16 15:23:43 +0300 |
---|---|---|
committer | Boleslaw Ogonczyk Makowski <boleslawx.ogonczyk-makowski@intel.com> | 2024-05-17 11:39:33 +0300 |
commit | 5ec22842d0d61380809d8e9cdfbc692c14c32cab (patch) | |
tree | a776a723e3f94dda7482fb9bcd1d47cab7ec5927 | |
parent | 43498813ad8c37902f7c4cc7128072c7405054e9 (diff) | |
download | bmcweb-master.tar.xz |
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>
-rw-r--r-- | include/vm_websocket.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/vm_websocket.hpp b/include/vm_websocket.hpp index 4d86c3e231..284b5d2e1c 100644 --- a/include/vm_websocket.hpp +++ b/include/vm_websocket.hpp @@ -421,6 +421,7 @@ inline void { if (ec) { + BMCWEB_LOG_ERROR("DBus getAllProperties error: {}", ec.message()); conn.close("Internal Error"); return; } @@ -433,6 +434,7 @@ inline void if (!success) { + BMCWEB_LOG_ERROR("Failed to unpack properties"); conn.close("Internal Error"); return; } @@ -462,14 +464,20 @@ inline void onOpen(crow::websocket::Connection& conn) { BMCWEB_LOG_DEBUG("nbd-proxy.onopen({})", logPtr(&conn)); - sdbusplus::message::object_path path( - "/xyz/openbmc_project/VirtualMedia/nbd"); + if (conn.url().segments().size() < 2) + { + BMCWEB_LOG_ERROR("Invalid path - \"{}\"", conn.url().path()); + conn.close("Internal error"); + return; + } - path /= std::to_string(0); + std::string index = conn.url().segments().back(); + std::string path = + std::format("/xyz/openbmc_project/VirtualMedia/Proxy/Slot_{}", index); sdbusplus::asio::getAllProperties( *crow::connections::systemBus, "xyz.openbmc_project.VirtualMedia", path, - "xyz.openbmc_project.VirtualMedia", + "xyz.openbmc_project.VirtualMedia.MountPoint", [&conn, path](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& propertiesList) { afterGetSocket(conn, path, ec, propertiesList); |