[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 1/4] qapi: Add a 'coroutine' flag for commands
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v4 1/4] qapi: Add a 'coroutine' flag for commands |
Date: |
Wed, 22 Jan 2020 11:10:21 +0100 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
Am 22.01.2020 um 07:32 hat Markus Armbruster geschrieben:
> Kevin Wolf <address@hidden> writes:
>
> > This patch adds a new 'coroutine' flag to QMP command definitions that
> > tells the QMP dispatcher that the command handler is safe to be run in a
> > coroutine.
>
> I'm afraid I missed this question in my review of v3: when is a handler
> *not* safe to be run in a coroutine?
That's a hard one to answer fully.
Basically, I think the biggest problem is with calling functions that
change their behaviour if run in a coroutine compared to running them
outside of coroutine context. In most cases the differences like having
a nested event loop instead of yielding are just fine, but they are
still subtly different.
I know this is vague, but I can assure you that problematic cases exist.
I hit one of them with my initial hack that just moved everything into a
coroutine. It was related to graph modifications and bdrv_drain and
resulted in a hang. For the specifics, I would have to try and reproduce
the problem again.
Kevin
[PATCH v4 2/4] vl: Initialise main loop earlier, Kevin Wolf, 2020/01/21
[PATCH v4 3/4] qmp: Move dispatcher to a coroutine, Kevin Wolf, 2020/01/21
[PATCH v4 4/4] block: Mark 'block_resize' as coroutine, Kevin Wolf, 2020/01/21