]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Merge use of 'reuse' flag in qemuDomainSnapshotDiskPrepareOne
authorPeter Krempa <pkrempa@redhat.com>
Tue, 13 Aug 2019 10:28:00 +0000 (12:28 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 6 Sep 2019 06:12:21 +0000 (08:12 +0200)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_driver.c

index 9d5bd638c9677775afddcf3082d91e5aaa4b12fb..9480df2b3963ac975d3d5041a8e6acf1cdf2707e 100644 (file)
@@ -15359,16 +15359,16 @@ qemuDomainSnapshotDiskPrepareOne(virQEMUDriverPtr driver,
             else
                 VIR_FREE(backingStoreStr);
         }
-    }
-
-    /* pre-create the image file so that we can label it before handing it to qemu */
-    if (!reuse && dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
-        if (virStorageFileCreate(dd->src) < 0) {
-            virReportSystemError(errno, _("failed to create image file '%s'"),
-                                 NULLSTR(dd->src->path));
-            return -1;
+    } else {
+        /* pre-create the image file so that we can label it before handing it to qemu */
+        if (dd->src->type != VIR_STORAGE_TYPE_BLOCK) {
+            if (virStorageFileCreate(dd->src) < 0) {
+                virReportSystemError(errno, _("failed to create image file '%s'"),
+                                     NULLSTR(dd->src->path));
+                return -1;
+            }
+            dd->created = true;
         }
-        dd->created = true;
     }
 
     /* set correct security, cgroup and locking options on the new image */