[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 6/9] block/vmdk: add missing coroutine_fn annotations
From: |
Emanuele Giuseppe Esposito |
Subject: |
[PATCH v2 6/9] block/vmdk: add missing coroutine_fn annotations |
Date: |
Fri, 4 Nov 2022 05:56:57 -0400 |
These functions end up calling bdrv_create() implemented as generated_co_wrapper
functions.
In addition, they also happen to be always called in coroutine context,
meaning all callers are coroutine_fn.
This means that the g_c_w function will enter the qemu_in_coroutine()
case and eventually suspend (or in other words call qemu_coroutine_yield()).
Therefore we need to mark such functions coroutine_fn too.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
block/vmdk.c | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 26376352b9..0c32bf2e83 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2285,10 +2285,11 @@ exit:
return ret;
}
-static int vmdk_create_extent(const char *filename, int64_t filesize,
- bool flat, bool compress, bool zeroed_grain,
- BlockBackend **pbb,
- QemuOpts *opts, Error **errp)
+static int coroutine_fn vmdk_create_extent(const char *filename,
+ int64_t filesize, bool flat,
+ bool compress, bool zeroed_grain,
+ BlockBackend **pbb,
+ QemuOpts *opts, Error **errp)
{
int ret;
BlockBackend *blk = NULL;
@@ -2366,14 +2367,14 @@ static int filename_decompose(const char *filename,
char *path, char *prefix,
* non-split format.
* idx >= 1: get the n-th extent if in a split subformat
*/
-typedef BlockBackend *(*vmdk_create_extent_fn)(int64_t size,
- int idx,
- bool flat,
- bool split,
- bool compress,
- bool zeroed_grain,
- void *opaque,
- Error **errp);
+typedef BlockBackend * coroutine_fn (*vmdk_create_extent_fn)(int64_t size,
+ int idx,
+ bool flat,
+ bool split,
+ bool compress,
+ bool zeroed_grain,
+ void *opaque,
+ Error **errp);
static void vmdk_desc_add_extent(GString *desc,
const char *extent_line_fmt,
@@ -2616,7 +2617,7 @@ typedef struct {
QemuOpts *opts;
} VMDKCreateOptsData;
-static BlockBackend *vmdk_co_create_opts_cb(int64_t size, int idx,
+static BlockBackend * coroutine_fn vmdk_co_create_opts_cb(int64_t size, int
idx,
bool flat, bool split, bool
compress,
bool zeroed_grain, void *opaque,
Error **errp)
@@ -2768,10 +2769,11 @@ exit:
return ret;
}
-static BlockBackend *vmdk_co_create_cb(int64_t size, int idx,
- bool flat, bool split, bool compress,
- bool zeroed_grain, void *opaque,
- Error **errp)
+static BlockBackend * coroutine_fn vmdk_co_create_cb(int64_t size, int idx,
+ bool flat, bool split,
+ bool compress,
+ bool zeroed_grain,
+ void *opaque, Error
**errp)
{
int ret;
BlockDriverState *bs;
--
2.31.1
[PATCH v2 4/9] block-backend: replace bdrv_*_above with blk_*_above, Emanuele Giuseppe Esposito, 2022/11/04
[PATCH v2 7/9] block: bdrv_create_file is a coroutine_fn, Emanuele Giuseppe Esposito, 2022/11/04
[PATCH v2 5/9] block: distinguish between bdrv_create running in coroutine and not, Emanuele Giuseppe Esposito, 2022/11/04
[PATCH v2 9/9] block/dirty-bitmap: remove unnecessary qemu_in_coroutine() case, Emanuele Giuseppe Esposito, 2022/11/04
[PATCH v2 8/9] block: bdrv_create is never called in non-coroutine context, Emanuele Giuseppe Esposito, 2022/11/04
[PATCH v2 6/9] block/vmdk: add missing coroutine_fn annotations,
Emanuele Giuseppe Esposito <=
[PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/04
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Vladimir Sementsov-Ogievskiy, 2022/11/08
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/08
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Vladimir Sementsov-Ogievskiy, 2022/11/08
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Vladimir Sementsov-Ogievskiy, 2022/11/08
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/09
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Alberto Faria, 2022/11/09
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Paolo Bonzini, 2022/11/10
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Emanuele Giuseppe Esposito, 2022/11/15
- Re: [PATCH v2 2/9] block-copy: add missing coroutine_fn annotations, Paolo Bonzini, 2022/11/16