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: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
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,