[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 01/13] monitor: simplify monitor_qmp_setup_ha
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v6 01/13] monitor: simplify monitor_qmp_setup_handlers_bh |
Date: |
Tue, 21 Aug 2018 20:13:59 +0200 |
Hi
On Wed, Aug 15, 2018 at 3:37 PM, Peter Xu <address@hidden> wrote:
> When we reach monitor_qmp_setup_handlers_bh() we must be using the
> IOThread then, so no need to check against it any more. Instead, we
> assert.
>
> Reviewed-by: Markus Armbruster <address@hidden>
> Signed-off-by: Peter Xu <address@hidden>
That's a clear simplification that I also found, so ack in principle.
However, I don't understand the need of a BH in the first place.
monitor_get_io_context() will return the iothread associated context.
Could you explain?
thanks
> ---
> monitor.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index 77861e96af..5cd9398824 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -4624,15 +4624,10 @@ static void monitor_qmp_setup_handlers_bh(void
> *opaque)
> Monitor *mon = opaque;
> GMainContext *context;
>
> - if (mon->use_io_thread) {
> - /* Use @mon_iothread context */
> - context = monitor_get_io_context();
> - assert(context);
> - } else {
> - /* Use default main loop context */
> - context = NULL;
> - }
> -
> + assert(mon->use_io_thread);
> + /* Use @mon_iothread context */
> + context = monitor_get_io_context();
> + assert(context);
> qemu_chr_fe_set_handlers(&mon->chr, monitor_can_read, monitor_qmp_read,
> monitor_qmp_event, NULL, mon, context, true);
> monitor_list_append(mon);
> --
> 2.17.1
>
- [Qemu-devel] [PATCH v6 00/13] monitor: enable OOB by default, Peter Xu, 2018/08/15
- [Qemu-devel] [PATCH v6 01/13] monitor: simplify monitor_qmp_setup_handlers_bh, Peter Xu, 2018/08/15
- [Qemu-devel] [PATCH v6 02/13] qapi: Fix build_params() for empty parameter list, Peter Xu, 2018/08/15
- [Qemu-devel] [PATCH v6 03/13] qapi: remove error checks for event emission, Peter Xu, 2018/08/15
- [Qemu-devel] [PATCH v6 04/13] monitor: move need_resume flag into monitor struct, Peter Xu, 2018/08/15
- [Qemu-devel] [PATCH v6 06/13] qapi: remove COMMAND_DROPPED event, Peter Xu, 2018/08/15