qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v5 06/26] monitor: move the cur_mon hack deeper fo


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC v5 06/26] monitor: move the cur_mon hack deeper for QMP
Date: Wed, 13 Dec 2017 15:41:49 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Tue, Dec 05, 2017 at 01:51:40PM +0800, Peter Xu wrote:
> In monitor_qmp_read(), we have the hack to temporarily replace the
> cur_mon pointer.  Now we move this hack deeper inside the QMP dispatcher
> routine since the Monitor pointer can be passed in to that using the new
> JSON Parser opaque field now.
> 
> This does not make much sense as a single patch.  However, this will be
> a big step for the next patch, when the QMP dispatcher routine will be
> split from the QMP parser.
> 
> Reviewed-by: Eric Blake <address@hidden>
> Reviewed-by: Fam Zheng <address@hidden>
> Signed-off-by: Peter Xu <address@hidden>
> ---
>  monitor.c | 19 ++++++++++---------
>  1 file changed, 10 insertions(+), 9 deletions(-)
> 
> diff --git a/monitor.c b/monitor.c
> index ab80d32c70..322dfb5f31 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3813,7 +3813,7 @@ static void handle_qmp_command(JSONMessageParser 
> *parser, GQueue *tokens,
>  {
>      QObject *req, *rsp = NULL, *id = NULL;
>      QDict *qdict = NULL;
> -    Monitor *mon = cur_mon;
> +    Monitor *mon = opaque, *old_mon;

Or without the new opaque argument:

MonitorQMP *mon_qmp = container_of(parser, MonitorQMP, parser);
Monitor *mon = container_of(mon_qmp, Monitor, qmp);

Attachment: signature.asc
Description: PGP signature


reply via email to

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