[libvirt] [PATCH 4/8] qemu: migration: Simplify cleanup in qemuMigrationSrcNBDCopyCancelOne

Peter Krempa pkrempa at redhat.com
Fri Dec 6 18:09:46 UTC 2019


Now that the cleanup section does not exist remove the label.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/qemu/qemu_migration.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b14a1bcd15..9062be38ab 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -649,7 +649,6 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
                                  qemuDomainAsyncJob asyncJob)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
-    int ret = -1;
     int status;
     int rv;

@@ -659,26 +658,22 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver,
     case VIR_DOMAIN_BLOCK_JOB_CANCELED:
         if (failNoJob) {
             qemuMigrationNBDReportMirrorError(job, disk->dst);
-            goto cleanup;
+            return -1;
         }
         G_GNUC_FALLTHROUGH;
     case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
-        ret = 1;
-        goto cleanup;
+        return 1;
     }

     if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
-        goto cleanup;
+        return -1;

     rv = qemuMonitorBlockJobCancel(priv->mon, job->name);

     if (qemuDomainObjExitMonitor(driver, vm) < 0 || rv < 0)
-        goto cleanup;
-
-    ret = 0;
+        return -1;

- cleanup:
-    return ret;
+    return 0;
 }


-- 
2.23.0




More information about the libvir-list mailing list