From 4a7abc67d55c51a01ecd153c85218ac38efd8986 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Wed, 12 Sep 2018 11:05:51 -0400 Subject: [PATCH] storage: Clean up storagePoolUpdateStateCallback processing Alter the code path to remove the need to to go cleanup and thus remove the label completely. Signed-off-by: John Ferlan ACKed-by: Michal Privoznik --- 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 301a9d7292..6e7ce9f97c 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -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);