[PATCH v2 1/4] qemu_command: Don't validate accelerator when building cmd line

Michal Privoznik mprivozn at redhat.com
Fri Nov 5 09:35:17 UTC 2021


The domain accelerator was validated in qemuValidateDomainDef()
which calls virQEMUCapsIsVirtTypeSupported() which reports proper
error if QEMU is not capable of KVM/TCG. There is no point in
doing the validation again when building command line.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_command.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 483041f584..cd133cc86c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7061,15 +7061,8 @@ qemuBuildMachineCommandLine(virCommand *cmd,
     case VIR_DOMAIN_VIRT_BHYVE:
     case VIR_DOMAIN_VIRT_VZ:
     case VIR_DOMAIN_VIRT_NONE:
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("the QEMU binary does not support %s"),
-                       virDomainVirtTypeToString(def->virtType));
-        return -1;
-
     case VIR_DOMAIN_VIRT_LAST:
-    default:
-        virReportEnumRangeError(virDomainVirtType, def->virtType);
-        return -1;
+        break;
     }
 
     /* To avoid the collision of creating USB controllers when calling
-- 
2.32.0




More information about the libvir-list mailing list