On Thu, Oct 26, 2017 at 09:30:55 +0200, Michal Privoznik wrote:
On 10/25/2017 03:41 PM, Yalan Zhang wrote:
> Hi Amos,
>
> I'm a libvirt QE, and I can not understand the setting on
libvirt.org for
> rng device.
> Could you please help to explain a little?
> (The xml in
https://libvirt.org/formatdomain.html#elementsRng)
> <devices>
> <rng model='virtio'>
> <rate period="2000" bytes="1234"/>
> <backend model='random'>/dev/random</backend>
> <!-- OR -->
> <backend model='egd' type='udp'>
> *<source mode='bind' service='1234'/>*
> * <source mode='connect' host='1.2.3.4'
service='1234'/>*
> </backend>
> </rng>
> </devices>
>
> How did it work with source mode='bind' and source mode='connect'
together?
It doesn't. That's just an example that you can have two types of
backend. Either the backend connects somewhere (mode='connect'), or
expect somebody to connect (mode='bind'). Just try to define domain with
that RNG, dump the XML back and see what got applied.
Note that both are required to establish a bidirectional connection with
UDP as configured above. For EGD you really need both directions since
it's a bidirectional protocol.