>From 28290b63adc7874ec4c78c8cc25996a111724abe Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones"
Date: Tue, 22 Mar 2016 14:41:13 +0000
Subject: [PATCH] domain: Allow /dev/urandom to be used as a backend source of
randomness.
Signed-off-by: Richard W.M. Jones
---
docs/formatdomain.html.in | 6 ++++--
src/conf/domain_conf.c | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 71ffe75..0a8ef5c 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -6076,7 +6076,8 @@ qemu-kvm -net nic,model=? /dev/null
model
attribute. Supported source models are:
- - 'random' — /dev/random (default) or /dev/hwrng
+
- 'random' — /dev/random (default), /dev/urandom
+ or /dev/hwrng
device as source (for now, no other sources are permitted)
- 'egd' — a EGD protocol backend
@@ -6085,7 +6086,8 @@ qemu-kvm -net nic,model=? /dev/null
This backend type expects a non-blocking character device as input.
- The only accepted paths are /dev/random and /dev/hwrng. The file
+ The only accepted paths are /dev/random, /dev/urandom and
+ /dev/hwrng. The file
name is specified as contents of the backend
element.
When no file name is specified the hypervisor default is used.
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index d5d9ff7..77c268f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11451,6 +11451,7 @@ virDomainRNGDefParseXML(xmlNodePtr node,
def->source.file = virXPathString("string(./backend)", ctxt);
if (def->source.file &&
STRNEQ(def->source.file, "/dev/random") &&
+ STRNEQ(def->source.file, "/dev/urandom") &&
STRNEQ(def->source.file, "/dev/hwrng")) {
virReportError(VIR_ERR_XML_ERROR,
_("file '%s' is not a supported random source"),
--
2.7.4