chardev: Use real-time clock for open timer

The vm clock may be stopped, and then we won't get open events anymore.
Seen with QMP sessions.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Jan Kiszka 2012-11-22 18:30:02 +01:00 committed by Blue Swirl
parent a85903ff80
commit 06dec08374
1 changed files with 2 additions and 2 deletions

View File

@ -134,9 +134,9 @@ static void qemu_chr_fire_open_event(void *opaque)
void qemu_chr_generic_open(CharDriverState *s)
{
if (s->open_timer == NULL) {
s->open_timer = qemu_new_timer_ms(vm_clock,
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(vm_clock) - 1);
qemu_mod_timer(s->open_timer, qemu_get_clock_ms(rt_clock) - 1);
}
}