mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
qemu-timer: introduce timer attributes
Attributes are simple flags, associated with individual timers for their whole lifetime. They intended to be used to mark individual timers for special handling when they fire. New/init functions family in timer interface updated and refactored (new 'attribute' argument added, timer_list replaced with timer_list_group+type combinations, comments improved to avoid info duplication). Also existing aio interface extended with attribute-enabled variants of functions, which create/initialize timers. Signed-off-by: Artem Pisarenko <artem.k.pisarenko@gmail.com> Message-Id: <f47b81dbce734e9806f9516eba8ca588e6321c2f.1539764043.git.artem.k.pisarenko@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
05ff8dc32f
commit
89a603a0c8
4 changed files with 124 additions and 70 deletions
|
@ -339,14 +339,19 @@ int qemu_poll_ns(GPollFD *fds, guint nfds, int64_t timeout)
|
|||
}
|
||||
|
||||
|
||||
void timer_init_tl(QEMUTimer *ts,
|
||||
QEMUTimerList *timer_list, int scale,
|
||||
QEMUTimerCB *cb, void *opaque)
|
||||
void timer_init_full(QEMUTimer *ts,
|
||||
QEMUTimerListGroup *timer_list_group, QEMUClockType type,
|
||||
int scale, int attributes,
|
||||
QEMUTimerCB *cb, void *opaque)
|
||||
{
|
||||
ts->timer_list = timer_list;
|
||||
if (!timer_list_group) {
|
||||
timer_list_group = &main_loop_tlg;
|
||||
}
|
||||
ts->timer_list = timer_list_group->tl[type];
|
||||
ts->cb = cb;
|
||||
ts->opaque = opaque;
|
||||
ts->scale = scale;
|
||||
ts->attributes = attributes;
|
||||
ts->expire_time = -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue