提交 6688393c 编写于 作者: E Erik Skultety

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: NErik Skultety <eskultet@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 dd72601d
......@@ -185,9 +185,7 @@
<ref name='gic'/>
<ref name='vmcoreinfo'/>
<ref name='vmgenid'/>
<optional>
<ref name='sev'/>
</optional>
<ref name='sev'/>
</interleave>
</element>
</define>
......@@ -213,12 +211,15 @@
<define name='sev'>
<element name='sev'>
<element name='cbitpos'>
<data type='unsignedInt'/>
</element>
<element name='reducedPhysBits'>
<data type='unsignedInt'/>
</element>
<ref name='supported'/>
<optional>
<element name='cbitpos'>
<data type='unsignedInt'/>
</element>
<element name='reducedPhysBits'>
<data type='unsignedInt'/>
</element>
</optional>
</element>
</define>
......
......@@ -559,16 +559,20 @@ static void
virDomainCapsFeatureSEVFormat(virBufferPtr buf,
virSEVCapabilityPtr const sev)
{
if (!sev)
return;
virBufferAddLit(buf, "<sev supported='yes'>\n");
virBufferAdjustIndent(buf, 2);
virBufferAsprintf(buf, "<cbitpos>%d</cbitpos>\n", sev->cbitpos);
virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
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);
virBufferAsprintf(buf, "<reducedPhysBits>%d</reducedPhysBits>\n",
sev->reduced_phys_bits);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</sev>\n");
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</sev>\n");
}
return;
}
......
......@@ -20,5 +20,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -30,5 +30,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -47,5 +47,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -39,5 +39,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -110,5 +110,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -73,5 +73,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -72,5 +72,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -63,5 +63,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -62,5 +62,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -111,5 +111,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -118,5 +118,6 @@
</gic>
<vmcoreinfo supported='yes'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -80,5 +80,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -172,5 +172,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -142,5 +142,6 @@
<gic supported='no'/>
<vmcoreinfo supported='yes'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -115,5 +115,6 @@
</gic>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -111,5 +111,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -84,5 +84,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -116,5 +116,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -77,5 +77,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -117,5 +117,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -158,5 +158,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -117,5 +117,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='no'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -125,5 +125,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -149,5 +149,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>
......@@ -126,5 +126,6 @@
<gic supported='no'/>
<vmcoreinfo supported='no'/>
<genid supported='yes'/>
<sev supported='no'/>
</features>
</domainCapabilities>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册