All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: add missing coroutine_fn to bdrv_sum_allocated_file_size()
@ 2023-03-08 21:14 Stefan Hajnoczi
  2023-03-09  7:09 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hajnoczi @ 2023-03-08 21:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hanna Reitz, qemu-block, Kevin Wolf, Stefan Hajnoczi

Not a coroutine_fn, you say?

  static int64_t bdrv_sum_allocated_file_size(BlockDriverState *bs)
  {
      BdrvChild *child;
      int64_t child_size, sum = 0;

      QLIST_FOREACH(child, &bs->children, next) {
          if (child->role & (BDRV_CHILD_DATA | BDRV_CHILD_METADATA |
                             BDRV_CHILD_FILTERED))
          {
              child_size = bdrv_co_get_allocated_file_size(child->bs);
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Well what do we have here?!

I rest my case, your honor.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 0dd604d0f6..a79297f99b 100644
--- a/block.c
+++ b/block.c
@@ -5749,7 +5749,7 @@ exit:
  * sums the size of all data-bearing children.  (This excludes backing
  * children.)
  */
-static int64_t bdrv_sum_allocated_file_size(BlockDriverState *bs)
+static int64_t coroutine_fn bdrv_sum_allocated_file_size(BlockDriverState *bs)
 {
     BdrvChild *child;
     int64_t child_size, sum = 0;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: add missing coroutine_fn to bdrv_sum_allocated_file_size()
  2023-03-08 21:14 [PATCH] block: add missing coroutine_fn to bdrv_sum_allocated_file_size() Stefan Hajnoczi
@ 2023-03-09  7:09 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-03-09  7:09 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Hanna Reitz, qemu-block, Kevin Wolf

On 8/3/23 22:14, Stefan Hajnoczi wrote:
> Not a coroutine_fn, you say?
> 
>    static int64_t bdrv_sum_allocated_file_size(BlockDriverState *bs)
>    {
>        BdrvChild *child;
>        int64_t child_size, sum = 0;
> 
>        QLIST_FOREACH(child, &bs->children, next) {
>            if (child->role & (BDRV_CHILD_DATA | BDRV_CHILD_METADATA |
>                               BDRV_CHILD_FILTERED))
>            {
>                child_size = bdrv_co_get_allocated_file_size(child->bs);
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Well what do we have here?!
> 
> I rest my case, your honor.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>   block.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index 0dd604d0f6..a79297f99b 100644
> --- a/block.c
> +++ b/block.c
> @@ -5749,7 +5749,7 @@ exit:
>    * sums the size of all data-bearing children.  (This excludes backing
>    * children.)
>    */
> -static int64_t bdrv_sum_allocated_file_size(BlockDriverState *bs)
> +static int64_t coroutine_fn bdrv_sum_allocated_file_size(BlockDriverState *bs)
>   {
>       BdrvChild *child;
>       int64_t child_size, sum = 0;

Since there is only 1 call site, maybe worth renaming as
bdrv_co_sum_allocated_file_size() in the same patch?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-09  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 21:14 [PATCH] block: add missing coroutine_fn to bdrv_sum_allocated_file_size() Stefan Hajnoczi
2023-03-09  7:09 ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.