Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
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