qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Amit Shah <amit.shah@redhat.com>
Cc: qemu list <qemu-devel@nongnu.org>,
	Anthony Liguori <anthony@codemonkey.ws>,
	qemu-stable <qemu-stable@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/1] rng random backend: check for -EAGAIN errors on read
Date: Tue, 16 Apr 2013 15:51:30 +0200	[thread overview]
Message-ID: <516D5762.7060900@suse.de> (raw)
In-Reply-To: <eacda84dfaf2d99cf6d250b678be4e4d6c2088fb.1366108096.git.amit.shah@redhat.com>

Am 16.04.2013 12:28, schrieb Amit Shah:
> 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>

Doesn't this apply to stable, too, then?

Regards,
Andreas

> ---
>  backends/rng-random.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/backends/rng-random.c b/backends/rng-random.c
> index d5761f2..830360c 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);

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-04-16 14:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:28 [Qemu-devel] [PATCH 1/1] rng random backend: check for -EAGAIN errors on read Amit Shah
2013-04-16 13:51 ` Andreas Färber [this message]
2013-04-16 15:08   ` Amit Shah
2013-04-22 18:36 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516D5762.7060900@suse.de \
    --to=afaerber@suse.de \
    --cc=amit.shah@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).