From f34f73622d0feab451dd22d7ca38c8fac8587c22 Mon Sep 17 00:00:00 2001 From: Han Han Date: Sun, 19 Apr 2020 21:39:02 +0800 Subject: [PATCH] rng: add builtin rng backend model The builtin rng backend uses getrandom syscall to generate random, no external rng source needed, introduced from libvirt v6.1.0. Reviewed-by: Cole Robinson Signed-off-by: Han Han --- man/virt-install.pod | 8 +++++++- virtManager/addhardware.py | 2 ++ virtinst/devices/rng.py | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/man/virt-install.pod b/man/virt-install.pod index 12840253..69b49c4b 100644 --- a/man/virt-install.pod +++ b/man/virt-install.pod @@ -1722,7 +1722,7 @@ Use --tpm=? to see a list of all available sub options. Complete details at L or B. +Type can be B, B or B. If the specified type is B then these values must be specified: @@ -1768,6 +1768,8 @@ B and backend_mode is B. =back +If the specified type is B, B is not required. + An example invocation: =over 4 @@ -1781,6 +1783,10 @@ Connect to localhost to the TCP port 8000 to get entropy data. Use the /dev/random device to get entropy data, this form implicitly uses the "random" model. +=item B<--rng builtin> + +Use the builtin rng device to get entropy data. + Use --rng=? to see a list of all available sub options. Complete details at L =back diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py index 25eedb02..492402cc 100644 --- a/virtManager/addhardware.py +++ b/virtManager/addhardware.py @@ -573,6 +573,8 @@ class vmmAddHardware(vmmGObjectUI): return _("Random") if rng_type == DeviceRng.TYPE_EGD: return _("Entropy Gathering Daemon") + if rng_type == DeviceRng.TYPE_BUILTIN: + return _("Builtin RNG") return rng_type @staticmethod diff --git a/virtinst/devices/rng.py b/virtinst/devices/rng.py index 82e31ba3..777c3dd6 100644 --- a/virtinst/devices/rng.py +++ b/virtinst/devices/rng.py @@ -14,6 +14,7 @@ class DeviceRng(Device): TYPE_RANDOM = "random" TYPE_EGD = "egd" + TYPE_BUILTIN = "builtin" model = XMLProperty("./@model")