Permalink
Browse files

qinit: call exec for qemu-kvm

  • Loading branch information...
1 parent ca81781 commit f774edce28ee20dfdc99d72f15a5fcd265d0532d @falconindy committed May 22, 2011
Showing with 9 additions and 2 deletions.
  1. +9 −2 qinit
View
@@ -24,12 +24,19 @@ declare -r machines=$XDG_CONFIG_HOME/qemu/machines
### Defaults #############################
declare mem="-m 1024"
declare cpus="-smp 4"
-declare net="-net nic,model=virtio -net vde"
+declare net="-net vde -net nic,model=virtio"
### Launcher #############################
. "$machines"
+while getopts 'c' flag; do
+ case $flag in
+ c) usecdrom=true ;;
+ esac
+done
+shift $(( OPTIND - 1 ))
+
if [[ -z $1 ]]; then
printf 'Available VMs:\n'
printf ' %s\n' $(sed -n 's/^vm_\([^(;$]\+\).*/\1/p' "$machines")
@@ -43,5 +50,5 @@ fi
vm_$1; shift
-qemu-kvm "${opts[@]}" $cpus $mem ${drives[*]} $net $cdrom "$@"
+exec qemu-kvm "${opts[@]}" $cpus $mem ${drives[@]} $net ${usecdrom:+$cdrom} "$@"

0 comments on commit f774edc

Please sign in to comment.