]> xenbits.xensource.com Git - libvirt.git/commit
rng: restrict passthrough names to known-good files
authorEric Blake <eblake@redhat.com>
Mon, 4 Mar 2013 22:42:07 +0000 (15:42 -0700)
committerEric Blake <eblake@redhat.com>
Tue, 5 Mar 2013 00:45:38 +0000 (17:45 -0700)
commit4932ef4502bc515a7d33e09e763118b7d763cd69
tree9a053b6b37c472b9d0d3f881b8788d5a507f2a5e
parent2631fe0420df6e4570fd8272f84ff4c29e009575
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.
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c
tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.args
tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-random.xml