qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] rng-random: implement request queue


From: Ladi Prosek
Subject: Re: [Qemu-devel] [PATCH] rng-random: implement request queue
Date: Thu, 4 Feb 2016 12:24:05 -0500 (EST)

----- Original Message -----
> 
> 
> 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.

Thanks! So this looks broken. The contract between virtio-rng and the rng
backend is "one chr_read callback per one rng_backend_request_entropy",
regardless of the request size. It guarantees that chr_read will get at
least one byte, nothing else. If the one condensed request is bigger than
what the backend is able to give at the moment, there may be unsatisfied
virtio buffers left in the queue.

One way of fixing this would be to have chr_read call virtio_rng_process
if it ran out of backend data but not out of virtio buffers. Otherwise
those buffers will be slowly drained by the rate limit timer, which is
not optimal (especially in the absence of rate limit :)
 
> Cancel_requests seems useless.

I'll delete that code.

> Paolo
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]