mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-26 15:14:42 +00:00
qemu: block: Add function to check if storage source allows concurrent access
Storage source format backing a shared device (e.g. running a cluster filesystem) needs to support the sharing so that metadata are not corrupted. Add a central function for checking this.
This commit is contained in:
parent
85b0e2f126
commit
1fc3cd8731
@ -390,6 +390,21 @@ qemuBlockGetNodeData(virJSONValuePtr data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemuBlockStorageSourceSupportsConcurrentAccess:
|
||||||
|
* @src: disk storage source
|
||||||
|
*
|
||||||
|
* Returns true if the given storage format supports concurrent access from two
|
||||||
|
* separate processes.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src)
|
||||||
|
{
|
||||||
|
/* no need to check in backing chain since only RAW storage supports this */
|
||||||
|
return src->format == VIR_STORAGE_FILE_RAW;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuBlockStorageSourceGetURI:
|
* qemuBlockStorageSourceGetURI:
|
||||||
* @src: disk storage source
|
* @src: disk storage source
|
||||||
|
@ -54,6 +54,9 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver,
|
|||||||
virHashTablePtr
|
virHashTablePtr
|
||||||
qemuBlockGetNodeData(virJSONValuePtr data);
|
qemuBlockGetNodeData(virJSONValuePtr data);
|
||||||
|
|
||||||
|
bool
|
||||||
|
qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src);
|
||||||
|
|
||||||
virJSONValuePtr
|
virJSONValuePtr
|
||||||
qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src);
|
qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user