From 8885cd9a76ec3f67433cc7f0eedec07de4737fad Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 5 Jan 2022 16:37:51 +0100 Subject: [PATCH] qemu: Only probe KVM on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We already know it's not going to be available on other platforms. Suggested-by: Daniel P. Berrangé Signed-off-by: Andrea Bolognani Tested-by: Brad Laue Tested-by: Christophe Fergeau Reviewed-by: Ani Sinha Reviewed-by: Daniel P. Berrangé --- src/qemu/qemu_process.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 336f0bab2e..82cf6bbfd8 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -9239,6 +9239,12 @@ qemuProcessQMPInit(qemuProcessQMP *proc) } +#if defined(__linux__) +# define hwaccel "kvm:tcg" +#else +# define hwaccel "tcg" +#endif + static int qemuProcessQMPLaunch(qemuProcessQMP *proc) { @@ -9249,7 +9255,7 @@ qemuProcessQMPLaunch(qemuProcessQMP *proc) if (proc->forceTCG) machine = "none,accel=tcg"; else - machine = "none,accel=kvm:tcg"; + machine = "none,accel=" hwaccel; VIR_DEBUG("Try to probe capabilities of '%s' via QMP, machine %s", proc->binary, machine);