aboutsummaryrefslogtreecommitdiff
path: root/tests/ptimer-test-stubs.c
diff options
context:
space:
mode:
authorArtem Pisarenko <artem.k.pisarenko@gmail.com>2018-10-17 14:24:19 +0600
committerPaolo Bonzini <pbonzini@redhat.com>2018-10-19 13:44:03 +0200
commit89a603a0c80ae3d6a8711571550b2ae9a01ea909 (patch)
tree1d6cc3a535a2f02c1bf249ade3a0368bbdb0dc55 /tests/ptimer-test-stubs.c
parent05ff8dc32fa124e7bbf77a257f863f3685c7be9d (diff)
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>
Diffstat (limited to 'tests/ptimer-test-stubs.c')
-rw-r--r--tests/ptimer-test-stubs.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/ptimer-test-stubs.c b/tests/ptimer-test-stubs.c
index ca5cc3b13b..54b3fd26f6 100644
--- a/tests/ptimer-test-stubs.c
+++ b/tests/ptimer-test-stubs.c
@@ -34,14 +34,19 @@ int64_t ptimer_test_time_ns;
int use_icount = 1;
bool qtest_allowed;
-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;
}