From 60253ed1e6ec6d8e5ef2efe7bf755f475dce9956 Mon Sep 17 00:00:00 2001 From: Ladi Prosek Date: Thu, 3 Mar 2016 09:37:18 +0100 Subject: rng: add request queue support to rng-random Requests are now created in the RngBackend parent class and the code path is shared by both rng-egd and rng-random. This commit fixes the rng-random implementation which processed only one request at a time and simply discarded all but the most recent one. In the guest this manifested as delayed completion of reads from virtio-rng, i.e. a read was completed only after another read was issued. By switching rng-random to use the same request queue as rng-egd, the unsafe stack-based allocation of the entropy buffer is eliminated and replaced with g_malloc. Signed-off-by: Ladi Prosek Reviewed-by: Amit Shah Message-Id: <1456994238-9585-5-git-send-email-lprosek@redhat.com> Signed-off-by: Amit Shah --- include/sysemu/rng.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/sysemu/rng.h') diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index 08a2eda2a4..4fffd681a6 100644 --- a/include/sysemu/rng.h +++ b/include/sysemu/rng.h @@ -45,8 +45,7 @@ struct RngBackendClass { ObjectClass parent_class; - void (*request_entropy)(RngBackend *s, size_t size, - EntropyReceiveFunc *receive_entropy, void *opaque); + void (*request_entropy)(RngBackend *s, RngRequest *req); void (*opened)(RngBackend *s, Error **errp); }; -- cgit v1.2.3