[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 1/8] monitor: move skip_flush into monitor_data
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [RFC v2 1/8] monitor: move skip_flush into monitor_data_init |
Date: |
Wed, 23 Aug 2017 17:31:38 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
* Peter Xu (address@hidden) wrote:
> It's part of the data init. Collect it.
>
> Signed-off-by: Peter Xu <address@hidden>
OK, this can probably go separately as well.
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> ---
> monitor.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index e0f8801..7c90df7 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -568,13 +568,14 @@ static void monitor_qapi_event_init(void)
>
> static void handle_hmp_command(Monitor *mon, const char *cmdline);
>
> -static void monitor_data_init(Monitor *mon)
> +static void monitor_data_init(Monitor *mon, bool skip_flush)
> {
> memset(mon, 0, sizeof(Monitor));
> qemu_mutex_init(&mon->out_lock);
> mon->outbuf = qstring_new();
> /* Use *mon_cmds by default. */
> mon->cmd_table = mon_cmds;
> + mon->skip_flush = skip_flush;
> }
>
> static void monitor_data_destroy(Monitor *mon)
> @@ -594,8 +595,7 @@ char *qmp_human_monitor_command(const char *command_line,
> bool has_cpu_index,
> char *output = NULL;
> Monitor *old_mon, hmp;
>
> - monitor_data_init(&hmp);
> - hmp.skip_flush = true;
> + monitor_data_init(&hmp, true);
>
> old_mon = cur_mon;
> cur_mon = &hmp;
> @@ -4098,7 +4098,7 @@ void monitor_init(Chardev *chr, int flags)
> }
>
> mon = g_malloc(sizeof(*mon));
> - monitor_data_init(mon);
> + monitor_data_init(mon, false);
>
> qemu_chr_fe_init(&mon->chr, chr, &error_abort);
> mon->flags = flags;
> --
> 2.7.4
>
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK