qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu list <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/1] rng backend: open backend in blocking mode
Date: Mon, 8 Apr 2013 11:39:00 +0530	[thread overview]
Message-ID: <20130408060900.GH16207@amit.redhat.com> (raw)
In-Reply-To: <87ehercr7b.fsf@codemonkey.ws>

On (Wed) 03 Apr 2013 [15:08:40], Anthony Liguori wrote:
> Amit Shah <amit.shah@redhat.com> writes:
> 
> > On (Tue) 02 Apr 2013 [07:52:19], Anthony Liguori wrote:
> >> Amit Shah <amit.shah@redhat.com> writes:
> >> 
> >> >> > backends/rng-random.c:44:entropy_available: assertion failed: (len != -1)
> >> >> >
> >> >> > without this fix.
> >> >> 
> >> >> This fix would cause QEMU to block indefinitely which I don't think is
> >> >> very good behavior.  I think a better solution would be:
> >
> > How about relegating it to glib functions, and hooking it up so that
> > /dev/random is polled for data, and this function gets called when
> > /dev/random has data to give out?  Sure, when a read is attempted,
> > there might be no data available again, but we could then go back to
> > polling.
> 
> The fix I posted minus the needed s/EINTR/EAGAIN/g is pretty straight
> forward and IMHO the proper way to handle this.
> 
> Is there something you think is broken with it?  I guess I should turn
> it into a real patch but I was hoping you would so I didn't have to
> recreate the original problem :-)

Oh yes, I'll do that and test, and will submit a patch.  My concern is
just that we'll forget checking for EINTR and fall into these traps
with open-coded read() calls instead of using wrappers.

		Amit

      reply	other threads:[~2013-04-08  6:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01  9:25 [Qemu-devel] [PATCH 1/1] rng backend: open backend in blocking mode Amit Shah
2013-04-01 14:02 ` Anthony Liguori
2013-04-02 10:35   ` Amit Shah
2013-04-02 12:52     ` Anthony Liguori
2013-04-03  6:28       ` Amit Shah
2013-04-03 20:08         ` Anthony Liguori
2013-04-08  6:09           ` Amit Shah [this message]

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=20130408060900.GH16207@amit.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@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).