@@ -130,16 +130,19 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
if (backend->refreshPool(NULL, pool) < 0) {
if (backend->stopPool)
backend->stopPool(NULL, pool);
+ active = false;
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to restart storage pool '%s': %s"),
pool->def->name, virGetLastErrorMessage());
goto error;
}
+ pool->active = true;
}
- pool->active = active;
ret = 0;
error:
+ if (!active)
+ storagePoolSetInactive(pool);
if (ret < 0) {
if (stateFile)
unlink(stateFile);
@@ -158,7 +161,6 @@ storagePoolUpdateAllState(void)
virStoragePoolObjPtr pool = driver->pools.objs[i];
virStoragePoolObjLock(pool);
- storagePoolSetInactive(pool);
storagePoolUpdateState(pool);
virStoragePoolObjUnlock(pool);
}