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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
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@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux