]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: snapshot: Use better check when reverting external snapshots
authorPeter Krempa <pkrempa@redhat.com>
Tue, 4 Mar 2014 09:06:22 +0000 (10:06 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 4 Mar 2014 10:12:44 +0000 (11:12 +0100)
https://bugzilla.redhat.com/show_bug.cgi?id=1071264

Reverting of external snapshots is not supported currently. The check
that is present doesn't properly check for all aspects that make a
snapshot external. Use virDomainSnapshotIsExternal() to do the check.

src/qemu/qemu_driver.c

index e04a32841807851fd1386ab8a7fd91672f114dce..4fbcb27b7597b09aff5950418c195ccc31dba2c1 100644 (file)
@@ -13921,12 +13921,13 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
                          "to revert to inactive snapshot"));
         goto cleanup;
     }
-    if (snap->def->state == VIR_DOMAIN_DISK_SNAPSHOT) {
+
+    if (virDomainSnapshotIsExternal(snap)) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                       _("revert to external disk snapshot not supported "
-                         "yet"));
+                       _("revert to external snapshot not supported yet"));
         goto cleanup;
     }
+
     if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) {
         if (!snap->def->dom) {
             virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY,