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

Michal Privoznik posted 4 patches 4 years, 3 months ago
There is a newer version of this series
[PATCH v2 1/4] qemu_command: Don't validate accelerator when building cmd line
Posted by Michal Privoznik 4 years, 3 months ago
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@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

Re: [PATCH v2 1/4] qemu_command: Don't validate accelerator when building cmd line
Posted by Peter Krempa 4 years, 2 months ago
On Fri, Nov 05, 2021 at 10:35:17 +0100, Michal Privoznik wrote:
> 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@redhat.com>
> ---
>  src/qemu/qemu_command.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>