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:
Peter Krempa 2023-09-12 16:43:53 +02:00
parent d354750521
commit 2568e9d29e
3 changed files with 10 additions and 12 deletions

View File

@ -1295,18 +1295,17 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSource *src)
/**
* qemuBlockStorageSourceGetBlockdevProps:
* qemuBlockStorageSourceGetFormatProps:
*
* @src: storage source to format
* @backingStore: a storage source to use as backing of @src
*
* Formats @src into a JSON object which can be used with blockdev-add or
* -blockdev. The formatted object contains both the storage and format layer
* in nested form including link to the backing chain layer if necessary.
* Formats properties of @src related to the format blockdev driver in qemu
* into a JSON object which can be used with blockdev-add or -blockdev.
*/
virJSONValue *
qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src,
virStorageSource *backingStore)
qemuBlockStorageSourceGetFormatProps(virStorageSource *src,
virStorageSource *backingStore)
{
g_autoptr(virJSONValue) props = NULL;
const char *backingFormatterStr = NULL;
@ -1434,8 +1433,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src,
data = g_new0(qemuBlockStorageSourceAttachData, 1);
if (!(data->formatProps = qemuBlockStorageSourceGetBlockdevProps(src,
backingStore)) ||
if (!(data->formatProps = qemuBlockStorageSourceGetFormatProps(src, backingStore)) ||
!(data->storageProps = qemuBlockStorageSourceGetBackendProps(src,
backendpropsflags)))
return NULL;
@ -3049,7 +3047,7 @@ qemuBlockReopenFormatMon(qemuMonitor *mon,
g_autoptr(virJSONValue) srcprops = NULL;
g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray();
if (!(srcprops = qemuBlockStorageSourceGetBlockdevProps(src, src->backingStore)))
if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore)))
return -1;
if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0)

View File

@ -57,8 +57,8 @@ virURI *
qemuBlockStorageSourceGetURI(virStorageSource *src);
virJSONValue *
qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src,
virStorageSource *backingStore);
qemuBlockStorageSourceGetFormatProps(virStorageSource *src,
virStorageSource *backingStore);
virJSONValue *
qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk);

View File

@ -301,7 +301,7 @@ testQemuDiskXMLToProps(const void *opaque)
qemuDomainPrepareDiskSourceData(disk, n);
if (!(formatProps = qemuBlockStorageSourceGetBlockdevProps(n, n->backingStore)) ||
if (!(formatProps = qemuBlockStorageSourceGetFormatProps(n, n->backingStore)) ||
!(storageSrcOnlyProps = qemuBlockStorageSourceGetBackendProps(n, backendpropsflagstarget)) ||
!(storageProps = qemuBlockStorageSourceGetBackendProps(n, backendpropsflagsnormal)) ||
!(backingstore = qemuBlockGetBackingStoreString(n, true))) {