mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: block: Introduce helper for deciding when a 'format' layer is needed
The 'format' layer is not required in certain cases. As the logic for this will be a bit more involved create a helper function to do the decision. For now we'll keep to always format the 'format' -blockdev layer. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
aaf828d3d4
commit
7f19a55a9e
@ -3291,6 +3291,25 @@ qemuBlockStorageSourceNeedsStorageSliceLayer(const virStorageSource *src)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qemuBlockStorageSourceNeedsFormatLayer:
|
||||||
|
* @src: storage source
|
||||||
|
*
|
||||||
|
* Returns true if configuration of @src requires a 'format' layer -blockdev.
|
||||||
|
*
|
||||||
|
* Important: This helper must be used only for decisions when setting up a
|
||||||
|
* '-blockdev' backend in which case the format layer node name will be populated.
|
||||||
|
* Any cases when the backend can be already in use must decide based on the
|
||||||
|
* existence of the format layer nodename.
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
qemuBlockStorageSourceNeedsFormatLayer(const virStorageSource *src G_GNUC_UNUSED)
|
||||||
|
{
|
||||||
|
/* Currently we always create a 'format' layer */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuBlockStorageSourceGetCookieString:
|
* qemuBlockStorageSourceGetCookieString:
|
||||||
* @src: storage source
|
* @src: storage source
|
||||||
|
@ -280,6 +280,9 @@ qemuBlockReopenReadOnly(virDomainObj *vm,
|
|||||||
bool
|
bool
|
||||||
qemuBlockStorageSourceNeedsStorageSliceLayer(const virStorageSource *src);
|
qemuBlockStorageSourceNeedsStorageSliceLayer(const virStorageSource *src);
|
||||||
|
|
||||||
|
bool
|
||||||
|
qemuBlockStorageSourceNeedsFormatLayer(const virStorageSource *src);
|
||||||
|
|
||||||
char *
|
char *
|
||||||
qemuBlockStorageSourceGetCookieString(virStorageSource *src);
|
qemuBlockStorageSourceGetCookieString(virStorageSource *src);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user