[PATCH v3 05/15] qemuBlockStorageSourceGetFormatRawProps: format 'offset' and 'size' for slice

Ján Tomko jtomko at redhat.com
Thu Feb 13 13:45:09 UTC 2020


On Wed, Feb 12, 2020 at 07:03:16PM +0100, Peter Krempa wrote:
>If we have a 'format' type slice for a raw driver we can directly format
>the values.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_block.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
>diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
>index 710ddfd2cf..6ac1d34281 100644
>--- a/src/qemu/qemu_block.c
>+++ b/src/qemu/qemu_block.c
>@@ -1194,16 +1194,21 @@ qemuBlockStorageSourceGetFormatRawProps(virStorageSourcePtr src,
>         secretalias = srcPriv->encinfo->s.aes.alias;
>     }
>
>-    /* currently unhandled properties for the 'raw' driver:
>-     * 'offset'
>-     * 'size'
>-     */
>-
>     if (virJSONValueObjectAdd(props,
>                               "s:driver", driver,
>                               "S:key-secret", secretalias, NULL) < 0)
>         return -1;
>
>+    /* Currently only storage slices are supported. We'll have to calculate
>+     * the union of the slices here if we don't want to be adding needless
>+     * 'raw' nodes. */
>+    if (src->sliceStorage &&
>+        virJSONValueObjectAdd(props,
>+                              "p:offset", src->sliceStorage->offset,
>+                              "p:size", src->sliceStorage->size,

https://www.redhat.com/archives/libvir-list/2020-February/msg00293.html

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200213/1b93af36/attachment-0001.sig>


More information about the libvir-list mailing list