diff mbox series

[6/9] block/vmdk: add missing coroutine_fn annotations

Message ID 20221103134206.4041928-7-eesposit@redhat.com (mailing list archive)
State New, archived
Headers show
Series Still more coroutine and various fixes in block layer | expand

Commit Message

Emanuele Giuseppe Esposito Nov. 3, 2022, 1:42 p.m. UTC
vmdk_co_create_opts() is a coroutine_fn, and calls vmdk_co_do_create()
which in turn can call two callbacks: vmdk_co_create_opts_cb and
vmdk_co_create_cb.

Mark all these functions as coroutine_fn, since vmdk_co_create_opts()
is the only caller.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
 block/vmdk.c | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

Comments

Paolo Bonzini Nov. 3, 2022, 5 p.m. UTC | #1
On 11/3/22 14:42, Emanuele Giuseppe Esposito wrote:
> vmdk_co_create_opts() is a coroutine_fn, and calls vmdk_co_do_create()
> which in turn can call two callbacks: vmdk_co_create_opts_cb and
> vmdk_co_create_cb.
> 
> Mark all these functions as coroutine_fn, since vmdk_co_create_opts()
> is the only caller.
> 
> 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;

Should not be needed either.

Paolo
diff mbox series

Patch

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;