bmcweb: Fix StorageController Location Path
The initial path for the location is wrong. This will end up having
multiple location priperty.
```
"Location": {
"PartLocation": {
"LocationType": "Embedded",
"ServiceLabel": "IO1"
}
},
"PartLocation": {
"LocationType": "Embedded"
},
```
Change-Id: Icad2e17d95988b2631d5147e92121f70458f4881
Signed-off-by: Willy Tu <wltu@google.com>
(cherry picked from commit 67f9a8f4bc0d0f5222d57abe9d741b9f2aedeafc)
diff --git a/recipes-phosphor/interfaces/bmcweb/0002-Add-StorageController-node.patch b/recipes-phosphor/interfaces/bmcweb/0002-Add-StorageController-node.patch
index bec6756..df2553e 100644
--- a/recipes-phosphor/interfaces/bmcweb/0002-Add-StorageController-node.patch
+++ b/recipes-phosphor/interfaces/bmcweb/0002-Add-StorageController-node.patch
@@ -1,4 +1,4 @@
-From 2064c7113076aa9b1d94ef7185e2bd46f94d0d81 Mon Sep 17 00:00:00 2001
+From fc6ee2fd2ab024ecf3c0629fae2243e0bb06203a Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@codeconstruct.com.au>
Date: Tue, 17 Jan 2023 11:48:44 +0800
Subject: [PATCH] Add StorageController node
@@ -19,10 +19,10 @@
1 file changed, 127 insertions(+), 1 deletion(-)
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
-index b81d20f0..dbc75d27 100644
+index fd3c727e..d892faa1 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
-@@ -1321,10 +1321,135 @@ inline void getStorageControllerLocation(
+@@ -1343,10 +1343,135 @@ inline void getStorageControllerLocation(
}
}
@@ -158,15 +158,15 @@
const std::vector<std::string>& interfaces)
{
asyncResp->res.jsonValue["@odata.type"] =
-@@ -1337,6 +1462,7 @@ inline void populateStorageController(
- asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
- asyncResp->res.jsonValue["PartLocation"]["LocationType"] = "Embedded";
+@@ -1360,6 +1485,7 @@ inline void populateStorageController(
+ asyncResp->res.jsonValue["Location"]["PartLocation"]["LocationType"] =
+ "Embedded";
getStorageControllerLocation(asyncResp, connectionName, path, interfaces);
+ tryPopulateControllerNvme(asyncResp, path, ifaces);
sdbusplus::asio::getProperty<bool>(
*crow::connections::systemBus, connectionName, path,
-@@ -1403,7 +1529,7 @@ inline void getStorageControllerHandler(
+@@ -1426,7 +1552,7 @@ inline void getStorageControllerHandler(
const std::string& connectionName = interfaceDict.front().first;
populateStorageController(asyncResp, storageId, controllerId,
@@ -176,5 +176,5 @@
}
}
--
-2.40.0.634.g4ca3ef3211-goog
+2.40.1.521.gf1e218fcd8-goog
diff --git a/recipes-phosphor/interfaces/bmcweb/0002-Add-association-support-to-StorageController.patch b/recipes-phosphor/interfaces/bmcweb/0002-Add-association-support-to-StorageController.patch
index 05eca90..9d2eb2c 100644
--- a/recipes-phosphor/interfaces/bmcweb/0002-Add-association-support-to-StorageController.patch
+++ b/recipes-phosphor/interfaces/bmcweb/0002-Add-association-support-to-StorageController.patch
@@ -1,4 +1,4 @@
-From fda07fc5891f802a12749bec4965f245ab0e5d61 Mon Sep 17 00:00:00 2001
+From d2112ea8f59e5ab9eb82e5c0d5797b46c888b2b7 Mon Sep 17 00:00:00 2001
From: Willy Tu <wltu@google.com>
Date: Fri, 12 Aug 2022 00:15:12 +0000
Subject: [PATCH] Add association support to StorageController
@@ -76,10 +76,10 @@
1 file changed, 130 insertions(+), 38 deletions(-)
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
-index 91147e9d..12a6e57d 100644
+index f048b17d..e376195f 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
-@@ -902,20 +902,53 @@ inline void getStorageControllerAsset(
+@@ -902,21 +902,54 @@ inline void getStorageControllerAsset(
}
}
@@ -132,12 +132,13 @@
asyncResp->res.jsonValue["Name"] = controllerId;
asyncResp->res.jsonValue["Id"] = controllerId;
asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
- asyncResp->res.jsonValue["PartLocation"]["LocationType"] = "Embedded";
+ asyncResp->res.jsonValue["Location"]["PartLocation"]["LocationType"] =
+ "Embedded";
+ getStorageControllerLocation(asyncResp, connectionName, path, interfaces);
sdbusplus::asio::getProperty<bool>(
*crow::connections::systemBus, connectionName, path,
-@@ -947,7 +980,8 @@ inline void populateStorageController(
+@@ -948,7 +981,8 @@ inline void populateStorageController(
inline void getStorageControllerHandler(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -147,7 +148,7 @@
const dbus::utility::MapperGetSubTreeResponse& subtree)
{
if (ec || subtree.empty())
-@@ -980,14 +1014,15 @@ inline void getStorageControllerHandler(
+@@ -981,14 +1015,15 @@ inline void getStorageControllerHandler(
}
const std::string& connectionName = interfaceDict.front().first;
@@ -166,7 +167,7 @@
const dbus::utility::MapperGetSubTreePathsResponse& controllerList)
{
nlohmann::json::array_t members;
-@@ -1008,19 +1043,58 @@ inline void populateStorageControllerCollection(
+@@ -1009,19 +1044,58 @@ inline void populateStorageControllerCollection(
return;
}
nlohmann::json::object_t member;
@@ -229,7 +230,7 @@
{
if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
-@@ -1036,27 +1110,37 @@ inline void storageControllerCollectionHandler(
+@@ -1037,27 +1111,37 @@ inline void storageControllerCollectionHandler(
return;
}
@@ -282,7 +283,7 @@
{
if (!redfish::setUpRedfishRoute(app, req, asyncResp))
{
-@@ -1071,20 +1155,27 @@ inline void storageControllerHandler(
+@@ -1072,20 +1156,27 @@ inline void storageControllerHandler(
BMCWEB_LOG_DEBUG << "Failed to find ComputerSystem of " << systemName;
return;
}
@@ -320,7 +321,7 @@
.privileges(redfish::privileges::getStorageControllerCollection)
.methods(boost::beast::http::verb::get)(
std::bind_front(storageControllerCollectionHandler, std::ref(app)));
-@@ -1092,7 +1183,8 @@ inline void requestRoutesStorageControllerCollection(App& app)
+@@ -1093,7 +1184,8 @@ inline void requestRoutesStorageControllerCollection(App& app)
inline void requestRoutesStorageController(App& app)
{
@@ -331,5 +332,5 @@
.methods(boost::beast::http::verb::get)(
std::bind_front(storageControllerHandler, std::ref(app)));
--
-2.40.0.634.g4ca3ef3211-goog
+2.40.1.521.gf1e218fcd8-goog
diff --git a/recipes-phosphor/interfaces/bmcweb/0002-storage-Support-new-StorageController.patch b/recipes-phosphor/interfaces/bmcweb/0002-storage-Support-new-StorageController.patch
index b1c3995..96d019e 100644
--- a/recipes-phosphor/interfaces/bmcweb/0002-storage-Support-new-StorageController.patch
+++ b/recipes-phosphor/interfaces/bmcweb/0002-storage-Support-new-StorageController.patch
@@ -1,4 +1,4 @@
-From 8894eb0af951db5ad927b647b0dc076dfa651287 Mon Sep 17 00:00:00 2001
+From c051ca3b37973fcc9b0b72eb750e32b69ff34bd2 Mon Sep 17 00:00:00 2001
From: Willy Tu <wltu@google.com>
Date: Tue, 14 Mar 2023 11:29:50 -0700
Subject: [PATCH] storage: Support new StorageController
@@ -95,8 +95,8 @@
Signed-off-by: Willy Tu <wltu@google.com>
---
redfish-core/include/redfish.hpp | 2 +
- redfish-core/lib/storage.hpp | 395 +++++++++++++++++++------------
- 2 files changed, 248 insertions(+), 149 deletions(-)
+ redfish-core/lib/storage.hpp | 398 +++++++++++++++++++------------
+ 2 files changed, 250 insertions(+), 150 deletions(-)
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index ea2e2017..28172643 100644
@@ -112,7 +112,7 @@
requestRoutesCable(app);
requestRoutesCableCollection(app);
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
-index 047d34a7..dd9a244e 100644
+index 047d34a7..98ec7e61 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -113,153 +113,6 @@ inline void getDrives(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
@@ -288,7 +288,16 @@
});
}
-@@ -915,4 +769,247 @@ inline void requestRoutesChassisDriveName(App& app)
+@@ -759,7 +613,7 @@ inline void chassisDriveCollectionGet(
+ asyncResp->res.jsonValue["Members@odata.count"] = resp.size();
+ }); // end association lambda
+
+- } // end Iterate over all retrieved ObjectPaths
++ } // end Iterate over all retrieved ObjectPaths
+ });
+ }
+
+@@ -915,4 +769,248 @@ inline void requestRoutesChassisDriveName(App& app)
std::bind_front(handleChassisDriveGet, std::ref(app)));
}
@@ -352,7 +361,8 @@
+ asyncResp->res.jsonValue["Name"] = controllerId;
+ asyncResp->res.jsonValue["Id"] = controllerId;
+ asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
-+ asyncResp->res.jsonValue["PartLocation"]["LocationType"] = "Embedded";
++ asyncResp->res.jsonValue["Location"]["PartLocation"]["LocationType"] =
++ "Embedded";
+
+ sdbusplus::asio::getProperty<bool>(
+ *crow::connections::systemBus, connectionName, path,
@@ -537,5 +547,5 @@
+
} // namespace redfish
--
-2.40.0.634.g4ca3ef3211-goog
+2.40.1.521.gf1e218fcd8-goog
diff --git a/recipes-phosphor/interfaces/bmcweb/0003-Storage-Add-SecuritySend-and-SecurityReceive.patch b/recipes-phosphor/interfaces/bmcweb/0003-Storage-Add-SecuritySend-and-SecurityReceive.patch
index a3140d4..ea52df3 100644
--- a/recipes-phosphor/interfaces/bmcweb/0003-Storage-Add-SecuritySend-and-SecurityReceive.patch
+++ b/recipes-phosphor/interfaces/bmcweb/0003-Storage-Add-SecuritySend-and-SecurityReceive.patch
@@ -1,4 +1,4 @@
-From 3dae3e769b819e205601100c22e7b6cebc41ccb0 Mon Sep 17 00:00:00 2001
+From af85720880e3fb75dac8fb26645a887ffc66bcab Mon Sep 17 00:00:00 2001
From: Matt Johnston <matt@codeconstruct.com.au>
Date: Tue, 17 Jan 2023 17:40:24 +0800
Subject: [PATCH] Storage: Add SecuritySend and SecurityReceive
@@ -32,7 +32,7 @@
requestRoutesCableCollection(app);
requestDriveResetAction(app);
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
-index 630a95f3..852c3f57 100644
+index d892faa1..f9019de3 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -1378,14 +1378,146 @@ inline void tryPopulateControllerNvme(
@@ -285,7 +285,7 @@
inline void populateStorageController(
const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
const std::string& storageId, const std::string& controllerId,
-@@ -1476,15 +1696,17 @@ inline void populateStorageController(
+@@ -1476,9 +1696,10 @@ inline void populateStorageController(
{
asyncResp->res.jsonValue["@odata.type"] =
"#StorageController.v1_7_0.StorageController";
@@ -299,7 +299,8 @@
asyncResp->res.jsonValue["Name"] = controllerId;
asyncResp->res.jsonValue["Id"] = controllerId;
asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
- asyncResp->res.jsonValue["PartLocation"]["LocationType"] = "Embedded";
+@@ -1486,6 +1707,7 @@ inline void populateStorageController(
+ "Embedded";
getStorageControllerLocation(asyncResp, connectionName, path, interfaces);
tryPopulateControllerNvme(asyncResp, path, ifaces);
+ tryPopulateControllerSecurity(asyncResp, url, ifaces);
@@ -307,5 +308,5 @@
sdbusplus::asio::getProperty<bool>(
*crow::connections::systemBus, connectionName, path,
--
-2.40.0.634.g4ca3ef3211-goog
+2.40.1.521.gf1e218fcd8-goog