]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Adds spice config param
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 30 Dec 2017 21:32:05 +0000 (19:32 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 30 Dec 2017 21:32:05 +0000 (19:32 -0200)
kvmx
kvmxfile

diff --git a/kvmx b/kvmx
index 242a3ff5694decff6f41d77e05f4721b49c102b7..43c132ac9dc210cff8deabd16d190d70d64411fc 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -383,14 +383,18 @@ function kvmx_up {
     net_opts="tap,ifname=$tap,script=no,downscript=no,vlan=0,name=hostnet0 -device virtio-net-pci,vlan=0,id=net0,mac=$mac_address,bus=pci.0"
   fi
 
+  if [ -z "$spice" ] || [ "$spice" == "1" ]; then
+    spice_opts"-spice port=$PORT,addr=127.0.0.1,disable-ticketing,streaming-video=off,jpeg-wan-compression=never,playback-compression=off,zlib-glz-wan-compression=never,image-compression=off"
+    spice_opts"$spice_opts -device virtio-serial-pci"
+    spice_opts"$spice_opts -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0"
+    spice_opts"$spice_opts -chardev spicevmc,id=spicechannel0,name=vdagent"
+  fi
+
   # Run virtual machine
   # See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
   nohup kvm -m $memory -name $VM \
       -drive file=$image,if=$drive_interface $graphics $shared \
-      -spice port=$PORT,addr=127.0.0.1,disable-ticketing,streaming-video=off,jpeg-wan-compression=never,playback-compression=off,zlib-glz-wan-compression=never,image-compression=off \
-      -device virtio-serial-pci \
-      -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 \
-      -chardev spicevmc,id=spicechannel0,name=vdagent \
+      $spice \
       -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \
       -chardev "socket,id=serial0,path=$CONSOLEFILE,server" -device isa-serial,chardev=serial0 \
       -smp $smp -soundhw ac97 -cpu host -balloon virtio \
index a7971f227cfe6f7435c01d0c9545a75567853abb..66e19a96ae5be061a175f33ab8fd0b6883dc613b 100644 (file)
--- a/kvmxfile
+++ b/kvmxfile
@@ -64,6 +64,9 @@ graphics="-vga qxl"
 #vnc_client="xvncviewer"
 vnc_client="virt-viewer"
 
+# SPICE support
+spice="1"
+
 # Set this if you want to attach an spice client when the machine boots.
 run_spice_client="1"