Message ID | 20190514075602.7674-2-lvivier@redhat.com |
---|---|
State | New |
Headers | show |
Series | rng-builtin: add an RNG backend thatuses qemu_guest_getrandom() | expand |
On Tue, May 14, 2019 at 09:56:00AM +0200, Laurent Vivier wrote: > From: Kashyap Chamarthy <kchamart@redhat.com> > > When QEMU exposes a VirtIO-RNG device to the guest, that device needs a > source of entropy, and that source needs to be "non-blocking", like > `/dev/urandom`. However, currently QEMU defaults to the problematic > `/dev/random`, which on linux is "blocking" (as in, it waits until OCD nit: s/linux/Linux/ Maybe Michael can do the touch up when applying. Thanks, Laurent, for reworking the commit message update. > sufficient entropy is available). [...]
On 14/05/2019 10:08, Kashyap Chamarthy wrote: > On Tue, May 14, 2019 at 09:56:00AM +0200, Laurent Vivier wrote: >> From: Kashyap Chamarthy <kchamart@redhat.com> >> >> When QEMU exposes a VirtIO-RNG device to the guest, that device needs a >> source of entropy, and that source needs to be "non-blocking", like >> `/dev/urandom`. However, currently QEMU defaults to the problematic >> `/dev/random`, which on linux is "blocking" (as in, it waits until > > OCD nit: s/linux/Linux/ > > Maybe Michael can do the touch up when applying. A little reminder: this patch can be applied alone, but the followings need the series from Richard to be applied first. Thanks, Laurent
diff --git a/backends/rng-random.c b/backends/rng-random.c index e2a49b0571d7..eff36ef14084 100644 --- a/backends/rng-random.c +++ b/backends/rng-random.c @@ -112,7 +112,7 @@ static void rng_random_init(Object *obj) rng_random_set_filename, NULL); - s->filename = g_strdup("/dev/random"); + s->filename = g_strdup("/dev/urandom"); s->fd = -1; } diff --git a/qemu-options.hx b/qemu-options.hx index 0191ef8b1eb7..4df0ea3aed5c 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4286,7 +4286,7 @@ Creates a random number generator backend which obtains entropy from a device on the host. The @option{id} parameter is a unique ID that will be used to reference this entropy backend from the @option{virtio-rng} device. The @option{filename} parameter specifies which file to obtain -entropy from and if omitted defaults to @option{/dev/random}. +entropy from and if omitted defaults to @option{/dev/urandom}. @item -object rng-egd,id=@var{id},chardev=@var{chardevid}