Patchwork chardev: Use real-time clock for open timer

login
register
mail settings
Submitter Jan Kiszka
Date Nov. 22, 2012, 5:30 p.m.
Message ID <50AE611A.50702@siemens.com>
Download mbox | patch
Permalink /patch/201095/
State New
Headers show

Comments

Jan Kiszka - Nov. 22, 2012, 5:30 p.m.
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>
---
 qemu-char.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Luiz Capitulino - Nov. 23, 2012, 11:49 a.m.
To avoid it getting lost in qemu forest.
Blue Swirl - Nov. 24, 2012, 9:03 p.m.
Thanks, applied.

On Thu, Nov 22, 2012 at 5:30 PM, Jan Kiszka <jan.kiszka@siemens.com> wrote:
> 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>
> ---
>  qemu-char.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 88f4025..242b799 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -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);
>      }
>  }
>
> --
> 1.7.3.4
>
Anthony Liguori - Nov. 26, 2012, 9:48 p.m.
Jan Kiszka <jan.kiszka@siemens.com> writes:

> 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>

Applied. Thanks.

Regards,

Anthony Liguori

> ---
>  qemu-char.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 88f4025..242b799 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -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);
>      }
>  }
>  
> -- 
> 1.7.3.4

Patch

diff --git a/qemu-char.c b/qemu-char.c
index 88f4025..242b799 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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);
     }
 }