提交 c3afa6a9 编写于 作者: J John Ferlan

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.
上级 27432ba7
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册