aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu/rng.h
diff options
context:
space:
mode:
authorLadi Prosek <lprosek@redhat.com>2016-03-03 14:16:11 +0100
committerAmit Shah <amit.shah@redhat.com>2016-03-08 12:54:14 +0530
commit443590c2044968a97f5e7cddd35100c6075856a4 (patch)
tree55fffa1528d3d3e52f9d2f64afb750d380927910 /include/sysemu/rng.h
parent97556fe80e4f7252300b3498b3477fb4295153a3 (diff)
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/sysemu/rng.h')
-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 4fffd681a6..45629c4c53 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;
};