mirror of https://gitee.com/openkylin/libvirt.git
conf: Add rng backend model builtin
The 'builtin' rng backend model can be used as following: <rng model='virtio'> <backend model='builtin'/> </rng> Signed-off-by: Han Han <hhan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1bd17918b6
commit
6a6d00e168
|
@ -8259,6 +8259,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>
|
||||
...
|
||||
|
@ -8323,6 +8325,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
|
||||
<code>getrandom()</code> syscall as the source of entropy.
|
||||
(<span class="since">Since 6.1.0 and QEMU 4.2</span>)
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><code>driver</code></dt>
|
||||
|
|
|
@ -481,6 +481,7 @@
|
|||
<enum name='backendModel'>
|
||||
<value>random</value>
|
||||
<value>egd</value>
|
||||
<value>builtin</value>
|
||||
</enum>
|
||||
</rng>
|
||||
...
|
||||
|
|
|
@ -5683,6 +5683,12 @@
|
|||
<ref name="qemucdevSrcType"/>
|
||||
<ref name="qemucdevSrcDef"/>
|
||||
</group>
|
||||
<group>
|
||||
<attribute name="model">
|
||||
<value>builtin</value>
|
||||
</attribute>
|
||||
<empty/>
|
||||
</group>
|
||||
</choice>
|
||||
</element>
|
||||
</define>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
@ -242,6 +243,7 @@ virDomainAuditRNG(virDomainObjPtr vm,
|
|||
oldsrcpath = virDomainChrSourceDefGetPath(oldDef->source.chardev);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1113,6 +1113,7 @@ VIR_ENUM_IMPL(virDomainRNGBackend,
|
|||
VIR_DOMAIN_RNG_BACKEND_LAST,
|
||||
"random",
|
||||
"egd",
|
||||
"builtin",
|
||||
);
|
||||
|
||||
VIR_ENUM_IMPL(virDomainTPMModel,
|
||||
|
@ -14792,6 +14793,7 @@ virDomainRNGDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||
goto error;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
}
|
||||
|
@ -17851,6 +17853,7 @@ virDomainRNGFind(virDomainDefPtr def,
|
|||
continue;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
}
|
||||
|
@ -26531,6 +26534,11 @@ virDomainRNGDefFormat(virBufferPtr buf,
|
|||
return -1;
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</backend>\n");
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
virBufferAddLit(buf, "/>\n");
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
|
@ -26562,6 +26570,7 @@ virDomainRNGDefFree(virDomainRNGDefPtr def)
|
|||
case VIR_DOMAIN_RNG_BACKEND_EGD:
|
||||
virObjectUnref(def->source.chardev);
|
||||
break;
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -2106,6 +2106,7 @@ typedef enum {
|
|||
typedef enum {
|
||||
VIR_DOMAIN_RNG_BACKEND_RANDOM,
|
||||
VIR_DOMAIN_RNG_BACKEND_EGD,
|
||||
VIR_DOMAIN_RNG_BACKEND_BUILTIN,
|
||||
|
||||
VIR_DOMAIN_RNG_BACKEND_LAST
|
||||
} virDomainRNGBackend;
|
||||
|
|
|
@ -5594,6 +5594,12 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager,
|
|||
rng->info.alias, qemuCaps,
|
||||
cdevflags)))
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
virReportUnsupportedError();
|
||||
return -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -5644,6 +5650,10 @@ qemuBuildRNGBackendProps(virDomainRNGDefPtr rng,
|
|||
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
virReportUnsupportedError();
|
||||
return -1;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("unknown rng-random backend"));
|
||||
|
|
|
@ -14807,8 +14807,10 @@ qemuDomainSetupRNG(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED,
|
|||
case VIR_DOMAIN_RNG_BACKEND_RANDOM:
|
||||
if (qemuDomainCreateDevice(rng->source.file, data, false) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_EGD:
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
/* nada */
|
||||
break;
|
||||
|
@ -15788,6 +15790,7 @@ qemuDomainNamespaceSetupRNG(virDomainObjPtr vm,
|
|||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_EGD:
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
}
|
||||
|
@ -15811,6 +15814,7 @@ qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm,
|
|||
break;
|
||||
|
||||
case VIR_DOMAIN_RNG_BACKEND_EGD:
|
||||
case VIR_DOMAIN_RNG_BACKEND_BUILTIN:
|
||||
case VIR_DOMAIN_RNG_BACKEND_LAST:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue