mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-03 20:01:16 +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 &&
|
if (backend->startPool &&
|
||||||
backend->startPool(obj) < 0) {
|
backend->startPool(obj) < 0)
|
||||||
virStoragePoolObjRemove(driver->pools, obj);
|
goto error;
|
||||||
virObjectUnref(obj);
|
|
||||||
obj = NULL;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
stateFile = virFileBuildPath(driver->stateDir, def->name, ".xml");
|
stateFile = virFileBuildPath(driver->stateDir, def->name, ".xml");
|
||||||
|
|
||||||
@ -743,10 +739,7 @@ storagePoolCreateXML(virConnectPtr conn,
|
|||||||
unlink(stateFile);
|
unlink(stateFile);
|
||||||
if (backend->stopPool)
|
if (backend->stopPool)
|
||||||
backend->stopPool(obj);
|
backend->stopPool(obj);
|
||||||
virStoragePoolObjRemove(driver->pools, obj);
|
goto error;
|
||||||
virObjectUnref(obj);
|
|
||||||
obj = NULL;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event = virStoragePoolEventLifecycleNew(def->name,
|
event = virStoragePoolEventLifecycleNew(def->name,
|
||||||
@ -765,6 +758,12 @@ storagePoolCreateXML(virConnectPtr conn,
|
|||||||
virObjectEventStateQueue(driver->storageEventState, event);
|
virObjectEventStateQueue(driver->storageEventState, event);
|
||||||
virStoragePoolObjEndAPI(&obj);
|
virStoragePoolObjEndAPI(&obj);
|
||||||
return pool;
|
return pool;
|
||||||
|
|
||||||
|
error:
|
||||||
|
virStoragePoolObjRemove(driver->pools, obj);
|
||||||
|
virObjectUnref(obj);
|
||||||
|
obj = NULL;
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
static virStoragePoolPtr
|
static virStoragePoolPtr
|
||||||
|
Loading…
Reference in New Issue
Block a user