mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
storage: Create error label path for storagePoolCreateXML
Rather than duplicate the error code, let's create an error label to keep code common. Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
4a7abc67d5
commit
1ff45609d6
@ -727,12 +727,8 @@ storagePoolCreateXML(virConnectPtr conn,
|
||||
}
|
||||
|
||||
if (backend->startPool &&
|
||||
backend->startPool(obj) < 0) {
|
||||
virStoragePoolObjRemove(driver->pools, obj);
|
||||
virObjectUnref(obj);
|
||||
obj = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
backend->startPool(obj) < 0)
|
||||
goto error;
|
||||
|
||||
stateFile = virFileBuildPath(driver->stateDir, def->name, ".xml");
|
||||
|
||||
@ -743,10 +739,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
||||
unlink(stateFile);
|
||||
if (backend->stopPool)
|
||||
backend->stopPool(obj);
|
||||
virStoragePoolObjRemove(driver->pools, obj);
|
||||
virObjectUnref(obj);
|
||||
obj = NULL;
|
||||
goto cleanup;
|
||||
goto error;
|
||||
}
|
||||
|
||||
event = virStoragePoolEventLifecycleNew(def->name,
|
||||
@ -765,6 +758,12 @@ storagePoolCreateXML(virConnectPtr conn,
|
||||
virObjectEventStateQueue(driver->storageEventState, event);
|
||||
virStoragePoolObjEndAPI(&obj);
|
||||
return pool;
|
||||
|
||||
error:
|
||||
virStoragePoolObjRemove(driver->pools, obj);
|
||||
virObjectUnref(obj);
|
||||
obj = NULL;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
static virStoragePoolPtr
|
||||
|
Loading…
x
Reference in New Issue
Block a user