]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures
authorPeter Krempa <pkrempa@redhat.com>
Wed, 30 Oct 2019 14:01:07 +0000 (15:01 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 14 Nov 2019 14:50:43 +0000 (15:50 +0100)
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_capabilities.c

index 6fa2e71afbf6cca91c64a6ae792bb5c2c7543200..d13fdc0054818388b72bee2d5bd9254e48494d65 100644 (file)
@@ -597,16 +597,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);
 }