提交 9935b435 编写于 作者: M Michal Privoznik

storage_driver: Don't crash in storagePoolCreateXML

In my recent patches I've introduced
virStoragePoolObjIsStarting() which is then used to protect
storage pool definition when the pool object is locked and
unlocked during long running jobs. Well, my patches did not
anticipate that @obj can be NULL under 'cleanup' label in
storagePoolCreateXML() (for instance when parsing XML fails).
This imperfection is causing libvirtd to crash then.

Fixes: 13284a6b storage_driver: Protect pool def during startup and build
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
上级 277c8c4c
......@@ -808,7 +808,7 @@ storagePoolCreateXML(virConnectPtr conn,
pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
cleanup:
if (virStoragePoolObjIsStarting(obj)) {
if (obj && virStoragePoolObjIsStarting(obj)) {
if (!virStoragePoolObjIsActive(obj))
virStoragePoolUpdateInactive(obj);
virStoragePoolObjSetStarting(obj, false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册