mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
storage: Add feature check for storage file backend supporting access check
When the user provides backing chain, we don't need the full support for traversing the backing chain. This patch adds a feature check for the virStorageSourceAccess API.
This commit is contained in:
parent
8c6b6684a8
commit
a93d750a7e
@ -95,6 +95,26 @@ virStorageFileSupportsSecurityDriver(const virStorageSource *src)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virStorageFileSupportsAccess:
|
||||
*
|
||||
* @src: a storage file structure
|
||||
*
|
||||
* Check if a storage file supports checking if the storage source is accessible
|
||||
* for the given vm.
|
||||
*/
|
||||
bool
|
||||
virStorageFileSupportsAccess(const virStorageSource *src)
|
||||
{
|
||||
virStorageFileBackendPtr backend;
|
||||
|
||||
if (!(backend = virStorageFileGetBackendForSupportCheck(src)))
|
||||
return false;
|
||||
|
||||
return !!backend->storageFileAccess;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
virStorageFileDeinit(virStorageSourcePtr src)
|
||||
{
|
||||
|
@ -41,6 +41,7 @@ int virStorageFileAccess(virStorageSourcePtr src, int mode);
|
||||
int virStorageFileChown(const virStorageSource *src, uid_t uid, gid_t gid);
|
||||
|
||||
bool virStorageFileSupportsSecurityDriver(const virStorageSource *src);
|
||||
bool virStorageFileSupportsAccess(const virStorageSource *src);
|
||||
|
||||
int virStorageFileGetMetadata(virStorageSourcePtr src,
|
||||
uid_t uid, gid_t gid,
|
||||
|
Loading…
x
Reference in New Issue
Block a user