From f2316d8d267d986947d97713d4e3e8152116ad92 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Wed, 30 Oct 2019 15:01:07 +0100 Subject: [PATCH] conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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 6fa2e71afb..d13fdc0054 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -597,16 +597,14 @@ static void virDomainCapsFormatFeatures(const virDomainCaps *caps, virBufferPtr buf) { - virBufferAddLit(buf, "\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, "\n"); + virXMLFormatElement(buf, "features", NULL, &childBuf); }