[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 03/15] rng random backend: check for -EAGAIN errors
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 03/15] rng random backend: check for -EAGAIN errors on read |
Date: |
Tue, 14 May 2013 16:53:00 -0500 |
From: Amit Shah <address@hidden>
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 <address@hidden>
Signed-off-by: Amit Shah <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>
(cherry picked from commit acbbc036619092fcd2c882222e1be168bd972b3e)
Signed-off-by: Michael Roth <address@hidden>
---
backends/rng-random.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/backends/rng-random.c b/backends/rng-random.c
index 0d11088..813388b 100644
--- a/backends/rng-random.c
+++ b/backends/rng-random.c
@@ -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);
--
1.7.9.5
- [Qemu-stable] Patch Round-up for stable 1.4.2, freeze on Monday, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 01/15] nbd: unlock mutex in nbd_co_send_request() error path, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 02/15] qdev: Fix QOM unrealize behavior, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 03/15] rng random backend: check for -EAGAIN errors on read,
Michael Roth <=
- [Qemu-stable] [PATCH 04/15] tap: properly initialize vhostfds, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 05/15] virtio-ccw: Check indicators location., Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 06/15] configure: Pick up libseccomp include path, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 07/15] target-mips: Fix accumulator arguments to gen_helper_dmult(u), Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 08/15] tcg/optimize: fix setcond2 optimization, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 09/15] qga: set umask 0077 when daemonizing (CVE-2013-2007), Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 10/15] tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 11/15] cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC, Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 13/15] translate-all.c: Remove cpu_unlink_tb(), Michael Roth, 2013/05/14
- [Qemu-stable] [PATCH 12/15] Handle CPU interrupts by inline checking of a flag, Michael Roth, 2013/05/14