From patchwork Fri Nov 9 13:27:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] virtio-rng: remove extra request for entropy Date: Fri, 09 Nov 2012 03:27:30 -0000 From: Amit Shah X-Patchwork-Id: 198059 Message-Id: <9b8faccff994b2eb608fe7a7a9785a7e2d736db4.1352466944.git.amit.shah@redhat.com> To: Anthony Liguori Cc: Amit Shah , pbonzini@redhat.com, hpa@zytor.com, qemu list , afaerber@suse.de If we just got a few bytes from the backends, but the guest is ready to accept more, don't poke the backends once more for more bytes; it already knows (from the request in handle_input()). Signed-off-by: Amit Shah --- hw/virtio-rng.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/hw/virtio-rng.c b/hw/virtio-rng.c index 42ac30b..bb19cfa 100644 --- a/hw/virtio-rng.c +++ b/hw/virtio-rng.c @@ -70,16 +70,6 @@ static void chr_read(void *opaque, const void *buf, size_t size) virtqueue_push(vrng->vq, &elem, len); } virtio_notify(&vrng->vdev, vrng->vq); - - /* - * Lastly, if we had multiple elems queued by the guest, and we - * didn't have enough data to fill them all, indicate we want more - * data. - */ - len = pop_an_elem(vrng); - if (len) { - rng_backend_request_entropy(vrng->rng, size, chr_read, vrng); - } } static void handle_input(VirtIODevice *vdev, VirtQueue *vq)