Switch to new D-Bus interface
Now that the eStoraged interface is in phosphor-dbus-interfaces, we can
remove the yaml files from this repo and switch to the new interface in
phosphor-dbus-interfaces. Note that the new interface is slightly
different. Some functions have different arguments, and the
eStoraged-specific errors were removed.
Also, the new interface allows for the caller to specify the filesystem
type, but for now, only ext4 is supported.
Tested:
$ /usr/bin/eStoraged -b /dev/mmcblk0 &
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume FormatLuks ays 3 1 2 3 \
xyz.openbmc_project.Inventory.Item.Volume.FilesystemType.ext4
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Lock
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Unlock ay 3 1 2 3
$ busctl call xyz.openbmc_project.eStoraged.mmcblk0 \
/xyz/openbmc_project/storage/mmcblk0 \
xyz.openbmc_project.Inventory.Item.Volume Erase s \
xyz.openbmc_project.Inventory.Item.Volume.EraseMethod.VerifyGeometry
Signed-off-by: John Wedig <johnwedig@google.com>
Change-Id: I5477b313ac5342409e2cf53ca70259c17da6269c
diff --git a/src/erase/erase.cpp b/src/erase/erase.cpp
index 3b6ce17..5de96d6 100644
--- a/src/erase/erase.cpp
+++ b/src/erase/erase.cpp
@@ -6,9 +6,9 @@
#include <stdplus/fd/create.hpp>
#include <stdplus/fd/managed.hpp>
#include <stdplus/handle/managed.hpp>
-#include <xyz/openbmc_project/eStoraged/error.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
-using sdbusplus::xyz::openbmc_project::eStoraged::Error::EraseError;
+using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
using stdplus::fd::ManagedFd;
uint64_t Erase::findSizeOfBlockDevice()
@@ -27,7 +27,7 @@
lg2::error("erase unable to open blockdev", "REDFISH_MESSAGE_ID",
std::string("OpenBMC.0.1.DriveEraseFailure"),
"REDFISH_MESSAGE_ARGS", std::to_string(fd.get()));
- throw EraseError();
+ throw InternalFailure();
}
return bytes;
}
diff --git a/src/erase/meson.build b/src/erase/meson.build
index 3c90ab9..6aaf3a3 100644
--- a/src/erase/meson.build
+++ b/src/erase/meson.build
@@ -4,7 +4,10 @@
'erase.cpp',
include_directories : eStoraged_headers,
implicit_include_directories: false,
- dependencies: [eStoraged_dbus, dependency('stdplus'),],
+ dependencies: [
+ dependency('phosphor-dbus-interfaces'),
+ dependency('stdplus'),
+ ],
)
libeStoragedErase_dep = declare_dependency(
diff --git a/src/erase/verifyDriveGeometry.cpp b/src/erase/verifyDriveGeometry.cpp
index 2996912..ea6c76f 100644
--- a/src/erase/verifyDriveGeometry.cpp
+++ b/src/erase/verifyDriveGeometry.cpp
@@ -3,11 +3,11 @@
#include "estoraged_conf.hpp"
#include <phosphor-logging/lg2.hpp>
-#include <xyz/openbmc_project/eStoraged/error.hpp>
+#include <xyz/openbmc_project/Common/error.hpp>
#include <string>
-using sdbusplus::xyz::openbmc_project::eStoraged::Error::EraseError;
+using sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
void VerifyDriveGeometry::geometryOkay(uint64_t bytes)
{
@@ -18,7 +18,7 @@
"REDFISH_MESSAGE_ARGS",
std::to_string(bytes) + ">" +
std::to_string(ERASE_MAX_GEOMETRY));
- throw EraseError();
+ throw InternalFailure();
}
else if (bytes < ERASE_MIN_GEOMETRY)
{
@@ -27,7 +27,7 @@
std::string("OpenBMC.0.1.DriveEraseFailure"),
"REDFISH_MESSAGE_ARGS",
std::to_string(bytes) + "<" + std::to_string(ERASE_MIN_GEOMETRY));
- throw EraseError();
+ throw InternalFailure();
}
else
{