BMC Updater: Add function to delete all versions
This commit extends the item updater with a function to delete all
non-current versions uploaded to the machine.
Resolves openbmc/openbmc#2264
Change-Id: I4d835d5020766f8bb5e9653b28535acfb191fe53
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index d55e807..580aecf 100644
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -6,6 +6,7 @@
#include <xyz/openbmc_project/Common/FactoryReset/server.hpp>
#include <xyz/openbmc_project/Control/FieldMode/server.hpp>
#include "org/openbmc/Associations/server.hpp"
+#include "xyz/openbmc_project/Collection/DeleteAll/server.hpp"
namespace phosphor
{
@@ -17,7 +18,8 @@
using ItemUpdaterInherit = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Common::server::FactoryReset,
sdbusplus::xyz::openbmc_project::Control::server::FieldMode,
- sdbusplus::org::openbmc::server::Associations>;
+ sdbusplus::org::openbmc::server::Associations,
+ sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll>;
namespace MatchRules = sdbusplus::bus::match::rules;
@@ -85,6 +87,10 @@
*/
void erase(std::string entryId);
+ /**
+ * @brief Deletes all versions except for the current one
+ */
+ void deleteAll();
/** @brief Creates an active association to the
* newly active software image