mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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:
parent
de3e38a65e
commit
84961bd3f4
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user