Message ID | f8693c2cd06d0401007b2c168126ab907f6da345.1457008497.git.amit.shah@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 17da2f8..d713464 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -69,6 +69,13 @@ static void chr_read(void *opaque, const void *buf, size_t size) g_free(elem); } virtio_notify(vdev, vrng->vq); + + if (!virtio_queue_empty(vrng->vq)) { + /* If we didn't drain the queue, call virtio_rng_process + * to take care of asking for more data as appropriate. + */ + virtio_rng_process(vrng); + } } static void virtio_rng_process(VirtIORNG *vrng)