On Fri, Oct 09, 2020 at 04:13:41PM +0200, Erik Skultety wrote:
These XML attributes have been mandatory since the introduction of
SEV
support to libvirt. This design decision was based on QEMU's
requirement for these to be mandatory for migration purposes, as
differences in these values across platforms must result in the
pre-migration checks failing (not that migration with SEV works at the
time of this patch).
Expecting the user to specify these is cumbersome and the same XML
cannot be re-used across different revisions of SEV. Since
we have SEV platform information saved in QEMU capabilities, we can
make the attributes optional and should fill them in automatically
in the QEMU driver right before starting it.
Resolves:
https://gitlab.com/libvirt/libvirt/-/issues/57
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
When I was shuffling the patches I forgot to update this one to reflect the
change below. Consider the following squashed in:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 648a47ac84..e27c6cead8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -16792,7 +16792,7 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
*/
rc = virXPathUInt("string(./cbitpos)", ctxt, &def->cbitpos);
if (rc == 0) {
- def->haveCbitpos = VIR_TRISTATE_BOOL_YES;
+ def->haveCbitpos = true;
} else if (rc == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Invalid format for launch security cbitpos"));
@@ -16802,7 +16802,7 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
rc = virXPathUInt("string(./reducedPhysBits)", ctxt,
&def->reduced_phys_bits);
if (rc == 0) {
- def->haveReducedPhysBits = VIR_TRISTATE_BOOL_YES;
+ def->haveReducedPhysBits = true;
} else if (rc == -2) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Invalid format for launch security "