mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-31 00:45:18 +00:00
qemuBlockStorageSourceGetBlockdevStorageSliceProps: Allow turning the slice layer into effective blockdev layer
Allow using the slice layer as effective layer once we stop formatting the unnecessary 'raw' driver. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7f19a55a9e
commit
b27e8b5a0b
@ -1448,8 +1448,18 @@ qemuBlockStorageSourceGetFormatProps(virStorageSource *src,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuBlockStorageSourceGetBlockdevStorageSliceProps:
|
||||
* @src: storage source object
|
||||
* @effective: Whether this blockdev will be the 'effective' layer of @src
|
||||
*
|
||||
* Formats the JSON object representing -blockdev configuration required to
|
||||
* configure a 'slice' of @src. If @effective is true, the slice layer is the
|
||||
* topmost/effective blockdev layer of @src.
|
||||
*/
|
||||
static virJSONValue *
|
||||
qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src)
|
||||
qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src,
|
||||
bool effective)
|
||||
{
|
||||
g_autoptr(virJSONValue) props = NULL;
|
||||
|
||||
@ -1464,7 +1474,7 @@ qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src)
|
||||
if (qemuBlockStorageSourceAddBlockdevCommonProps(&props,
|
||||
src,
|
||||
src->sliceStorage->nodename,
|
||||
false) < 0)
|
||||
effective) < 0)
|
||||
return NULL;
|
||||
|
||||
return g_steal_pointer(&props);
|
||||
@ -1536,7 +1546,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src,
|
||||
data->formatNodeName = qemuBlockStorageSourceGetFormatNodename(src);
|
||||
|
||||
if ((data->storageSliceNodeName = qemuBlockStorageSourceGetSliceNodename(src))) {
|
||||
if (!(data->storageSliceProps = qemuBlockStorageSourceGetBlockdevStorageSliceProps(src)))
|
||||
if (!(data->storageSliceProps = qemuBlockStorageSourceGetBlockdevStorageSliceProps(src, false)))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user