summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-02-25 13:04:19 -0800
committerBrian Dolbec <dolsen@gentoo.org>2016-02-25 13:04:19 -0800
commite113eedd01f8d113251bfdbc28a0e6009cd69bad (patch)
treeb0db98d4783f3e69d6d4e61a0cf164595d35c04a
parentAdd live-usb image example (diff)
downloadkvm-tools-e113eedd01f8d113251bfdbc28a0e6009cd69bad.tar.gz
kvm-tools-e113eedd01f8d113251bfdbc28a0e6009cd69bad.tar.bz2
kvm-tools-e113eedd01f8d113251bfdbc28a0e6009cd69bad.zip
Update the binary determination code
Make the new binary configurable. This allows multiple different vm targets using this same script.
-rw-r--r--app-emulation/qemu-init-scripts/files/qemu-conf.example12
-rw-r--r--app-emulation/qemu-init-scripts/files/qemu-init-script8
2 files changed, 16 insertions, 4 deletions
diff --git a/app-emulation/qemu-init-scripts/files/qemu-conf.example b/app-emulation/qemu-init-scripts/files/qemu-conf.example
index d3f2c77..6ccd6fc 100644
--- a/app-emulation/qemu-init-scripts/files/qemu-conf.example
+++ b/app-emulation/qemu-init-scripts/files/qemu-conf.example
@@ -3,6 +3,18 @@
# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
+# VMTYPE is auto determined via the file prefix
+# ie: kvm.myserver would yield VMTYPE=kvm
+# the two types allowed are: qemu, kvm
+
+# Machine type
+#
+# The specific qemu binary type
+# eg. for VMTYPE=kvm, then /usr/bin/qemu-system-${QEMU_TYPE}
+# eg. for VMTYPE=qemu, then /usr/bin/qemu-${QEMU_TYPE}
+# QEMU_TYPE="x86_64"
+QEMU_TYPE="x86_64"
+
## Network settings
# MAC address
diff --git a/app-emulation/qemu-init-scripts/files/qemu-init-script b/app-emulation/qemu-init-scripts/files/qemu-init-script
index 4eeb42b..ff42d78 100644
--- a/app-emulation/qemu-init-scripts/files/qemu-init-script
+++ b/app-emulation/qemu-init-scripts/files/qemu-init-script
@@ -19,17 +19,17 @@ VM_BINARY=
PIDFILE=/run/vm/${SVCNAME}.pid
MONITOR=/run/vm/${SVCNAME}.monitor
QTAP_FILE=/run/vm/${SVCNAME}.qtap
-
ENABLE_SDL=
discern_vm_binary() {
case "$VMTYPE" in
kvm)
- VM_BINARY=`type -p qemu-kvm`
- [ -z "$VM_BINARY" ] && VM_BINARY=`type -p kvm`
+ VM_BINARY=$(which "qemu-system-${QEMU_TYPE}")
+ [ -z "$VM_BINARY" ] && eerror "Failed to find the binary for qemu-system-${QEMU_TYPE}"
;;
qemu)
- VM_BINARY=`type -p qemu`
+ VM_BINARY=$(which "qemu-${QEMU_TYPE}")
+ [ -z "$VM_BINARY" ] && eerror "Failed to find the binary for qemu-${QEMU_TYPE}"
;;
*)
eerror "Failed to discern the binary for $VMTYPE"