]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: remove cleanup label from qemuMigrationSrcGraphicsRelocate
authorJán Tomko <jtomko@redhat.com>
Wed, 22 Jun 2022 05:29:22 +0000 (07:29 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 22 Jun 2022 10:28:29 +0000 (12:28 +0200)
Remove the label and use 'rc' instead of 'ret'.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_migration.c

index 3d7d5efda301449921fa4af15afcfe25af5177c8..d93e7e9c74f34aaf83ba392a3e2ac50a77561653 100644 (file)
@@ -2104,7 +2104,6 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver,
                                  const char *graphicsuri)
 {
     qemuDomainObjPrivate *priv = vm->privateData;
-    int ret = -1;
     const char *listenAddress = NULL;
     virSocketAddr addr;
     g_autoptr(virURI) uri = NULL;
@@ -2112,12 +2111,13 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver,
     int port = -1;
     int tlsPort = -1;
     const char *tlsSubject = NULL;
+    int rc = -1;
 
     if (!cookie || (!cookie->graphics && !graphicsuri))
         return 0;
 
     if (graphicsuri && !(uri = virURIParse(graphicsuri)))
-        goto cleanup;
+        return -1;
 
     if (cookie->graphics) {
         type = cookie->graphics->type;
@@ -2140,7 +2140,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver,
         if ((type = virDomainGraphicsTypeFromString(uri->scheme)) < 0) {
             virReportError(VIR_ERR_INVALID_ARG,
                            _("unknown graphics type %s"), uri->scheme);
-            goto cleanup;
+            return -1;
         }
 
         if (uri->server)
@@ -2156,7 +2156,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver,
                     virReportError(VIR_ERR_INVALID_ARG,
                                    _("invalid tlsPort number: %s"),
                                    param->value);
-                    goto cleanup;
+                    return -1;
                 }
             } else if (STRCASEEQ(param->name, "tlsSubject")) {
                 tlsSubject = param->value;
@@ -2167,32 +2167,27 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver,
     /* QEMU doesn't support VNC relocation yet, so
      * skip it to avoid generating an error
      */
-    if (type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE) {
-        ret = 0;
-        goto cleanup;
-    }
+    if (type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE)
+        return 0;
 
     /* Older libvirt sends port == 0 for listen type='none' graphics. It's
      * safe to ignore such requests since relocation to unknown port does
      * not make sense in general.
      */
-    if (port <= 0 && tlsPort <= 0) {
-        ret = 0;
-        goto cleanup;
-    }
+    if (port <= 0 && tlsPort <= 0)
+        return 0;
 
     if (qemuDomainObjEnterMonitorAsync(driver, vm,
                                        VIR_ASYNC_JOB_MIGRATION_OUT) == 0) {
         qemuDomainJobPrivate *jobPriv = priv->job.privateData;
 
-        ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
-                                          port, tlsPort, tlsSubject);
-        jobPriv->spiceMigration = !ret;
+        rc = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
+                                         port, tlsPort, tlsSubject);
+        jobPriv->spiceMigration = !rc;
         qemuDomainObjExitMonitor(vm);
     }
 
- cleanup:
-    return ret;
+    return rc;
 }