mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-13 08:58:33 +03:00
qemu: block: Rename qemuBlockStorageSourceGetBlockdevProps
Use qemuBlockStorageSourceGetFormatProps as it formats the properties of the 'format' driver in qemu. Adjust the comment which was hinting otherwise. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d354750521
commit
2568e9d29e
@ -1295,18 +1295,17 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSource *src)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qemuBlockStorageSourceGetBlockdevProps:
|
* qemuBlockStorageSourceGetFormatProps:
|
||||||
*
|
*
|
||||||
* @src: storage source to format
|
* @src: storage source to format
|
||||||
* @backingStore: a storage source to use as backing of @src
|
* @backingStore: a storage source to use as backing of @src
|
||||||
*
|
*
|
||||||
* Formats @src into a JSON object which can be used with blockdev-add or
|
* Formats properties of @src related to the format blockdev driver in qemu
|
||||||
* -blockdev. The formatted object contains both the storage and format layer
|
* into a JSON object which can be used with blockdev-add or -blockdev.
|
||||||
* in nested form including link to the backing chain layer if necessary.
|
|
||||||
*/
|
*/
|
||||||
virJSONValue *
|
virJSONValue *
|
||||||
qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src,
|
qemuBlockStorageSourceGetFormatProps(virStorageSource *src,
|
||||||
virStorageSource *backingStore)
|
virStorageSource *backingStore)
|
||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) props = NULL;
|
g_autoptr(virJSONValue) props = NULL;
|
||||||
const char *backingFormatterStr = NULL;
|
const char *backingFormatterStr = NULL;
|
||||||
@ -1434,8 +1433,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src,
|
|||||||
|
|
||||||
data = g_new0(qemuBlockStorageSourceAttachData, 1);
|
data = g_new0(qemuBlockStorageSourceAttachData, 1);
|
||||||
|
|
||||||
if (!(data->formatProps = qemuBlockStorageSourceGetBlockdevProps(src,
|
if (!(data->formatProps = qemuBlockStorageSourceGetFormatProps(src, backingStore)) ||
|
||||||
backingStore)) ||
|
|
||||||
!(data->storageProps = qemuBlockStorageSourceGetBackendProps(src,
|
!(data->storageProps = qemuBlockStorageSourceGetBackendProps(src,
|
||||||
backendpropsflags)))
|
backendpropsflags)))
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -3049,7 +3047,7 @@ qemuBlockReopenFormatMon(qemuMonitor *mon,
|
|||||||
g_autoptr(virJSONValue) srcprops = NULL;
|
g_autoptr(virJSONValue) srcprops = NULL;
|
||||||
g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray();
|
g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray();
|
||||||
|
|
||||||
if (!(srcprops = qemuBlockStorageSourceGetBlockdevProps(src, src->backingStore)))
|
if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)
|
if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)
|
||||||
|
@ -57,8 +57,8 @@ virURI *
|
|||||||
qemuBlockStorageSourceGetURI(virStorageSource *src);
|
qemuBlockStorageSourceGetURI(virStorageSource *src);
|
||||||
|
|
||||||
virJSONValue *
|
virJSONValue *
|
||||||
qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src,
|
qemuBlockStorageSourceGetFormatProps(virStorageSource *src,
|
||||||
virStorageSource *backingStore);
|
virStorageSource *backingStore);
|
||||||
|
|
||||||
virJSONValue *
|
virJSONValue *
|
||||||
qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk);
|
qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk);
|
||||||
|
@ -301,7 +301,7 @@ testQemuDiskXMLToProps(const void *opaque)
|
|||||||
|
|
||||||
qemuDomainPrepareDiskSourceData(disk, n);
|
qemuDomainPrepareDiskSourceData(disk, n);
|
||||||
|
|
||||||
if (!(formatProps = qemuBlockStorageSourceGetBlockdevProps(n, n->backingStore)) ||
|
if (!(formatProps = qemuBlockStorageSourceGetFormatProps(n, n->backingStore)) ||
|
||||||
!(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, backendpropsflagstarget)) ||
|
!(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, backendpropsflagstarget)) ||
|
||||||
!(storageProps = qemuBlockStorageSourceGetBackendProps(n, backendpropsflagsnormal)) ||
|
!(storageProps = qemuBlockStorageSourceGetBackendProps(n, backendpropsflagsnormal)) ||
|
||||||
!(backingstore = qemuBlockGetBackingStoreString(n, true))) {
|
!(backingstore = qemuBlockGetBackingStoreString(n, true))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user