mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
storage: Introduce virStoragePoolObjFindPoolByUUID
Add a new API to search the currently defined pool list for a pool with a matching UUID and return the locked pool object pointer.
This commit is contained in:
parent
27432ba70c
commit
c3afa6a9a3
@ -3370,3 +3370,24 @@ virStorageTranslateDiskSourcePool(virConnectPtr conn,
|
||||
virStoragePoolDefFree(pooldef);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* virStoragePoolObjFindPoolByUUID
|
||||
* @uuid: The uuid to lookup
|
||||
*
|
||||
* Using the passed @uuid, search the driver pools for a matching uuid.
|
||||
* If found, then lock the pool
|
||||
*
|
||||
* Returns NULL if pool is not found or a locked pool object pointer
|
||||
*/
|
||||
virStoragePoolObjPtr
|
||||
virStoragePoolObjFindPoolByUUID(const unsigned char *uuid)
|
||||
{
|
||||
virStoragePoolObjPtr pool;
|
||||
|
||||
storageDriverLock();
|
||||
pool = virStoragePoolObjFindByUUID(&driver->pools, uuid);
|
||||
storageDriverUnlock();
|
||||
return pool;
|
||||
}
|
||||
|
@ -57,6 +57,9 @@ int virStorageFileGetMetadata(virStorageSourcePtr src,
|
||||
int virStorageTranslateDiskSourcePool(virConnectPtr conn,
|
||||
virDomainDiskDefPtr def);
|
||||
|
||||
virStoragePoolObjPtr virStoragePoolObjFindPoolByUUID(const unsigned char *uuid)
|
||||
ATTRIBUTE_NONNULL(1);
|
||||
|
||||
virStoragePoolPtr
|
||||
storagePoolLookupByTargetPath(virConnectPtr conn,
|
||||
const char *path)
|
||||
|
Loading…
Reference in New Issue
Block a user