]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Adds virtio_rng config
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 16 May 2020 15:52:04 +0000 (12:52 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 16 May 2020 15:52:04 +0000 (12:52 -0300)
kvmx
kvmxfile

diff --git a/kvmx b/kvmx
index eb1ee5b8326f676b5dd423730f46360797caf0a5..4995a033fa909d79f1b715f907611f3a138bc20b 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -530,6 +530,12 @@ function kvmx_up {
     image_opts="-drive file=$image,if=$drive_interface"
   fi
 
+  if [ ! -z "$virtio_rng" ]; then
+    rng_opts="-device virtio-rng-pci,$virtio_rng"
+  else
+    rng_opts="-device virtio-rng-pci,max-bytes=128,period=1000"
+  fi
+
   # USB redirect support
   # See https://people.freedesktop.org/~teuf/spice-doc/html/ch02s06.html
   #usb_opts="-device ich9-usb-ehci1,id=usb"
@@ -557,6 +563,7 @@ function kvmx_up {
   #  $cdrom_opts                                                                                     \
   #  $boot_opts                                                                                      \
   #  $net_opts                                                                                       \
+  #  $rng_opts                                                                                       \
   #  $qemu_opts &> $LOGFILE < /dev/null &
 
   # Run virtual machine, screen approach
@@ -573,6 +580,7 @@ function kvmx_up {
     $cdrom_opts                                                                                     \
     $boot_opts                                                                                      \
     $net_opts                                                                                       \
+    $rng_opts                                                                                       \
     -pidfile $PIDFILE                                                                               \
     -D $LOGFILE                                                                                     \
     $qemu_opts
index 860dfe3b33f06ab9d05fbcb5584b466ab2d58072..eb801775e312a29c864ea25c77a5e75e5531b3b8 100644 (file)
--- a/kvmxfile
+++ b/kvmxfile
@@ -214,3 +214,7 @@ bootloader="grub"
 
 # Whether to be managed by kvmx-supervise
 #supervise_manage="1"
+
+# VirtIO RNG parameters
+# See https://wiki.qemu.org/Features/VirtIORNG
+#virtio_rng="max-bytes=128,period=1000"