[PATCH 3/4] qemu: snapshot: Forbid empty snapshots

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

 



If neither disks nor memory are selected for snapshot we'd record
metadata in case of external snapshot and do a disk snapshot in case of
external disk snapshot. Forbid this as it doesn't make much sense.
---

Notes:
    There's a slightly usable case where this would be used to backup domain's config.

 src/qemu/qemu_driver.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e6b6648..6442b3f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -12703,6 +12703,13 @@ qemuDomainSnapshotPrepare(virConnectPtr conn,
         }
     }

+    if (!found_internal && !external &&
+        def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_NONE) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                       _("nothing selected for snapshot"));
+        goto cleanup;
+    }
+
     /* internal snapshot requires a disk image to store the memory image to and
      * also disks can't be excluded from a internal snapshot*/
     if ((def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && !found_internal) ||
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]