diff options
author | Ladi Prosek <lprosek@redhat.com> | 2016-03-03 09:37:18 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:49:12 -0600 |
commit | 7e173b3565e5968eb31a0b438fb49617b45515bd (patch) | |
tree | ec3725a696f3708adb27daad34f0c69339fcdb2f /include | |
parent | 855f3d3b99a9267239732fa637699e58d64a2261 (diff) | |
download | hqemu-7e173b3565e5968eb31a0b438fb49617b45515bd.zip hqemu-7e173b3565e5968eb31a0b438fb49617b45515bd.tar.gz |
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 <lprosek@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Message-Id: <1456994238-9585-5-git-send-email-lprosek@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sysemu/rng.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h index 08a2eda..4fffd68 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); }; |