[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] rng-random: implement request queue
From: |
Pankaj Gupta |
Subject: |
Re: [Qemu-devel] [PATCH] rng-random: implement request queue |
Date: |
Fri, 5 Feb 2016 00:31:25 -0500 (EST) |
>
> Hi Pankaj,
>
> ----- Original Message -----
> >
> > Hi Ladi,
> >
> > I think this is fine if we have multiple requests from Guests and
> > depending on entropy pool available we can honour individual requests
> > and return with the entropy.
> >
> > Just one point I have is, Suppose we have multiple requests from Guests
> > and we are returning if request length < 0 for any request. There might
> > be pending requests which will get executed in next iteration?Can we honour
> > them in same iteration?
> >
> > static void entropy_available(void *opaque)
> > {
> > ...
> > ...
> > while (s->requests != NULL) {
> > ...
> > if (len < 0 && errno == EAGAIN) {
> > + return;
> > + }
> > ...
>
> All requests in the queue are waiting for data to be readable from the same
> fd. If the fd has no data (read fails with EAGAIN), there's no point in
> hammering on the fd in a loop. Returning seems to be the right thing to do.
>
> Please let me know if I misunderstood your comment.
You are right.
Thanks,
Pankaj
>
> > Best regards,
> > Pankaj
> > >
> > >
> > >
> > > On 03/02/2016 13:36, Amit Shah wrote:
> > > > ... and this can lead to breaking migration (the queue of requests on
> > > > the host needs to be migrated, else the new host will have no idea of
> > > > the queue).
> > >
> > > It is already migrated as part of virtio_rng_save's call to virtio_save.
> > > On the loading side, virtio_rng_process condenses all requests into one
> > > and chr_read fills in as many virtqueue buffers as possible from the
> > > single request.
> > >
> > > Cancel_requests seems useless.
> > >
> > > Paolo
> > >
> >
> >
>