]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: migration: Simplify cleanup in qemuMigrationSrcNBDCopyCancelOne
authorPeter Krempa <pkrempa@redhat.com>
Fri, 6 Dec 2019 16:26:01 +0000 (17:26 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Dec 2019 06:11:24 +0000 (07:11 +0100)
Now that the cleanup section does not exist remove the label.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_migration.c

index b14a1bcd15572e6e903a6495ff36e217282dc5c2..9062be38ab824ee349cf9a3789aa84d55c80295a 100644 (file)
@@ -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;
 }