]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
libxl: rename goto label
authorJim Fehlig <jfehlig@suse.com>
Tue, 8 Jul 2014 16:59:39 +0000 (10:59 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 8 Jul 2014 23:14:50 +0000 (17:14 -0600)
In libxlDomainMigrationPrepare(), the cleanup label handles error
conditions and should be renamed as such for clarity.

src/libxl/libxl_migration.c

index 53d961c1e5a0a68cb02a9d9dad34482226915c30..cfbbcd002ac34a2af08a8f841f39adcbc6b78986 100644 (file)
@@ -288,31 +288,31 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
                                    VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
                                    VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                    NULL)))
-        goto cleanup;
+        goto error;
 
     /* Create socket connection to receive migration data */
     if (!uri_in) {
         if ((hostname = virGetHostname()) == NULL)
-            goto cleanup;
+            goto error;
 
         if (STRPREFIX(hostname, "localhost")) {
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                            _("hostname on destination resolved to localhost,"
                              " but migration requires an FQDN"));
-            goto cleanup;
+            goto error;
         }
 
         if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
-            goto cleanup;
+            goto error;
 
         if (virAsprintf(uri_out, "tcp://%s:%d", hostname, port) < 0)
-            goto cleanup;
+            goto error;
     } else {
         if (!(STRPREFIX(uri_in, "tcp://"))) {
             /* not full URI, add prefix tcp:// */
             char *tmp;
             if (virAsprintf(&tmp, "tcp://%s", uri_in) < 0)
-                goto cleanup;
+                goto error;
             uri = virURIParse(tmp);
             VIR_FREE(tmp);
         } else {
@@ -323,28 +323,28 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
             virReportError(VIR_ERR_INVALID_ARG,
                            _("unable to parse URI: %s"),
                            uri_in);
-            goto cleanup;
+            goto error;
         }
 
         if (uri->server == NULL) {
             virReportError(VIR_ERR_INVALID_ARG,
                            _("missing host in migration URI: %s"),
                            uri_in);
-            goto cleanup;
+            goto error;
         } else {
             hostname = uri->server;
         }
 
         if (uri->port == 0) {
             if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
-                goto cleanup;
+                goto error;
 
         } else {
             port = uri->port;
         }
 
         if (virAsprintf(uri_out, "tcp://%s:%d", hostname, port) < 0)
-            goto cleanup;
+            goto error;
     }
 
     snprintf(portstr, sizeof(portstr), "%d", port);
@@ -352,14 +352,14 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
     if (virNetSocketNewListenTCP(hostname, portstr, &socks, &nsocks) < 0) {
         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                        _("Fail to create socket for incoming migration"));
-        goto cleanup;
+        goto error;
     }
 
     if (libxlMigrationDstArgsInitialize() < 0)
-        goto cleanup;
+        goto error;
 
     if (!(args = virObjectNew(libxlMigrationDstArgsClass)))
-        goto cleanup;
+        goto error;
 
     args->conn = dconn;
     args->vm = vm;
@@ -395,12 +395,12 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
     virObjectUnref(args);
 
     if (!nsocks_listen)
-        goto cleanup;
+        goto error;
 
     ret = 0;
     goto done;
 
cleanup:
error:
     for (i = 0; i < nsocks; i++) {
         virNetSocketClose(socks[i]);
         virObjectUnref(socks[i]);