rng random backend: check for -EAGAIN errors on read
PATCH 1/1 rng random backend: check for -EAGAIN errors on read
Not handling EAGAIN triggers the assert
qemu/backends/rng-random.c:44:entropy_available: assertion failed: (len != -1) Aborted (core dumped)
This happens when starting a guest with '-device virtio-rng-pci', issuing a 'cat /dev/hwrng' in the guest, while also doing 'cat /dev/random' on the host.
--- backends/rng-random.c | 3 +++ 1 file changed, 3 insertions(+)
backends/rng-random.c +3 -0
@@ -41,6 +41,9 @@ static void entropy_available(void *opaque)ssize_t len; len =read (s->fd, buffer, s->size); +if (len <0 && errno ==EAGAIN ) { +return ; + }g_assert (len !=-1 ); s->receive_func (s->opaque, buffer, len);
Signature · 1 line
1.8.1.4
Am 16.04.2013 12:28, schrieb Amit Shah:
Quoted 11 lines
Not handling EAGAIN triggers the assert
qemu/backends/rng-random.c:44:entropy_available: assertion failed: (len != -1) Aborted (core dumped)
This happens when starting a guest with '-device virtio-rng-pci', issuing a 'cat
/dev/hwrng' in the guest, while also doing 'cat/dev/random' on the host.Reported-by yunpingzheng <[email protected]>Signed-off-by Amit Shah <[email protected]>
Doesn't this apply to stable, too, then?
Regards,
Andreas
Quoted 18 lines
--- backends/rng-random.c | 3 +++ 1 file changed, 3 insertions(+)backends/rng-random.c +3
-0@@ -41,6 +41,9 @@ static void entropy_available(void *opaque)ssize_t len; len =read (s->fd, buffer, s->size); +if (len <0 && errno ==EAGAIN ) { +return ; + }g_assert (len !=-1 ); s->receive_func (s->opaque, buffer, len);
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Quoted 6 lines · Andreas Färber
Am 16.04.2013 12:28, schrieb Amit Shah:
Quoted 5 lines
Not handling EAGAIN triggers the assert
qemu/backends/rng-random.c:44:entropy_available: assertion failed: (len != -1) Aborted (core dumped)
Quoted 8 lines
Quoted 6 lines
This happens when starting a guest with '-device virtio-rng-pci', issuing a 'cat
/dev/hwrng' in the guest, while also doing 'cat/dev/random' on the host.Reported-by yunpingzheng <[email protected]>Signed-off-by Amit Shah <[email protected]>Doesn't this apply to stable, too, then?
Ah, good point, it does.
Thanks for CC'ing stable.
Amit
Anthony Liguori
AppliedApplied. Thanks.
Regards,
Anthony Liguori