]> xenbits.xensource.com Git - libvirt.git/commitdiff
storage: Clean up storagePoolUpdateStateCallback processing
authorJohn Ferlan <jferlan@redhat.com>
Wed, 12 Sep 2018 15:05:51 +0000 (11:05 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 20 Sep 2018 11:49:33 +0000 (07:49 -0400)
Alter the code path to remove the need to to go cleanup and thus
remove the label completely.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
src/storage/storage_driver.c

index 301a9d7292534c4aaf510903eb073adbf0cba2aa..6e7ce9f97cc442cf7f7dcee81bae870f00b54685 100644 (file)
@@ -108,15 +108,15 @@ storagePoolUpdateStateCallback(virStoragePoolObjPtr obj,
     virStorageBackendPtr backend;
     char *stateFile;
 
-    if (!(stateFile = virFileBuildPath(driver->stateDir, def->name, ".xml")))
-        goto cleanup;
-
     if ((backend = virStorageBackendForType(def->type)) == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Missing backend %d"), def->type);
-        goto cleanup;
+        return;
     }
 
+    if (!(stateFile = virFileBuildPath(driver->stateDir, def->name, ".xml")))
+        return;
+
     /* Backends which do not support 'checkPool' are considered
      * inactive by default. */
     if (backend->checkPool &&
@@ -148,8 +148,7 @@ storagePoolUpdateStateCallback(virStoragePoolObjPtr obj,
     if (!virStoragePoolObjIsActive(obj))
         virStoragePoolUpdateInactive(&obj);
 
- cleanup:
-    if (!active && stateFile)
+    if (!active)
         ignore_value(unlink(stateFile));
     VIR_FREE(stateFile);