From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Eric Blake <eblake@redhat.com>, Sunny Zhu <sunnyzhyy@qq.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, kwolf@redhat.com,
hreitz@redhat.com
Subject: Re: [PATCH] block: change type of bytes from int to int64_t for *bdrv_aio_pdiscard
Date: Tue, 22 Apr 2025 09:11:51 +0200 [thread overview]
Message-ID: <292632c9-4492-4071-9100-a7b165af3e97@linaro.org> (raw)
In-Reply-To: <cxsasg7qiopbpwu24a6f2hponb2lv6ut5ylhcpeyagi6g6k2m5@w2c6mwuqi5ik>
Hi Eric,
On 21/4/25 17:03, Eric Blake wrote:
> On Mon, Apr 21, 2025 at 12:19:14AM +0800, Sunny Zhu wrote:
>> Keep it consistent with *bdrv_co_pdiscard.
>>
>> Currently, there is no BlockDriver implemented the bdrv_aio_pdiscard() function,
>> so we don’t need to make any adaptations either.
>
> If there are no drivers implementing the callback, then why have it?
> I think we have been moving towards more coroutine-based callbacks and
> away from the aio callbacks; if so, should we instead be deleting this
> callback as stale code?
Could we add a comment in BlockDriver prototypes about prefering co over
aio implementations, possibly mentioning them as legacy?
>
>>
>> Signed-off-by: Sunny Zhu <sunnyzhyy@qq.com>
>> ---
>> include/block/block_int-common.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h
>> index ebb4e56a50..4bf422d733 100644
>> --- a/include/block/block_int-common.h
>> +++ b/include/block/block_int-common.h
>> @@ -507,7 +507,7 @@ struct BlockDriver {
>> BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque);
>>
>> BlockAIOCB * GRAPH_RDLOCK_PTR (*bdrv_aio_pdiscard)(
>> - BlockDriverState *bs, int64_t offset, int bytes,
>> + BlockDriverState *bs, int64_t offset, int64_t bytes,
>> BlockCompletionFunc *cb, void *opaque);
>>
>> int coroutine_fn GRAPH_RDLOCK_PTR (*bdrv_co_readv)(BlockDriverState *bs,
>> --
>> 2.43.0
>>
>>
>
next prev parent reply other threads:[~2025-04-22 7:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-20 16:19 [PATCH] block: change type of bytes from int to int64_t for *bdrv_aio_pdiscard Sunny Zhu
2025-04-21 15:03 ` Eric Blake
2025-04-21 17:33 ` Sunny Zhu
2025-04-22 7:11 ` Philippe Mathieu-Daudé [this message]
2025-04-24 17:40 ` Eric Blake
2025-04-25 15:36 ` Kevin Wolf
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=292632c9-4492-4071-9100-a7b165af3e97@linaro.org \
--to=philmd@linaro.org \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sunnyzhyy@qq.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).