Fix bug in storage driver accessing wrong private data

* src/storage/storage_driver.c: Fix IsPersistent() and IsActivE()
  methods on storage pools to use 'storagePrivateData' instead
  of 'privateData'. Also fix naming convention of objects
This commit is contained in:
Daniel P. Berrange 2009-12-09 09:38:11 +00:00
parent de3e38a65e
commit 84961bd3f4

View File

@ -465,17 +465,17 @@ cleanup:
}
static int storagePoolIsActive(virStoragePoolPtr net)
static int storagePoolIsActive(virStoragePoolPtr pool)
{
virStorageDriverStatePtr driver = net->conn->privateData;
virStorageDriverStatePtr driver = pool->conn->storagePrivateData;
virStoragePoolObjPtr obj;
int ret = -1;
storageDriverLock(driver);
obj = virStoragePoolObjFindByUUID(&driver->pools, net->uuid);
obj = virStoragePoolObjFindByUUID(&driver->pools, pool->uuid);
storageDriverUnlock(driver);
if (!obj) {
virStorageReportError(net->conn, VIR_ERR_NO_STORAGE_POOL, NULL);
virStorageReportError(pool->conn, VIR_ERR_NO_STORAGE_POOL, NULL);
goto cleanup;
}
ret = virStoragePoolObjIsActive(obj);
@ -486,17 +486,17 @@ cleanup:
return ret;
}
static int storagePoolIsPersistent(virStoragePoolPtr net)
static int storagePoolIsPersistent(virStoragePoolPtr pool)
{
virStorageDriverStatePtr driver = net->conn->privateData;
virStorageDriverStatePtr driver = pool->conn->storagePrivateData;
virStoragePoolObjPtr obj;
int ret = -1;
storageDriverLock(driver);
obj = virStoragePoolObjFindByUUID(&driver->pools, net->uuid);
obj = virStoragePoolObjFindByUUID(&driver->pools, pool->uuid);
storageDriverUnlock(driver);
if (!obj) {
virStorageReportError(net->conn, VIR_ERR_NO_STORAGE_POOL, NULL);
virStorageReportError(pool->conn, VIR_ERR_NO_STORAGE_POOL, NULL);
goto cleanup;
}
ret = obj->configFile ? 1 : 0;