From 48b12bda534020898c80553a610796a3b6a33a0d Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 30 Dec 2017 20:07:42 -0200 Subject: Adds sound option --- kvmx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'kvmx') 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 & -- cgit v1.2.3