[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/11] block/block-gen.h: bind monitor
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 03/11] block/block-gen.h: bind monitor |
Date: |
Sat, 24 Apr 2021 07:23:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:
> If we have current monitor, let's bind it to wrapper coroutine too.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/block-gen.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/block/block-gen.h b/block/block-gen.h
> index c1fd3f40de..61f055a8cc 100644
> --- a/block/block-gen.h
> +++ b/block/block-gen.h
> @@ -27,6 +27,7 @@
> #define BLOCK_BLOCK_GEN_H
>
> #include "block/block_int.h"
> +#include "monitor/monitor.h"
>
> /* Base structure for argument packing structures */
> typedef struct AioPollCo {
> @@ -38,11 +39,20 @@ typedef struct AioPollCo {
>
> static inline int aio_poll_co(AioPollCo *s)
> {
> + Monitor *mon = monitor_cur();
This gets the currently executing coroutine's monitor from the hash
table.
> assert(!qemu_in_coroutine());
>
> + if (mon) {
> + monitor_set_cur(s->co, mon);
This writes it back. No-op, since the coroutine hasn't changed. Why?
> + }
> +
> aio_co_enter(s->ctx, s->co);
> AIO_WAIT_WHILE(s->ctx, s->in_progress);
>
> + if (mon) {
> + monitor_set_cur(s->co, NULL);
This removes s->co's monitor from the hash table. Why?
> + }
> +
> return s->ret;
> }
- [PATCH 00/11] qemu-io-cmds: move to coroutine, Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 04/11] block: introduce bdrv_debug_wait_break, Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 06/11] block: drop unused bdrv_debug_is_suspended(), Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 07/11] block-backend: add _co_ versions of blk_save_vmstate / blk_load_vmstate, Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 10/11] qemu-io-cmds: drop do_co_readv() and do_co_writev() helpers, Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 05/11] qemu-io-cmds: move qemu-io commands to coroutine, Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 11/11] block-backend: drop unused blk_save_vmstate() and blk_load_vmstate(), Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 09/11] qemu-io-cmds: refactor write_f(): drop extra helpers and variables, Vladimir Sementsov-Ogievskiy, 2021/04/23
- [PATCH 08/11] qemu-io-cmds: refactor read_f(): drop extra helpers and variables, Vladimir Sementsov-Ogievskiy, 2021/04/23