]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Adds memory, smp and qemu_opts params
authorSilvio Rhatto <rhatto@riseup.net>
Fri, 26 May 2017 13:05:10 +0000 (10:05 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Fri, 26 May 2017 13:05:10 +0000 (10:05 -0300)
README.md
kvmx

index d51389b60b6cbeb10ef578f94a86b2e8f17c0169..25df4f0151ee1cb0512934735985560f581fdae5 100644 (file)
--- a/README.md
+++ b/README.md
@@ -58,7 +58,6 @@ If no folder is specified, the current folder is assumed as the project home.
 * Alternative folder sharing support (NFS, SMB or even [via SSH](https://superuser.com/questions/831659/mount-a-local-directory-to-a-remote-ssh-server)).
 * Remount 9p shared folders and reinitialize spice-vdagent upon resume from disk [see possible bug](https://bugzilla.redhat.com/show_bug.cgi?id=1333072).
 * [Nested virtualization](http://www.rdoxenham.com/?p=275).
-* More params (memory, cpus, ssh, serial console, additional shared folders, etc).
 * Integration with [image-bootstrap](https://github.com/hartwork/image-bootstrap).
 * Systemd service.
 * Shell completions.
diff --git a/kvmx b/kvmx
index b36e83498f4947162d1b818df4284b14f5c29a74..86d48977a4d2fd29ba0436f7100fac1157ca4422 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -308,16 +308,24 @@ function kvmx_up {
     graphics="-vga qxl"
   fi
 
+  if [ -z "$memory" ]; then
+    memory="2048"
+  fi
+
+  if [ -z "$smp" ]; then
+    smp="2"
+  fi
+
   # Run virtual machine
   # See https://en.wikipedia.org/wiki/Nohup#Overcoming_hanging
-  nohup kvm -m 2048 -name $VM -drive file=$image,if=virtio $graphics $shared \
+  nohup kvm -m $memory -name $VM -drive file=$image,if=virtio $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 \
-      -smp 2 -soundhw ac97 -cpu host -balloon virtio  \
+      -smp $smp -soundhw ac97 -cpu host -balloon virtio  \
       -net nic,model=virtio \
-      -net user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd &> $LOGFILE < /dev/null &
+      -net user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd $qemu_opts &> $LOGFILE < /dev/null &
 
   PID="$!"