/* Return previous state remembered by the status XML. If the pool is not
* available we will fail to refresh it and end up in the same situation.
* This will save one attempt to open the connection to the remote server */
- *active = pool->active;
+ *active = virStoragePoolObjIsActive(pool);
return 0;
}
}
}
- obj->active = active;
+ virStoragePoolObjSetActive(obj, active);
- if (!obj->active)
+ if (!virStoragePoolObjIsActive(obj))
virStoragePoolUpdateInactive(&obj);
cleanup:
_("Failed to autostart storage pool '%s': %s"),
obj->def->name, virGetLastErrorMessage());
} else {
- obj->active = true;
+ virStoragePoolObjSetActive(obj, true);
}
VIR_FREE(stateFile);
}
0);
VIR_INFO("Creating storage pool '%s'", obj->def->name);
- obj->active = true;
+ virStoragePoolObjSetActive(obj, true);
pool = virGetStoragePool(conn, obj->def->name, obj->def->uuid, NULL, NULL);
VIR_STORAGE_POOL_EVENT_STARTED,
0);
- obj->active = true;
+ virStoragePoolObjSetActive(obj, true);
ret = 0;
cleanup:
VIR_STORAGE_POOL_EVENT_STOPPED,
0);
- obj->active = false;
+ virStoragePoolObjSetActive(obj, false);
virStoragePoolUpdateInactive(&obj);
obj->def->uuid,
VIR_STORAGE_POOL_EVENT_STOPPED,
0);
- obj->active = false;
+ virStoragePoolObjSetActive(obj, false);
virStoragePoolUpdateInactive(&obj);
goto cleanup;
memset(info, 0, sizeof(virStoragePoolInfo));
- if (obj->active)
+ if (virStoragePoolObjIsActive(obj))
info->state = VIR_STORAGE_POOL_RUNNING;
else
info->state = VIR_STORAGE_POOL_INACTIVE;
virStoragePoolObjUnlock(obj);
goto error;
}
- obj->active = true;
+ virStoragePoolObjSetActive(obj, true);
/* Find storage volumes */
if (testOpenVolumesForPool(file, ctxt, obj, i+1) < 0) {
if (!(obj = testStoragePoolObjFindInactiveByName(privconn, pool->name)))
return -1;
- obj->active = true;
+ virStoragePoolObjSetActive(obj, true);
event = virStoragePoolEventLifecycleNew(pool->name, pool->uuid,
VIR_STORAGE_POOL_EVENT_STARTED,
* code will not Remove the pool */
virStoragePoolObjSetConfigFile(obj, NULL);
- obj->active = true;
+ virStoragePoolObjSetActive(obj, true);
event = virStoragePoolEventLifecycleNew(obj->def->name, obj->def->uuid,
VIR_STORAGE_POOL_EVENT_STARTED,
if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name)))
return -1;
- obj->active = false;
+ virStoragePoolObjSetActive(obj, false);
if (obj->def->source.adapter.type ==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST) {
return -1;
memset(info, 0, sizeof(virStoragePoolInfo));
- if (obj->active)
+ if (virStoragePoolObjIsActive(obj))
info->state = VIR_STORAGE_POOL_RUNNING;
else
info->state = VIR_STORAGE_POOL_INACTIVE;