[PATCH 2/5] storage: Clean up storagePoolUpdateStateCallback processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alter the code path to remove the need to to go cleanup and thus
remove the label completely.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_driver.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 1dbeb213e3..d0e7e6904c 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -111,15 +111,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 &&
@@ -151,8 +151,7 @@ storagePoolUpdateStateCallback(virStoragePoolObjPtr obj,
     if (!virStoragePoolObjIsActive(obj))
         virStoragePoolUpdateInactive(&obj);
 
- cleanup:
-    if (!active && stateFile)
+    if (!active)
         ignore_value(unlink(stateFile));
     VIR_FREE(stateFile);
 
-- 
2.17.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux