From: Peter Krempa Date: Wed, 30 Oct 2019 14:01:07 +0000 (+0100) Subject: conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f2316d8d267d986947d97713d4e3e8152116ad92;p=libvirt.git conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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); }