summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLadi Prosek <lprosek@redhat.com>2016-03-03 14:16:11 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:49:12 -0600
commit20651d6eb8c72ebe5dcc4ce47684cd08511811ad (patch)
tree5c6bb475edac1d79b4394319d0c432c8d81995f7 /include
parent761f55b6f78fb295182fcabebff1f20eeb98efe2 (diff)
downloadhqemu-20651d6eb8c72ebe5dcc4ce47684cd08511811ad.zip
hqemu-20651d6eb8c72ebe5dcc4ce47684cd08511811ad.tar.gz
rng: switch request queue to QSIMPLEQ
QSIMPLEQ supports appending to tail in O(1) and is intrusive so it doesn't require extra memory allocations for the bookkeeping data. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Ladi Prosek <lprosek@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Message-Id: <1457010971-24771-1-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.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sysemu/rng.h b/include/sysemu/rng.h
index 4fffd68..45629c4 100644
--- a/include/sysemu/rng.h
+++ b/include/sysemu/rng.h
@@ -39,6 +39,7 @@ struct RngRequest
void *opaque;
size_t offset;
size_t size;
+ QSIMPLEQ_ENTRY(RngRequest) next;
};
struct RngBackendClass
@@ -56,7 +57,7 @@ struct RngBackend
/*< protected >*/
bool opened;
- GSList *requests;
+ QSIMPLEQ_HEAD(requests, RngRequest) requests;
};
OpenPOWER on IntegriCloud