qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v7 13/23] monitor: let suspend/resume work even


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v7 13/23] monitor: let suspend/resume work even with QMPs
Date: Wed, 21 Feb 2018 16:50:58 +0000
User-agent: Mutt/1.9.2 (2017-12-15)

On Wed, Jan 24, 2018 at 01:39:47PM +0800, Peter Xu wrote:
> diff --git a/monitor.c b/monitor.c
> index 60bcf67b3a..76137ba2a4 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -246,6 +246,21 @@ static inline bool monitor_is_qmp(const Monitor *mon)
>      return (mon->flags & MONITOR_USE_CONTROL);
>  }
>  
> +/**
> + * Whether @mon is using readline?  Note: not all HMP monitors can are
> + * using readline, e.g., gdbserver has non-interactive HMP monitor, so

s/can are using/use/

s/has non-interactive HMP monitor/has a non-interactive HMP monitor/

> @@ -3994,19 +4009,43 @@ static void monitor_command_cb(void *opaque, const 
> char *cmdline,
>  
>  int monitor_suspend(Monitor *mon)
>  {
> -    if (!mon->rs)
> +    if (monitor_is_hmp_non_interactive(mon)) {
>          return -ENOTTY;
> +    }
> +
> +    if (monitor_is_qmp(mon)) {
> +        /*
> +         * Kick iothread to make sure this takes effect.  It'll be
> +         * evaluated again in prepare() of the watch object.
> +         */
> +        aio_notify(iothread_get_aio_context(mon_global.mon_iothread));

This must be done after incrementing suspend_cnt to avoid the race
condition between the iothread and our thread.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]