summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLadi Prosek2016-03-03 14:16:11 +0100
committerAmit Shah2016-03-08 08:24:14 +0100
commit443590c2044968a97f5e7cddd35100c6075856a4 (patch)
tree55fffa1528d3d3e52f9d2f64afb750d380927910 /include
parentMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (diff)
downloadqemu-443590c2044968a97f5e7cddd35100c6075856a4.tar.gz
qemu-443590c2044968a97f5e7cddd35100c6075856a4.tar.xz
qemu-443590c2044968a97f5e7cddd35100c6075856a4.zip
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 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;
};