mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
conf: domaincaps: Extract formatting of the <features> subelement
Extract it to virDomainCapsFormatFeatures so that the main function does not get so bloated over time. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
c4940317ef
commit
8bc9131b1a
@ -593,6 +593,23 @@ virDomainCapsFeatureSEVFormat(virBufferPtr buf,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virDomainCapsFormatFeatures(const virDomainCaps *caps,
|
||||
virBufferPtr buf)
|
||||
{
|
||||
virBufferAddLit(buf, "<features>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
|
||||
virDomainCapsFeatureGICFormat(buf, &caps->gic);
|
||||
qemuDomainCapsFeatureFormatSimple(buf, "vmcoreinfo", caps->vmcoreinfo);
|
||||
qemuDomainCapsFeatureFormatSimple(buf, "genid", caps->genid);
|
||||
virDomainCapsFeatureSEVFormat(buf, caps->sev);
|
||||
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</features>\n");
|
||||
}
|
||||
|
||||
|
||||
char *
|
||||
virDomainCapsFormat(const virDomainCaps *caps)
|
||||
{
|
||||
@ -629,16 +646,7 @@ virDomainCapsFormat(const virDomainCaps *caps)
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</devices>\n");
|
||||
|
||||
virBufferAddLit(&buf, "<features>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
|
||||
virDomainCapsFeatureGICFormat(&buf, &caps->gic);
|
||||
qemuDomainCapsFeatureFormatSimple(&buf, "vmcoreinfo", caps->vmcoreinfo);
|
||||
qemuDomainCapsFeatureFormatSimple(&buf, "genid", caps->genid);
|
||||
virDomainCapsFeatureSEVFormat(&buf, caps->sev);
|
||||
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</features>\n");
|
||||
virDomainCapsFormatFeatures(caps, &buf);
|
||||
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</domainCapabilities>\n");
|
||||
|
Loading…
Reference in New Issue
Block a user