2015-05-04 22:15:01 +02:00
|
|
|
References: bnc#885308
|
|
|
|
Enhancement to add a virtio RNG device to non windows VMs.
|
2016-06-22 00:34:03 +02:00
|
|
|
Index: virt-manager-1.4.0/virtinst/guest.py
|
2014-07-24 21:44:55 +02:00
|
|
|
===================================================================
|
2016-06-22 00:34:03 +02:00
|
|
|
--- virt-manager-1.4.0.orig/virtinst/guest.py
|
|
|
|
+++ virt-manager-1.4.0/virtinst/guest.py
|
2016-09-08 18:20:24 +02:00
|
|
|
@@ -39,6 +39,7 @@ from .devicedisk import VirtualDisk
|
|
|
|
from .devicegraphics import VirtualGraphics
|
|
|
|
from .deviceinput import VirtualInputDevice
|
|
|
|
from .deviceredirdev import VirtualRedirDevice
|
2015-05-04 22:15:01 +02:00
|
|
|
+from .devicerng import VirtualRNGDevice
|
2016-09-08 18:20:24 +02:00
|
|
|
from .devicevideo import VirtualVideoDevice
|
|
|
|
from .distroinstaller import DistroInstaller
|
|
|
|
from .domainblkiotune import DomainBlkiotune
|
|
|
|
@@ -655,6 +656,15 @@ class Guest(XMLBuilder):
|
2014-07-18 01:22:14 +02:00
|
|
|
return
|
2015-05-04 22:15:01 +02:00
|
|
|
self.add_device(VirtualGraphics(self.conn))
|
2014-07-18 01:22:14 +02:00
|
|
|
|
|
|
|
+ def add_default_rng(self):
|
|
|
|
+ osvar = self._get_os_variant()
|
|
|
|
+ if not self.conn.is_qemu() or not osvar or osvar.startswith("win"):
|
|
|
|
+ return
|
2015-05-04 22:15:01 +02:00
|
|
|
+ rng_dev = VirtualRNGDevice(True)
|
|
|
|
+ rng_dev.type = VirtualRNGDevice.TYPE_RANDOM
|
2014-07-18 01:22:14 +02:00
|
|
|
+ setattr(rng_dev, "device", "/dev/random")
|
|
|
|
+ self.add_device(rng_dev)
|
|
|
|
+
|
|
|
|
def add_default_devices(self):
|
|
|
|
self.add_default_graphics()
|
|
|
|
self.add_default_video_device()
|
2016-09-08 18:20:24 +02:00
|
|
|
@@ -662,6 +672,7 @@ class Guest(XMLBuilder):
|
2014-07-18 01:22:14 +02:00
|
|
|
self.add_default_console_device()
|
|
|
|
self.add_default_usb_controller()
|
|
|
|
self.add_default_channels()
|
|
|
|
+ self.add_default_rng()
|
|
|
|
|
2015-06-08 14:36:45 +02:00
|
|
|
def _add_install_cdrom(self):
|
|
|
|
if self._install_cdrom_device:
|