[PATCH 11/13] qemu: snapshot: Unify 'cleanup' and 'error' in qemuDomainSnapshotCreateDiskActive

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

 



All cases taking the 'cleanup' path can take the original 'error' path.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 17270d5f83..5b6d3bb795 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15267,7 +15267,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
         if (qemuDomainSnapshotCreateSingleDiskActive(driver, vm,
                                                      &diskdata[i],
                                                      actions, reuse) < 0)
-            goto error;
+            goto cleanup;

         do_transaction = true;
     }
@@ -15291,12 +15291,12 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
         }

         if (rc < 0)
-            goto error;
+            goto cleanup;
     }

     ret = 0;

- error:
+ cleanup:
     if (ret < 0) {
         virErrorPreserveLast(&orig_err);
     } else {
@@ -15320,7 +15320,6 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
                                            vm->newDef) < 0))
         ret = -1;

- cleanup:
     qemuDomainSnapshotDiskDataFree(diskdata, ndiskdata, driver, vm);
     virErrorRestore(&orig_err);

-- 
2.21.0

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

  Powered by Linux