[libvirt RFC 14/24] qemu_snapshot: introduce qemuSnapshotDiscardMetadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux