Re: [PATCH v2 3/5] conf: Add rng backend model builtin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
        &lt;source mode='bind' service='1234'/&gt;
        &lt;source mode='connect' host='1.2.3.4' service='1234'/&gt;
      &lt;/backend&gt;
+    &lt;!-- OR --&gt;
+    &lt;backend model='builtin'/&gt;
    &lt;/rng&gt;
  &lt;/devices&gt;
  ...
@@ -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 @@
        &lt;enum name='backendModel'&gt;
          &lt;value&gt;random&lt;/value&gt;
          &lt;value&gt;egd&lt;/value&gt;
+        &lt;value&gt;builtin&lt;/value&gt;
        &lt;/enum&gt;
      &lt;/rng&gt;
      ...
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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux