Skip to content

Commit

Permalink
libvirt: use /dev/random on libvirt versions <= 2002001
Browse files Browse the repository at this point in the history
It appears that on older libvirt versions(such as 1.3 on Ubuntu16.04),
/dev/urandom backend model is not supported. I could not trace in libvirt's
changelog when that was changed, and I hope this is not a different
issue specific to Ubuntu16.04.  However, we know for sure that /dev/urandom
works on libvirt version greater than 2002001. So here we add a simple
condition on that.

Signed-off-by: Nadav Goldin <[email protected]>
  • Loading branch information
nvgoldin committed Jun 22, 2017
1 parent 492b381 commit daab62b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lago/providers/libvirt/templates/dom_template-base.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
<backend model='random'>{{ '/dev/urandom' if libvirt_ver >= 2002001 else '/dev/random' }}</backend>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</rng>
<console type='pty'>
Expand Down

0 comments on commit daab62b

Please sign in to comment.