Patchwork [2/3] virtio-rng: remove extra request for entropy

login
register
mail settings
Submitter Amit Shah
Date Nov. 9, 2012, 1:27 p.m.
Message ID <9b8faccff994b2eb608fe7a7a9785a7e2d736db4.1352466944.git.amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/198059/
State New
Headers show

Comments

Amit Shah - Nov. 9, 2012, 1:27 p.m.
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 <amit.shah@redhat.com>
---
 hw/virtio-rng.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

Patch

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)