Get eraseMaxGeometry and eraseMinGeometry from dbus
Also, make findDevice return output parameters based on RVO.
With the change like in EntityManager JSON:
```
{
"Name": "example_emmc",
"Type": "EmmcDevice",
"LocationCode": "location"
"EraseMaxGeometry": 10000000000,
"EraseMinGeometry": 5000000000,
}
```
and geometry values will be set to estoraged.
Tested:
- unit test pass:
```
5/7 util_test OK 0.05s
```
Change-Id: Ia8499af2168c7e740558978273fc80456eb29282
Signed-off-by: Tom Tung <shes050117@gmail.com>
diff --git a/include/estoraged.hpp b/include/estoraged.hpp
index 871fdca..ec8f467 100644
--- a/include/estoraged.hpp
+++ b/include/estoraged.hpp
@@ -44,6 +44,8 @@
* @param[in] partNumber - part number for the storage device
* @param[in] serialNumber - serial number for the storage device
* @param[in] locationCode - location code for the storage device
+ * @param[in] eraseMaxGeometry - max geometry to erase if it's specified
+ * @param[in] eraseMinGeometry - min geometry to erase if it's specified
* @param[in] cryptInterface - (optional) pointer to CryptsetupInterface
* object
* @param[in] fsInterface - (optional) pointer to FilesystemInterface
@@ -53,7 +55,8 @@
const std::string& configPath, const std::string& devPath,
const std::string& luksName, uint64_t size, uint8_t lifeTime,
const std::string& partNumber, const std::string& serialNumber,
- const std::string& locationCode,
+ const std::string& locationCode, uint64_t eraseMaxGeometry,
+ uint64_t eraseMinGeometry,
std::unique_ptr<CryptsetupInterface> cryptInterface =
std::make_unique<Cryptsetup>(),
std::unique_ptr<FilesystemInterface> fsInterface =
@@ -118,6 +121,12 @@
/** @brief Mount point for the filesystem. */
std::string mountPoint;
+ /** @brief Max geometry to erase. */
+ uint64_t eraseMaxGeometry;
+
+ /** @brief Min geometry to erase. */
+ uint64_t eraseMinGeometry;
+
/** @brief Indicates whether the LUKS device is currently locked. */
bool lockedProperty{false};