[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
Re: [Qemu-devel] [PATCH v6 01/13] monitor: simplify monitor_qmp_setup_handlers_bh
Wed, 22 Aug 2018 12:38:44 +0800
On Tue, Aug 21, 2018 at 08:13:59PM +0200, Marc-André Lureau wrote:
> 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?
Please refer to the comment in monitor_init():
* We can't call qemu_chr_fe_set_handlers() directly here
* since chardev might be running in the monitor I/O
* thread. Schedule a bottom half.
To be more specific: in qemu_chr_fe_set_handlers() after we call
qemu_chr_be_update_read_handlers() then the iothread might already
have started to operate on the chardev, so it can race with
qemu_chr_fe_set_handlers() itself if we call it directly in the main
- [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