/* Add timers to event loop */ void throttle_timers_attach_aio_context(ThrottleTimers *tt, AioContext *new_context) { tt->timers[0] = aio_timer_new(new_context, tt->clock_type, SCALE_NS, tt->read_timer_cb, tt->timer_opaque); tt->timers[1] = aio_timer_new(new_context, tt->clock_type, SCALE_NS, tt->write_timer_cb, tt->timer_opaque); }
static void colo_compare_timer_init(CompareState *s) { AioContext *ctx = iothread_get_aio_context(s->iothread); s->packet_check_timer = aio_timer_new(ctx, QEMU_CLOCK_VIRTUAL, SCALE_MS, check_old_packet_regular, s); timer_mod(s->packet_check_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + REGULAR_PACKET_CHECK_MS); }
static void bdrv_qed_attach_aio_context(BlockDriverState *bs, AioContext *new_context) { BDRVQEDState *s = bs->opaque; s->need_check_timer = aio_timer_new(new_context, QEMU_CLOCK_VIRTUAL, SCALE_NS, qed_need_check_timer_cb, s); if (s->header.features & QED_F_NEED_CHECK) { qed_start_need_check_timer(s); } }