]> git.ipfire.org Git - thirdparty/qemu.git/commit
rng random backend: check for -EAGAIN errors on read
authorAmit Shah <amit.shah@redhat.com>
Tue, 16 Apr 2013 10:28:16 +0000 (15:58 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 13 May 2013 16:50:35 +0000 (11:50 -0500)
commite355efd9629e1a880d313911c7dee3a9943f88b4
tree60b4d8f8718e84d5d35afd0907497443d5c4aa13
parent4d7f4556fc6ceafcf6ccd9ebce441e22c90f5756
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.

Reported-by: yunpingzheng <yunzheng@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Message-id: eacda84dfaf2d99cf6d250b678be4e4d6c2088fb.1366108096.git.amit.shah@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit acbbc036619092fcd2c882222e1be168bd972b3e)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
backends/rng-random.c