提交 9342bc62 编写于 作者: M Michal Privoznik

storagePoolCreateXML: Don't lose persistent storage on failed create

If there's a persistent storage and user tries to start a new one
with the same name and UUID (e.g. to test new configuration) it
may happen that upon failure we lose the persistent defintion.
Fortunately, we don't remove it from the disk only from the
internal list of the pools.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 1340327f
......@@ -755,6 +755,7 @@ storagePoolCreateXML(virConnectPtr conn,
goto cleanup;
if (!(obj = virStoragePoolObjListAdd(driver->pools, newDef,
VIR_STORAGE_POOL_OBJ_LIST_ADD_LIVE |
VIR_STORAGE_POOL_OBJ_LIST_ADD_CHECK_LIVE)))
goto cleanup;
newDef = NULL;
......@@ -801,7 +802,7 @@ storagePoolCreateXML(virConnectPtr conn,
return pool;
error:
virStoragePoolObjRemove(driver->pools, obj);
virStoragePoolUpdateInactive(obj);
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册