[libvirt] [PATCH 07/10] qemu: Merge conditions depending on the 'reuse' flag in qemuDomainSnapshotDiskDataCollectOne

Peter Krempa posted 10 patches 6 years, 5 months ago
There is a newer version of this series
[libvirt] [PATCH 07/10] qemu: Merge conditions depending on the 'reuse' flag in qemuDomainSnapshotDiskDataCollectOne
Posted by Peter Krempa 6 years, 5 months ago
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_driver.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9248f912d0..0bbde4b52d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15366,16 +15366,16 @@ qemuDomainSnapshotDiskDataCollectOne(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 */
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 07/10] qemu: Merge conditions depending on the 'reuse' flag in qemuDomainSnapshotDiskDataCollectOne
Posted by Ján Tomko 6 years, 5 months ago
On Fri, Aug 16, 2019 at 03:54:41PM +0200, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_driver.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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