From fd8a8ee7f6f3f987ee50deb1892077dcb7971d67 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Sat, 1 Sep 2012 19:20:01 -0700 Subject: [PATCH] Look for both kvm and qemu-kvm. BUG=None TEST=manual, rename kvm to qemu-kvm, else run it on a gentoo host. Change-Id: I4971336a1be4c07fe2c8799643f52cd094d5caf1 Reviewed-on: https://gerrit.chromium.org/gerrit/32093 Tested-by: Brian Harring Reviewed-by: Mike Frysinger Commit-Ready: Brian Harring --- lib/cros_vm_lib.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/cros_vm_lib.sh b/lib/cros_vm_lib.sh index 22bc2adc5a..b27351ded3 100644 --- a/lib/cros_vm_lib.sh +++ b/lib/cros_vm_lib.sh @@ -15,6 +15,12 @@ DEFINE_string vnc "" "VNC Server to display to instead of SDL." KVM_PID_FILE=/tmp/kvm.$$.pid LIVE_VM_IMAGE= +if ! KVM_BINARY=$(which kvm 2> /dev/null); then + if ! KVM_BINARY=$(which qemu-kvm 2> /dev/null); then + die "no kvm binary found" + fi +fi + get_pid() { sudo cat "${KVM_PID_FILE}" } @@ -89,7 +95,7 @@ start_kvm() { cache_type="unsafe" fi - sudo kvm -m 2G \ + sudo "${KVM_BINARY}" -m 2G \ -smp 4 \ -vga std \ -pidfile "${KVM_PID_FILE}" \