[libvirt] "file '/dev/urandom' is not a supported random source"

Peter Krempa pkrempa at redhat.com
Tue Mar 22 15:10:00 UTC 2016


On Tue, Mar 22, 2016 at 14:49:42 +0000, Richard W.M. Jones wrote:
> 
> I got this error when trying to use /dev/urandom as a backend for
> virtio-rng.  Is there a reason for that?  Plain qemu allows you to
> specify /dev/urandom and seems to work OK.
> 
> There's a tetchy bugzilla on this subject:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1074464

The original implementation didn't do any verification. Later before
releasing the feature it was decided that we should actually babysit the
users in this case:

commit 4932ef4502bc515a7d33e09e763118b7d763cd69
Author: Eric Blake <eblake at redhat.com>
Date:   Mon Mar 4 15:42:07 2013 -0700

    rng: restrict passthrough names to known-good files
    
    There is some controversy[1] on the qemu list on whether qemu should
    have ever allowed arbitrary file name passthrough, or whether it
    should be restricted to JUST /dev/random and /dev/hwrng.  It is
    always easier to add support for additional filenames than it is
    to remove support for something once released, so this patch
    restricts libvirt 1.0.3 (where the virtio-random backend was first
    supported) to just the two uncontroversial names, letting us defer
    to a later date any decision on whether supporting arbitrary files
    makes sense. Additionally, since qemu 1.4 does NOT support
    /dev/fdset/nnn fd passthrough for the backend, limiting to just
    two known names means that we don't get tempted to try fd
    passthrough where it won't work.
    
    [1]https://lists.gnu.org/archive/html/qemu-devel/2013-03/threads.html#00023
    
    * src/conf/domain_conf.c (virDomainRNGDefParseXML): Only allow
    /dev/random and /dev/hwrng.
    * docs/schemas/domaincommon.rng: Flag invalid files.
    * docs/formatdomain.html.in (elementsRng): Document this.
    * tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args:
    Update test to match.
    * tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml:
    Likewise.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160322/88659356/attachment-0001.sig>


More information about the libvir-list mailing list