[PATCH 3/8] conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_capabilities.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 2c1c5fc9e8..d9a9093f89 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -604,16 +604,14 @@ static void
 virDomainCapsFormatFeatures(const virDomainCaps *caps,
                             virBufferPtr buf)
 {
-    virBufferAddLit(buf, "<features>\n");
-    virBufferAdjustIndent(buf, 2);
+    g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);

-    virDomainCapsFeatureGICFormat(buf, &caps->gic);
-    qemuDomainCapsFeatureFormatSimple(buf, "vmcoreinfo", caps->vmcoreinfo);
-    qemuDomainCapsFeatureFormatSimple(buf, "genid", caps->genid);
-    virDomainCapsFeatureSEVFormat(buf, caps->sev);
+    virDomainCapsFeatureGICFormat(&childBuf, &caps->gic);
+    qemuDomainCapsFeatureFormatSimple(&childBuf, "vmcoreinfo", caps->vmcoreinfo);
+    qemuDomainCapsFeatureFormatSimple(&childBuf, "genid", caps->genid);
+    virDomainCapsFeatureSEVFormat(&childBuf, caps->sev);

-    virBufferAdjustIndent(buf, -2);
-    virBufferAddLit(buf, "</features>\n");
+    virXMLFormatElement(buf, "features", NULL, &childBuf);
 }


-- 
2.23.0

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