BMC: Fix the delete implementation.
- Implement delete interface inside version class
so that both item_updater and image_manager can
share the same interface. This meant removing the
delete interface from inside the activation class.
- The delete is created as a separate object inside
version, only if the image is non-functional.
This helps remove the delete interface from a
running BMC/HOST image.
- As part of the activation process, the version from
inside the image_manager is deleted and so is the
version's tarfile from the image upload dir.
Partially resolves openbmc/openbmc#2490
Change-Id: Ib35bf188df85ebd2277d3d9ad04300e434965eea
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/image_manager.hpp b/image_manager.hpp
index 5c69536..4938823 100644
--- a/image_manager.hpp
+++ b/image_manager.hpp
@@ -9,8 +9,6 @@
namespace manager
{
-namespace MatchRules = sdbusplus::bus::match::rules;
-
/** @class Manager
* @brief Contains a map of Version dbus objects.
* @details The software image manager class that contains the Version dbus
@@ -23,16 +21,7 @@
*
* @param[in] bus - The Dbus bus object
*/
- Manager(sdbusplus::bus::bus& bus) :
- bus(bus),
- versionMatch(
- bus,
- MatchRules::interfacesRemoved() +
- MatchRules::path(SOFTWARE_OBJPATH),
- std::bind(
- std::mem_fn(&Manager::removeVersion),
- this,
- std::placeholders::_1)){};
+ Manager(sdbusplus::bus::bus& bus) : bus(bus){};
/**
* @brief Verify and untar the tarball. Verify the manifest file.
@@ -52,13 +41,6 @@
void erase(std::string entryId);
private:
- /** @brief Callback function for Software.Version match.
- * @details Removes a version object.
- *
- * @param[in] msg - Data associated with subscribed signal
- */
- void removeVersion(sdbusplus::message::message& msg);
-
/** @brief Persistent map of Version dbus objects and their
* version id */
std::map<std::string, std::unique_ptr<Version>> versions;
@@ -66,9 +48,6 @@
/** @brief Persistent sdbusplus DBus bus connection. */
sdbusplus::bus::bus& bus;
- /** @brief sdbusplus signal match for Software.Version */
- sdbusplus::bus::match_t versionMatch;
-
/**
* @brief Untar the tarball.
*