From 9c0f21bc7e8b51d215c187cb4542f134aa1466c4 Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Fri, 10 Apr 2015 14:36:53 +0000 Subject: [PATCH] improve run_qemu to support -i and some of -b --- app-tools/rumprun | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/app-tools/rumprun b/app-tools/rumprun index f20c2e1..91c27de 100755 --- a/app-tools/rumprun +++ b/app-tools/rumprun @@ -301,10 +301,34 @@ EOM run_qemu() { + opt_interactive= + opt_drivespec= while getopts "${myoptstr}" opt; do - err qemu target does not support options yet + case "$opt" in + b) + image=$( ( IFS=, ; set -- $OPTARG ; \ + [ $# -gt 1 ] && die -b mountpoints not supported ; \ + echo $1) ) + opt_drivespec="-drive if=virtio,file=${image}" + ;; + i) + opt_interactive=1 + ;; + *) + err qemu stack like zathras: not so good + ;; + esac done - qemu-system-i386 -net none -kernel $1 + shift $((${OPTIND}-1)) + + qemucmd="qemu-system-i386 -net none -no-kvm ${opt_drivespec} -kernel $1" + if [ -n "$opt_interactive" ]; then + ${qemucmd} + else + qemucmd="${qemucmd} -display none" + ${qemucmd} 1>/dev/null 2>&1 & + echo $! + fi } if [ $# -lt 2 ]; then -- 2.39.5