On 1/9/20 9:00 AM, Han Han wrote:
The 'builtin' rng backend model can be used as following:
<rng model='virtio'>
<backend model='builtin'/>
</rng>
Signed-off-by: Han Han <hhan@xxxxxxxxxx>
---
docs/formatdomain.html.in | 10 ++++++++++
docs/formatdomaincaps.html.in | 1 +
docs/schemas/domaincommon.rng | 6 ++++++
src/conf/domain_audit.c | 2 ++
src/conf/domain_conf.c | 9 +++++++++
src/conf/domain_conf.h | 1 +
6 files changed, 29 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 3040448df1..9621b5f120 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -8257,6 +8257,8 @@ qemu-kvm -net nic,model=? /dev/null
<source mode='bind' service='1234'/>
<source mode='connect' host='1.2.3.4' service='1234'/>
</backend>
+ <!-- OR -->
+ <backend model='builtin'/>
</rng>
</devices>
...
@@ -8321,6 +8323,14 @@ qemu-kvm -net nic,model=? /dev/null
for more information.
</p>
</dd>
+ <dt><code>builtin</code></dt>
+ <dd>
+ <p>
+ This backend uses qemu builtin random generator, which uses
+ getrandom() syscall to generate random.
+ (<span class="since">Since 6.0.0 and QEMU 4.2</span>)
I'm rewording this a bit. Also, sorry for missing this in 6.0.0.
+ </p>
+ </dd>
</dl>
</dd>
<dt><code>driver</code></dt>
diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
index 6bf7a1c17a..aa4dece220 100644
--- a/docs/formatdomaincaps.html.in
+++ b/docs/formatdomaincaps.html.in
@@ -481,6 +481,7 @@
<enum name='backendModel'>
<value>random</value>
<value>egd</value>
+ <value>builtin</value>
</enum>
</rng>
...
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 9b555d6acb..bbcf6ce896 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5681,6 +5681,12 @@
<ref name="qemucdevSrcType"/>
<ref name="qemucdevSrcDef"/>
</group>
+ <group>
+ <attribute name="model">
+ <value>builtin</value>
+ </attribute>
+ <empty/>
+ </group>
</choice>
</element>
</define>
diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c
index fdccc585fb..138f270129 100644
--- a/src/conf/domain_audit.c
+++ b/src/conf/domain_audit.c
@@ -227,6 +227,7 @@ virDomainAuditRNG(virDomainObjPtr vm,
newsrcpath = virDomainChrSourceDefGetPath(newDef->source.chardev);
break;
+ case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
case VIR_DOMAIN_RNG_BACKEND_LAST:
break;
}
There are more places that need this case. I'll fix it before pushing.
Michal