conf: domaincaps: Use virXMLFormatElement in virDomainCapsFormatFeatures

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-10-30 15:01:07 +01:00
parent 8bc9131b1a
commit f2316d8d26
1 changed files with 6 additions and 8 deletions

View 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);
}