1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

conf: Fix formatting of <sev> element in domain capabilities XML

We only formatted the <sev> element when QEMU supported the feature when
in fact we should always format the element to make clear that libvirt
knows about the feature and the fact whether it is or isn't supported
depends on QEMU version, in other words if QEMU doesn't support the
feature we're going to format the following into the domain capabilities
XML:

<sev supported='no'/>

This patch also adjusts the RNG schema accordingly in order to reflect
the proposed change.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Erik Skultety 2018-06-14 14:18:30 +02:00
parent dd72601d42
commit 6688393c6b
27 changed files with 47 additions and 17 deletions

View File

@ -185,9 +185,7 @@
<ref name='gic'/>
<ref name='vmcoreinfo'/>
<ref name='vmgenid'/>
<optional>
<ref name='sev'/>
</optional>
</interleave>
</element>
</define>
@ -213,12 +211,15 @@
<define name='sev'>
<element name='sev'>
<ref name='supported'/>
<optional>
<element name='cbitpos'>
<data type='unsignedInt'/>
</element>
<element name='reducedPhysBits'>
<data type='unsignedInt'/>
</element>
</optional>
</element>
</define>

View File

@ -559,9 +559,10 @@ static void
virDomainCapsFeatureSEVFormat(virBufferPtr buf,
virSEVCapabilityPtr const sev)
{
if (!sev)
return;
if (!sev) {
virBufferAddLit(buf, "<sev supported='no'/>\n");
} else {
virBufferAddLit(buf, "<sev supported='yes'>\n");
virBufferAdjustIndent(buf, 2);
virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
@ -571,6 +572,9 @@ virDomainCapsFeatureSEVFormat(virBufferPtr buf,
virBufferAddLit(buf, "</sev>\n");
}
return;
}
char *
virDomainCapsFormat(virDomainCapsPtr const caps)

View File

@ -20,5 +20,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -30,5 +30,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -47,5 +47,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -39,5 +39,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -110,5 +110,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -73,5 +73,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -72,5 +72,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -63,5 +63,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -62,5 +62,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -111,5 +111,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -118,5 +118,6 @@
</gic>
<vmcoreinfo supported='yes'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -80,5 +80,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -172,5 +172,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -142,5 +142,6 @@
<gic supported='no'/>
<vmcoreinfo supported='yes'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -115,5 +115,6 @@
</gic>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -111,5 +111,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -84,5 +84,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -116,5 +116,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -77,5 +77,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -117,5 +117,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -158,5 +158,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -117,5 +117,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -125,5 +125,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -149,5 +149,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>

View File

@ -126,5 +126,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>