[libvirt] [PATCH 12/34] conf: Add possibility to format full chain with virDomainStorageSourceFormatFull

Ján Tomko jtomko at redhat.com
Tue Mar 19 09:21:19 UTC 2019


On Mon, Mar 18, 2019 at 04:55:01PM +0100, Peter Krempa wrote:
>Add switch which will allow formating full chain.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/conf/domain_conf.c | 11 ++++++++++-
> src/conf/domain_conf.h |  1 +
> src/qemu/qemu_domain.c |  2 +-
> 3 files changed, 12 insertions(+), 2 deletions(-)
>
>diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
>index b67f9bbd2c..fb98629c77 100644
>--- a/src/conf/domain_conf.c
>+++ b/src/conf/domain_conf.c
>@@ -23910,6 +23910,7 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf,
>  * @src: storage source to format
>  * @elemname: name of the top level element to use
>  * @status: output status-XML style private data
>+ * @backingStore: output full backing chain of @src
>  * @xmlopt: formatter callback data structure
>  *
>  * Formats @src into a XML element called @elemname. The element has both 'type'
>@@ -23920,6 +23921,7 @@ virDomainStorageSourceFormatFull(virBufferPtr buf,
>                                  virStorageSourcePtr src,
>                                  const char *elemname,
>                                  bool status,
>+                                 bool backingStore,
>                                  virDomainXMLOptionPtr xmlopt)
> {
>     VIR_AUTOCLEAN(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
>@@ -23939,7 +23941,14 @@ virDomainStorageSourceFormatFull(virBufferPtr buf,
>                                      true, true, 0, xmlopt) < 0)
>         return -1;
>
>-    return virXMLFormatElement(buf, elemname, &attrBuf, &childBuf);
>+    if (virXMLFormatElement(buf, elemname, &attrBuf, &childBuf) < 0)
>+        return -1;
>+
>+    if (backingStore && src->backingStore &&

Same commend about the condition.

>+        virDomainDiskBackingStoreFormat(buf, src->backingStore, xmlopt, flags) < 0)
>+        return -1;
>+
>+    return 0;

Reviewed-by: Ján Tomko <jtomko at redhat.com>

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


More information about the libvir-list mailing list