From: Stefan Hajnoczi <stefanha@redhat.com>
To: Sam Li <faithilikerun@gmail.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
qemu-devel@nongnu.org, Fam Zheng <fam@euphon.net>,
Hanna Reitz <hreitz@redhat.com>,
damien.lemoal@opensource.wdc.com, qemu-block@nongnu.org,
Markus Armbruster <armbru@redhat.com>,
hare@suse.de, Kevin Wolf <kwolf@redhat.com>,
dmitry.fomichev@wdc.com, Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH v13 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls
Date: Mon, 5 Dec 2022 11:15:32 -0500 [thread overview]
Message-ID: <Y44ZJI4L7BkjbYUt@fedora> (raw)
In-Reply-To: <CAAAx-8J6AMfPjuoPYb6LBSY8fiKRMCet+CdK1o_UcwFQ1sq1NA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2211 bytes --]
On Mon, Dec 05, 2022 at 09:24:28PM +0800, Sam Li wrote:
> Stefan Hajnoczi <stefanha@redhat.com> 于2022年12月5日周一 20:20写道:
> >
> > On Wed, Nov 30, 2022 at 10:24:10AM +0800, Sam Li wrote:
> > > Stefan Hajnoczi <stefanha@gmail.com> 于2022年11月30日周三 10:01写道:
> > > > On Thu, 27 Oct 2022 at 11:46, Sam Li <faithilikerun@gmail.com> wrote:
> > > > > @@ -1374,9 +1428,11 @@ static int hdev_probe_blocksizes(BlockDriverState *bs, BlockSizes *bsz)
> > > > > int ret;
> > > > >
> > > > > /* If DASD, get blocksizes */
> > > > > +#ifndef CONFIG_BLKZONED
> > > > > if (check_for_dasd(s->fd) < 0) {
> > > > > return -ENOTSUP;
> > > > > }
> > > > > +#endif
> > > >
> > > > What is the purpose of this #ifndef? .bdrv_probe_blocksizes() should
> > > > only return block sizes for s390 DASD devices. I don't think zoned
> > > > storage needs block size probing here.
> > >
> > > Zoned storage needs to be virtualized with the correct physical block
> > > size and logical block size. And the probing here can guarantee that.
> > > Or virtio-blk may send wrong block size to the guest. If manually set
> > > block size in the command line as before, it is somewhat inaccurate.
> >
> > I see. I/O won't work if the guest block size differs from the physical
> > zoned device's block size.
> >
> > However, we must not do this for regular host_device BlockDriverStates.
> > The block size is manually controlled from those devices and defaults to
> > 512B. That way the blocksize doesn't change across live migration and
> > break the guest.
> >
> > Please use a run-time check instead of an #ifdef. Only probe blocksizes
> > for dasd and zoned devices.
>
> I see. Like this?
>
> #ifndef CONFIG_BLKZONED
> static int hdev_probe_zbd_blocksizes(BlockDriverState *bs, BlockSizes *bsz){
> int ret;
> /* check zbd */
> ...
> /* probe zbd */
> .... }
> +#endif
Yes, I think that's the cleanest option.
You don't need to check if it's a ZBD. Only the zoned_host_device driver
will use this .bdrv_probe_blocksizes() callback. The regular host_device
driver will use hdev_probe_blocksizes().
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-12-05 16:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-27 15:44 [PATCH v13 0/8] Add support for zoned device Sam Li
2022-10-27 15:44 ` [PATCH v13 1/8] include: add zoned device structs Sam Li
2022-10-27 15:44 ` [PATCH v13 2/8] file-posix: introduce helper functions for sysfs attributes Sam Li
2022-10-27 15:44 ` [PATCH v13 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls Sam Li
2022-11-30 2:01 ` Stefan Hajnoczi
2022-11-30 2:24 ` Sam Li
2022-12-05 12:18 ` Stefan Hajnoczi
2022-12-05 13:24 ` Sam Li
2022-12-05 16:15 ` Stefan Hajnoczi [this message]
2022-10-27 15:45 ` [PATCH v13 4/8] raw-format: add zone operations to pass through requests Sam Li
2022-10-27 15:45 ` [PATCH v13 5/8] config: add check to block layer Sam Li
2022-10-27 15:45 ` [PATCH v13 6/8] qemu-iotests: test new zone operations Sam Li
2022-10-27 15:45 ` [PATCH v13 7/8] block: add some trace events for new block layer APIs Sam Li
2022-11-30 2:02 ` Stefan Hajnoczi
2022-10-27 15:45 ` [PATCH v13 8/8] docs/zoned-storage: add zoned device documentation Sam Li
2022-11-30 2:04 ` [PATCH v13 0/8] Add support for zoned device Stefan Hajnoczi
2022-11-30 2:25 ` Sam Li
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=Y44ZJI4L7BkjbYUt@fedora \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=damien.lemoal@opensource.wdc.com \
--cc=dmitry.fomichev@wdc.com \
--cc=eblake@redhat.com \
--cc=faithilikerun@gmail.com \
--cc=fam@euphon.net \
--cc=hare@suse.de \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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 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.