From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTzF-0007EB-Dl for qemu-devel@nongnu.org; Wed, 03 Apr 2013 16:08:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNTzA-00065v-7b for qemu-devel@nongnu.org; Wed, 03 Apr 2013 16:08:49 -0400 Received: from mail-ie0-x22e.google.com ([2607:f8b0:4001:c03::22e]:39879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNTzA-00065e-3Q for qemu-devel@nongnu.org; Wed, 03 Apr 2013 16:08:44 -0400 Received: by mail-ie0-f174.google.com with SMTP id aq17so2153267iec.19 for ; Wed, 03 Apr 2013 13:08:43 -0700 (PDT) From: Anthony Liguori In-Reply-To: <20130403062823.GA8995@amit.redhat.com> References: <74d06e1f94cc2337aa1bb6784a7ad2210ec55364.1364808312.git.amit.shah@redhat.com> <87eheus60p.fsf@codemonkey.ws> <20130402103549.GC15084@amit.redhat.com> <874nfpf62k.fsf@codemonkey.ws> <20130403062823.GA8995@amit.redhat.com> Date: Wed, 03 Apr 2013 15:08:40 -0500 Message-ID: <87ehercr7b.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 1/1] rng backend: open backend in blocking mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: qemu list Amit Shah writes: > On (Tue) 02 Apr 2013 [07:52:19], Anthony Liguori wrote: >> Amit Shah 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 :-) Regards, Anthony Liguori > > > Amit