mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
97556fe80e
commit
443590c204
4 changed files with 19 additions and 16 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue