If you end up with a state file for a pool that no longer starts up
or refreshes correctly, the state file is never removed and adds
noise to the logs everytime libvirtd is started.
If the initial state syncing fails, delete the statefile.
{
bool active;
virStorageBackendPtr backend;
+ int ret = -1;
+ char *stateFile;
+
+ if (!(stateFile = virFileBuildPath(driver->stateDir,
+ pool->def->name, ".xml")))
+ goto error;
if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
VIR_ERROR(_("Missing backend %d"), pool->def->type);
}
pool->active = active;
+ ret = 0;
error:
+ if (ret < 0) {
+ if (stateFile)
+ unlink(stateFile);
+ }
+ VIR_FREE(stateFile);
+
return;
}