From 1a69cdf6ac5d72c88dfe863771385441c4678b97 Mon Sep 17 00:00:00 2001 From: Alison Watson Date: Mon, 19 Aug 2019 02:08:34 -0400 Subject: [PATCH] virtual-machines: add some more configuration for qemu-setup --- virtual-machines/qemu-setup | 50 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/virtual-machines/qemu-setup b/virtual-machines/qemu-setup index e8d50e6..474076e 100755 --- a/virtual-machines/qemu-setup +++ b/virtual-machines/qemu-setup @@ -17,26 +17,28 @@ set cfg $argv set _vm_media "/mnt/s/osmedia" source $_agw_dir_rc/virtual-machines/$cfg -# Video +# Devices test "$_vga" and set vga $_vga or set vga vmware -set _args \ - --display sdl,gl=on \ - $_args - -# Sound test "$_soundhw" and set soundhw $_soundhw or set soundhw hda +for dev in $_devs + set -a _args --device $dev +end + # Machine +test "$_cpu" +and set cpu $_cpu +or set cpu host + if test "$_arch" = "i386" || test "$_arch" = "x86_64" - set _args \ + set -p _args \ --machine accel=kvm \ - --usb \ - $_args + --usb end # Versioning @@ -46,36 +48,32 @@ or set ver $_ver # Disk Media set image "/mnt/s/vm/$cfg/image$ver" +set boot_order c # Install Media set install (string replace "_ver_" "$ver" "$_install") +set boot (string replace "_ver_" "$ver" "$_boot") if test "$_flag_install" set boot_order d - set _args \ - --drive file="$install",media=cdrom,readonly \ - $_args -end + set -p _args --drive file="$install",media=cdrom,readonly -# Boot Media -if test "$_boot" - set boot_order a - set _args \ - --drive file="$_boot",format=raw,if=floppy,readonly \ - $_args -else - set boot_order c + if test "$boot" + set boot_order a + set -p _args --drive file="$boot",format=raw,if=floppy,readonly + end end # Run! env QEMU_AUDIO_DRV=pa "qemu-system-$_arch" \ - --drive file="$image",format=qcow2,media=disk \ --boot order="$boot_order" \ - -m "$_mem" \ - --soundhw "$soundhw" \ - --vga "$vga" \ - --cpu host \ + --cpu "$cpu" \ + --display sdl,gl=on \ + --drive file="$image",format=qcow2,media=disk \ --monitor stdio \ + --soundhw $soundhw \ + --vga $vga \ + -m "$_mem" \ $_args ## EOF