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@xxxxxxxxxx> --- src/qemu/qemu_block.c | 16 +++++++--------- src/qemu/qemu_block.h | 4 ++-- tests/qemublocktest.c | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 9b6d901e8c..07bc8ede76 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -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) diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 530d88d28e..cf5eaf87f3 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -57,8 +57,8 @@ virURI * qemuBlockStorageSourceGetURI(virStorageSource *src); virJSONValue * -qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src, - virStorageSource *backingStore); +qemuBlockStorageSourceGetFormatProps(virStorageSource *src, + virStorageSource *backingStore); virJSONValue * qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk); diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 8bad69e7ac..edfe7719c8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -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))) { -- 2.41.0