Fix problem requiring two Delete calls to remove an image
- Remove Delete inheritance and method from Version object.
- Add Delete inheritance and method to Activation object.
- Add a listener in the image Manager for deleted Versions and remove
its 'backup' copy of the Version.
Resolves openbmc/openbmc#2086
Change-Id: If41783319cf1ff5b840b747ba457d0570bc52918
Signed-off-by: Eddie James <eajames@us.ibm.com>
diff --git a/version.hpp b/version.hpp
old mode 100755
new mode 100644
index cbc2bd7..3d17213
--- a/version.hpp
+++ b/version.hpp
@@ -2,7 +2,6 @@
#include <sdbusplus/bus.hpp>
#include "xyz/openbmc_project/Software/Version/server.hpp"
-#include "xyz/openbmc_project/Object/Delete/server.hpp"
#include "xyz/openbmc_project/Common/FilePath/server.hpp"
#include <functional>
@@ -17,7 +16,6 @@
using VersionInherit = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Software::server::Version,
- sdbusplus::xyz::openbmc_project::Object::server::Delete,
sdbusplus::xyz::openbmc_project::Common::server::FilePath>;
/** @class Version
@@ -35,18 +33,14 @@
* @param[in] versionId - The version identifier
* @param[in] versionPurpose - The version purpose
* @param[in] filePath - The image filesystem path
- * @param[in] callback - The parent's erase callback
*/
Version(sdbusplus::bus::bus& bus,
const std::string& objPath,
const std::string& versionId,
VersionPurpose versionPurpose,
- const std::string& filePath,
- eraseFunc callback) : VersionInherit(
+ const std::string& filePath) : VersionInherit(
bus, (objPath).c_str(), true)
{
- // Bind erase method
- eraseCallback = callback;
// Set properties.
purpose(versionPurpose);
version(versionId);
@@ -79,21 +73,8 @@
* @return The version identifier.
*/
static std::string getBMCVersion(const std::string& releaseFilePath);
-
- /**
- * @brief Delete the d-bus object and image.
- */
- void delete_() override;
-
-
- private:
- /**
- * @brief The parent's erase callback.
- */
- eraseFunc eraseCallback;
};
} // namespace manager
} // namespace software
} // namespace phosphor
-