#!/usr/bin/env fish for opt in $_vm_args switch "$opt" case "" case -i --install set _use_install 1 case \* echo "error: unknown option $opt" exit 1 end end set vga vmware set soundhw hda set boot_order c test "$_vga" and set vga $_vga test "$_soundhw" and set soundhw $_soundhw set _args \ --display sdl,gl=on \ $_args if test $_arch = "i386" || test $_arch = "x86_64" set _args \ --machine accel=kvm \ --usb \ $_args end if test $_use_install set boot_order d set _args \ --drive file="$_install",media=cdrom,readonly \ $_args end if test $_boot set boot_order a set _args \ --drive file="$_boot",format=raw,if=floppy,readonly \ $_args end env QEMU_AUDIO_DRV=pa "qemu-system-$_arch" \ --drive file="$_vm_img",format=qcow2,media=disk \ --boot order="$boot_order" \ -m "$_mem" \ --soundhw "$soundhw" \ --vga "$vga" \ $_args ## EOF