Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 493d83d017..b94506c177 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -2376,10 +2376,9 @@ qemuSnapshotDiscardAllMetadata(virQEMUDriver *driver,
static int
-qemuSnapshotDeleteSingle(virDomainObj *vm,
- virDomainMomentObj *snap,
- virQEMUDriver *driver,
- bool metadata_only)
+qemuSnapshotDiscardMetadata(virDomainObj *vm,
+ virDomainMomentObj *snap,
+ virQEMUDriver *driver)
{
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
@@ -2400,6 +2399,19 @@ qemuSnapshotDeleteSingle(virDomainObj *vm,
virDomainMomentMoveChildren(snap, snap->parent);
}
+ return 0;
+}
+
+
+static int
+qemuSnapshotDeleteSingle(virDomainObj *vm,
+ virDomainMomentObj *snap,
+ virQEMUDriver *driver,
+ bool metadata_only)
+{
+ if (qemuSnapshotDiscardMetadata(vm, snap, driver) < 0)
+ return -1;
+
return qemuSnapshotDiscard(driver, vm, snap, true, metadata_only);
}
--
2.37.2