]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix error code for SEV launchSecurity unsupported
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Fri, 16 Jul 2021 09:44:35 +0000 (11:44 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Wed, 21 Jul 2021 11:31:15 +0000 (13:31 +0200)
When SEV is not supported but specified in the domain XML by a user it
should not result in an internal error (VIR_ERR_INTERNAL_ERROR)
therefore switching to XML error (VIR_ERR_CONFIG_UNSUPPORTED).

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/qemu/qemu_validate.c

index e91158f8a6e38e6930f3ca45ae28f0acfe267725..a964c8593d7d622ff8c49c903ba021ff3d9f6fe6 100644 (file)
@@ -1218,7 +1218,7 @@ qemuValidateDomainDef(const virDomainDef *def,
         switch ((virDomainLaunchSecurity) def->sec->sectype) {
         case VIR_DOMAIN_LAUNCH_SECURITY_SEV:
             if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SEV_GUEST)) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                                _("SEV launch security is not supported with "
                                  "this QEMU binary"));
                 return -1;