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.
This commit is contained in:
Cole Robinson 2016-05-19 18:15:26 -04:00
parent 837eb7efa2
commit c3911a29b3
1 changed files with 8 additions and 1 deletions

View File

@ -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 "$@"