mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
fe10ab540b
commit
bc72ad6754
121 changed files with 678 additions and 678 deletions
30
ui/console.c
30
ui/console.c
|
@ -208,8 +208,8 @@ static void gui_update(void *opaque)
|
|||
}
|
||||
trace_console_refresh(interval);
|
||||
}
|
||||
ds->last_update = qemu_get_clock_ms(rt_clock);
|
||||
qemu_mod_timer(ds->gui_timer, ds->last_update + interval);
|
||||
ds->last_update = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
|
||||
timer_mod(ds->gui_timer, ds->last_update + interval);
|
||||
}
|
||||
|
||||
static void gui_setup_refresh(DisplayState *ds)
|
||||
|
@ -232,12 +232,12 @@ static void gui_setup_refresh(DisplayState *ds)
|
|||
}
|
||||
|
||||
if (need_timer && ds->gui_timer == NULL) {
|
||||
ds->gui_timer = qemu_new_timer_ms(rt_clock, gui_update, ds);
|
||||
qemu_mod_timer(ds->gui_timer, qemu_get_clock_ms(rt_clock));
|
||||
ds->gui_timer = timer_new_ms(QEMU_CLOCK_REALTIME, gui_update, ds);
|
||||
timer_mod(ds->gui_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME));
|
||||
}
|
||||
if (!need_timer && ds->gui_timer != NULL) {
|
||||
qemu_del_timer(ds->gui_timer);
|
||||
qemu_free_timer(ds->gui_timer);
|
||||
timer_del(ds->gui_timer);
|
||||
timer_free(ds->gui_timer);
|
||||
ds->gui_timer = NULL;
|
||||
}
|
||||
|
||||
|
@ -1040,7 +1040,7 @@ void console_select(unsigned int index)
|
|||
DisplayState *ds = s->ds;
|
||||
|
||||
if (active_console && active_console->cursor_timer) {
|
||||
qemu_del_timer(active_console->cursor_timer);
|
||||
timer_del(active_console->cursor_timer);
|
||||
}
|
||||
active_console = s;
|
||||
if (ds->have_gfx) {
|
||||
|
@ -1059,8 +1059,8 @@ void console_select(unsigned int index)
|
|||
dpy_text_resize(s, s->width, s->height);
|
||||
}
|
||||
if (s->cursor_timer) {
|
||||
qemu_mod_timer(s->cursor_timer,
|
||||
qemu_get_clock_ms(rt_clock) + CONSOLE_CURSOR_PERIOD / 2);
|
||||
timer_mod(s->cursor_timer,
|
||||
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + CONSOLE_CURSOR_PERIOD / 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1105,7 +1105,7 @@ static void kbd_send_chars(void *opaque)
|
|||
/* characters are pending: we send them a bit later (XXX:
|
||||
horrible, should change char device API) */
|
||||
if (s->out_fifo.count > 0) {
|
||||
qemu_mod_timer(s->kbd_timer, qemu_get_clock_ms(rt_clock) + 1);
|
||||
timer_mod(s->kbd_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1366,7 +1366,7 @@ void update_displaychangelistener(DisplayChangeListener *dcl,
|
|||
|
||||
dcl->update_interval = interval;
|
||||
if (!ds->refreshing && ds->update_interval > interval) {
|
||||
qemu_mod_timer(ds->gui_timer, ds->last_update + interval);
|
||||
timer_mod(ds->gui_timer, ds->last_update + interval);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1691,8 +1691,8 @@ static void text_console_update_cursor(void *opaque)
|
|||
|
||||
s->cursor_visible_phase = !s->cursor_visible_phase;
|
||||
graphic_hw_invalidate(s);
|
||||
qemu_mod_timer(s->cursor_timer,
|
||||
qemu_get_clock_ms(rt_clock) + CONSOLE_CURSOR_PERIOD / 2);
|
||||
timer_mod(s->cursor_timer,
|
||||
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + CONSOLE_CURSOR_PERIOD / 2);
|
||||
}
|
||||
|
||||
static const GraphicHwOps text_console_ops = {
|
||||
|
@ -1712,7 +1712,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
|
|||
|
||||
s->out_fifo.buf = s->out_fifo_buf;
|
||||
s->out_fifo.buf_size = sizeof(s->out_fifo_buf);
|
||||
s->kbd_timer = qemu_new_timer_ms(rt_clock, kbd_send_chars, s);
|
||||
s->kbd_timer = timer_new_ms(QEMU_CLOCK_REALTIME, kbd_send_chars, s);
|
||||
s->ds = ds;
|
||||
|
||||
s->y_displayed = 0;
|
||||
|
@ -1729,7 +1729,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds)
|
|||
}
|
||||
|
||||
s->cursor_timer =
|
||||
qemu_new_timer_ms(rt_clock, text_console_update_cursor, s);
|
||||
timer_new_ms(QEMU_CLOCK_REALTIME, text_console_update_cursor, s);
|
||||
|
||||
s->hw_ops = &text_console_ops;
|
||||
s->hw = s;
|
||||
|
|
|
@ -277,11 +277,11 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time,
|
|||
KeyValueList *p;
|
||||
|
||||
if (!key_timer) {
|
||||
key_timer = qemu_new_timer_ns(vm_clock, release_keys, NULL);
|
||||
key_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, release_keys, NULL);
|
||||
}
|
||||
|
||||
if (keycodes != NULL) {
|
||||
qemu_del_timer(key_timer);
|
||||
timer_del(key_timer);
|
||||
release_keys(NULL);
|
||||
}
|
||||
|
||||
|
@ -308,7 +308,7 @@ void qmp_send_key(KeyValueList *keys, bool has_hold_time, int64_t hold_time,
|
|||
}
|
||||
|
||||
/* delayed key up events */
|
||||
qemu_mod_timer(key_timer, qemu_get_clock_ns(vm_clock) +
|
||||
timer_mod(key_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
|
||||
muldiv64(get_ticks_per_sec(), hold_time, 1000));
|
||||
}
|
||||
|
||||
|
|
|
@ -63,25 +63,25 @@ static SpiceTimer *timer_add(SpiceTimerFunc func, void *opaque)
|
|||
SpiceTimer *timer;
|
||||
|
||||
timer = g_malloc0(sizeof(*timer));
|
||||
timer->timer = qemu_new_timer_ms(rt_clock, func, opaque);
|
||||
timer->timer = timer_new_ms(QEMU_CLOCK_REALTIME, func, opaque);
|
||||
QTAILQ_INSERT_TAIL(&timers, timer, next);
|
||||
return timer;
|
||||
}
|
||||
|
||||
static void timer_start(SpiceTimer *timer, uint32_t ms)
|
||||
{
|
||||
qemu_mod_timer(timer->timer, qemu_get_clock_ms(rt_clock) + ms);
|
||||
timer_mod(timer->timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + ms);
|
||||
}
|
||||
|
||||
static void timer_cancel(SpiceTimer *timer)
|
||||
{
|
||||
qemu_del_timer(timer->timer);
|
||||
timer_del(timer->timer);
|
||||
}
|
||||
|
||||
static void timer_remove(SpiceTimer *timer)
|
||||
{
|
||||
qemu_del_timer(timer->timer);
|
||||
qemu_free_timer(timer->timer);
|
||||
timer_del(timer->timer);
|
||||
timer_free(timer->timer);
|
||||
QTAILQ_REMOVE(&timers, timer, next);
|
||||
g_free(timer);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue