aboutsummaryrefslogtreecommitdiff
path: root/kvmx
diff options
context:
space:
mode:
Diffstat (limited to 'kvmx')
-rwxr-xr-xkvmx7
1 files changed, 6 insertions, 1 deletions
diff --git a/kvmx b/kvmx
index d3d783e..b5182cb 100755
--- a/kvmx
+++ b/kvmx
@@ -390,6 +390,10 @@ function kvmx_up {
spice_opts="$spice_opts -chardev spicevmc,id=spicechannel0,name=vdagent"
fi
+ if [ -z "$sound" ] || [ "$sound" != "0" ]; then
+ sound_opts="-soundhw $sound"
+ fi
+
# Run virtual machine
# See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
nohup kvm -m $memory -name $VM \
@@ -397,7 +401,8 @@ function kvmx_up {
$spice_opts \
-chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
-chardev "socket,id=serial0,path=$CONSOLEFILE,server,nowait" -device isa-serial,chardev=serial0 \
- -smp $smp -soundhw ac97 -cpu host -balloon virtio \
+ -smp $smp -cpu host -balloon virtio \
+ $sound_opts \
-net $net_opts \
$qemu_opts &> $LOGFILE < /dev/null &