From 9f939df955a4152aad69a19a77e0898631bb2c18 Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Tue, 5 Mar 2013 23:21:27 +0530 Subject: qemu-char: remove use of QEMUTimer in favor of glib idle function qemu-char is now independent of the QEMU main loop. Signed-off-by: Anthony Liguori Signed-off-by: Amit Shah Message-id: 3cda0bbcfb94912df8a767983a52bb71a4a3231d.1362505276.git.amit.shah@redhat.com Signed-off-by: Anthony Liguori --- qemu-char.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'qemu-char.c') diff --git a/qemu-char.c b/qemu-char.c index 6dba943..2c7c929 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -122,20 +122,18 @@ void qemu_chr_be_event(CharDriverState *s, int event) s->chr_event(s->handler_opaque, event); } -static void qemu_chr_fire_open_event(void *opaque) +static gboolean qemu_chr_generic_open_bh(gpointer opaque) { CharDriverState *s = opaque; qemu_chr_be_event(s, CHR_EVENT_OPENED); - qemu_free_timer(s->open_timer); - s->open_timer = NULL; + s->idle_tag = 0; + return FALSE; } void qemu_chr_generic_open(CharDriverState *s) { - if (s->open_timer == NULL) { - s->open_timer = qemu_new_timer_ms(rt_clock, - qemu_chr_fire_open_event, s); - qemu_mod_timer(s->open_timer, qemu_get_clock_ms(rt_clock) - 1); + if (s->idle_tag == 0) { + s->idle_tag = g_idle_add(qemu_chr_generic_open_bh, s); } } -- cgit v1.1