[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 09/14] qmp: Move dispatcher to a coroutine
From: |
Volker Rümelin |
Subject: |
Re: [PULL 09/14] qmp: Move dispatcher to a coroutine |
Date: |
Sat, 17 Oct 2020 10:15:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 |
> From: Kevin Wolf <kwolf@redhat.com>
>
> This moves the QMP dispatcher to a coroutine and runs all QMP command
> handlers that declare 'coroutine': true in coroutine context so they
> can avoid blocking the main loop while doing I/O or waiting for other
> events.
>
> For commands that are not declared safe to run in a coroutine, the
> dispatcher drops out of coroutine context by calling the QMP command
> handler from a bottom half.
Hi Kevin,
since commit 9ce44e2ce2 "qmp: Move dispatcher to a coroutine" I see the
following error on Windows whenever I close the QEMU window or shut down the
guest.
$ ./qemu-system-x86_64.exe -machine pc,accel=tcg -display gtk
**
ERROR:../qemu/util/aio-win32.c:337:aio_poll: assertion failed:
(in_aio_context_home_thread(ctx))
Bail out! ERROR:../qemu/util/aio-win32.c:337:aio_poll: assertion failed:
(in_aio_context_home_thread(ctx))
I wonder if you forgot to apply the changes to util/aio-posix.c to
util/aio-win32.c too? This solves the problem on my Windows host. But I have to
admit I don't know the code here.
With best regards,
Volker
> diff --git a/util/aio-posix.c b/util/aio-posix.c
> index 280f27bb99..30f5354b1e 100644
> --- a/util/aio-posix.c
> +++ b/util/aio-posix.c
> @@ -15,6 +15,7 @@
>
> #include "qemu/osdep.h"
> #include "block/block.h"
> +#include "qemu/main-loop.h"
> #include "qemu/rcu.h"
> #include "qemu/rcu_queue.h"
> #include "qemu/sockets.h"
> @@ -558,8 +559,13 @@ bool aio_poll(AioContext *ctx, bool blocking)
> * There cannot be two concurrent aio_poll calls for the same AioContext
> (or
> * an aio_poll concurrent with a GSource prepare/check/dispatch
> callback).
> * We rely on this below to avoid slow locked accesses to ctx->notify_me.
> + *
> + * aio_poll() may only be called in the AioContext's thread.
> iohandler_ctx
> + * is special in that it runs in the main thread, but that thread's
> context
> + * is qemu_aio_context.
> */
> - assert(in_aio_context_home_thread(ctx));
> + assert(in_aio_context_home_thread(ctx == iohandler_get_aio_context() ?
> + qemu_get_aio_context() : ctx));
>
> qemu_lockcnt_inc(&ctx->list_lock);
>
- [PULL 04/14] hmp: Update current monitor only in handle_hmp_command(), (continued)
- [PULL 04/14] hmp: Update current monitor only in handle_hmp_command(), Markus Armbruster, 2020/10/09
- [PULL 09/14] qmp: Move dispatcher to a coroutine, Markus Armbruster, 2020/10/09
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Alex Bennée, 2020/10/12
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Kevin Wolf, 2020/10/12
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Philippe Mathieu-Daudé, 2020/10/12
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Kevin Wolf, 2020/10/12
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Alex Bennée, 2020/10/12
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Ben Widawsky, 2020/10/12
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Philippe Mathieu-Daudé, 2020/10/13
- Re: [PULL 09/14] qmp: Move dispatcher to a coroutine, Kevin Wolf, 2020/10/13
Re: [PULL 09/14] qmp: Move dispatcher to a coroutine,
Volker Rümelin <=
[PULL 07/14] monitor: Make current monitor a per-coroutine property, Markus Armbruster, 2020/10/09
[PULL 03/14] monitor: Use getter/setter functions for cur_mon, Markus Armbruster, 2020/10/09
[PULL 08/14] qapi: Add a 'coroutine' flag for commands, Markus Armbruster, 2020/10/09
[PULL 11/14] util/async: Add aio_co_reschedule_self(), Markus Armbruster, 2020/10/09
[PULL 10/14] hmp: Add support for coroutine command handlers, Markus Armbruster, 2020/10/09
[PULL 13/14] block: Add bdrv_lock()/unlock(), Markus Armbruster, 2020/10/09
Re: [PULL 00/14] Monitor patches for 2020-10-09, Peter Maydell, 2020/10/09