From c3911a29b358e7f98b4b4ba659cb385c6fb5e5db Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: May 19 2016 22:15:26 +0000 Subject: qemu-kvm: Don't try to init KVM during libvirt introspection If it's disabled on the host, libvirt logs a ton of errors to syslog. --- diff --git a/qemu-kvm.sh b/qemu-kvm.sh index 08da00b..87cf89c 100644 --- a/qemu-kvm.sh +++ b/qemu-kvm.sh @@ -1,3 +1,10 @@ #!/bin/sh -exec /usr/bin/qemu-system-x86_64 -machine accel=kvm "$@" +# Libvirt introspects the binary using -M none. In that case, don't try +# to init KVM, which will fail and be noisy if the host has kvm disabled +opts="-machine accel=kvm" +if echo "$@" | grep -q " -M none "; then + opts= +fi + +exec /usr/bin/qemu-system-x86_64 $opts "$@"