提交 49c32214 编写于 作者: J John Ferlan

storage: Clean up stateFile if refreshPool fails

If the virStoragePoolRefresh fails and we call stopPool, the
code neglected to clean up the state file leading to the next
libvirtd restart attempting to start the pool. For a transient
pool this could make it unexpectedly reappear.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 9e52c649
......@@ -1171,8 +1171,13 @@ storagePoolRefresh(virStoragePoolPtr pool,
virStoragePoolObjClearVols(obj);
if (backend->refreshPool(obj) < 0) {
char *stateFile = virFileBuildPath(driver->stateDir, def->name, ".xml");
if (stateFile)
unlink(stateFile);
if (backend->stopPool)
backend->stopPool(obj);
VIR_FREE(stateFile);
event = virStoragePoolEventLifecycleNew(def->name,
def->uuid,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册