qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [PATCH] block: add missing coroutine_fn to bdrv_sum_allocated_file_size()
Date: Thu, 9 Mar 2023 08:09:11 +0100	[thread overview]
Message-ID: <6d60991b-f9f6-0f2f-7da1-cf1cce61cb42@linaro.org> (raw)
In-Reply-To: <20230308211435.346375-1-stefanha@redhat.com>

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?


      reply	other threads:[~2023-03-09  7:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d60991b-f9f6-0f2f-7da1-cf1cce61cb42@linaro.org \
    --to=philmd@linaro.org \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).