qemu: Only probe KVM on Linux

We already know it's not going to be available on other
platforms.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Brad Laue <brad@brad-x.com>
Tested-by: Christophe Fergeau <cfergeau@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Andrea Bolognani 2022-01-05 16:37:51 +01:00
parent 31e937fb3b
commit 8885cd9a76

View File

@ -9239,6 +9239,12 @@ qemuProcessQMPInit(qemuProcessQMP *proc)
} }
#if defined(__linux__)
# define hwaccel "kvm:tcg"
#else
# define hwaccel "tcg"
#endif
static int static int
qemuProcessQMPLaunch(qemuProcessQMP *proc) qemuProcessQMPLaunch(qemuProcessQMP *proc)
{ {
@ -9249,7 +9255,7 @@ qemuProcessQMPLaunch(qemuProcessQMP *proc)
if (proc->forceTCG) if (proc->forceTCG)
machine = "none,accel=tcg"; machine = "none,accel=tcg";
else else
machine = "none,accel=kvm:tcg"; machine = "none,accel=" hwaccel;
VIR_DEBUG("Try to probe capabilities of '%s' via QMP, machine %s", VIR_DEBUG("Try to probe capabilities of '%s' via QMP, machine %s",
proc->binary, machine); proc->binary, machine);