All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Sam Li <faithilikerun@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Hannes Reinecke <hare@suse.de>, Fam Zheng <fam@euphon.net>,
	Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>,
	Dmitry Fomichev <dmitry.fomichev@wdc.com>,
	qemu block <qemu-block@nongnu.org>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>
Subject: Re: [PATCH v7 6/8] config: add check to block layer
Date: Tue, 23 Aug 2022 08:36:47 -0400	[thread overview]
Message-ID: <YwTJ3+UGNrBrK5KH@fedora> (raw)
In-Reply-To: <CAAAx-8LMr3wCghUMPXSJkoOXffP8OvYa9CNNs7xtr2rUaR=heQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2305 bytes --]

On Tue, Aug 23, 2022 at 12:25:23PM +0800, Sam Li wrote:
> Stefan Hajnoczi <stefanha@redhat.com> 于2022年8月23日周二 08:54写道:
> >
> > On Tue, Aug 16, 2022 at 02:25:20PM +0800, Sam Li wrote:
> > > Putting zoned/non-zoned BlockDrivers on top of each other is not
> > > allowed.
> > >
> > > Signed-off-by: Sam Li <faithilikerun@gmail.com>
> > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > ---
> > >  block.c                          | 14 ++++++++++++++
> > >  block/raw-format.c               |  1 +
> > >  include/block/block_int-common.h |  5 +++++
> > >  3 files changed, 20 insertions(+)
> > >
> > > diff --git a/block.c b/block.c
> > > index bc85f46eed..affe6c597e 100644
> > > --- a/block.c
> > > +++ b/block.c
> > > @@ -7947,6 +7947,20 @@ void bdrv_add_child(BlockDriverState *parent_bs, BlockDriverState *child_bs,
> > >          return;
> > >      }
> > >
> > > +    /*
> > > +     * Non-zoned block drivers do not follow zoned storage constraints
> > > +     * (i.e. sequential writes to zones). Refuse mixing zoned and non-zoned
> > > +     * drivers in a graph.
> > > +     */
> > > +    if (!parent_bs->drv->supports_zoned_children &&
> > > +        child_bs->bl.zoned != BLK_Z_HM) {
> >
> 
> Should be:
> +if (!parent_bs->drv->supports_zoned_children &&
> +        child_bs->bl.zoned == BLK_Z_HM)
> 
> > Is this logical expression correct:
> >
> >   If the parent does not support zoned children and the child is not
> >   zoned, fail with an error.
> >
> > ?
> 
> No. It should be:
> 
> If the parent does not support zoned children and the child is zoned,
> fail with an error.  It should handle the case where a filter node is
> inserted above a raw block driver with a zoned_host_device child.
> 
> There are some QEMU command-line constraints for the zoned devices. I
> was wondering where to add such support so that it can print an error
> message for users:
> 1. cache.direct= setting

The O_DIRECT requirement is specific to file-posix and Linux's zoned
block device implementation, so it belongs in file-posix.c's
zoned_host_device .bdrv_file_open() function.

> 2. mix zoned/non-zoned drivers

This is generic and I think bdrv_add_child() is the right place for
parent-child compatibility checks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-08-23 12:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16  6:25 [PATCH v7 0/8] Add support for zoned device Sam Li
2022-08-16  6:25 ` [PATCH v7 1/8] include: add zoned device structs Sam Li
2022-08-16 17:27   ` Damien Le Moal
2022-08-16  6:25 ` [PATCH v7 2/8] file-posix: introduce get_sysfs_str_val for device zoned model Sam Li
2022-08-16 16:11   ` Sam Li
2022-08-16 17:32   ` Damien Le Moal
2022-08-22 23:05   ` Stefan Hajnoczi
2022-08-23  4:31     ` Sam Li
2022-08-16  6:25 ` [PATCH v7 3/8] file-posix: introduce get_sysfs_long_val for the long sysfs attribute Sam Li
2022-08-16 16:13   ` Sam Li
2022-08-16 17:35   ` Damien Le Moal
2022-08-16 17:53     ` Sam Li
2022-08-16 17:55       ` Damien Le Moal
2022-08-16  6:25 ` [PATCH v7 4/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls Sam Li
2022-08-16 17:50   ` Damien Le Moal
2022-08-26 12:20     ` Sam Li
2022-08-23  0:49   ` Stefan Hajnoczi
2022-08-23  4:12     ` Sam Li
2022-08-23 12:40       ` Stefan Hajnoczi
2022-08-24 23:46       ` Damien Le Moal
2022-08-24 23:53         ` Damien Le Moal
2022-08-16  6:25 ` [PATCH v7 5/8] raw-format: add zone operations to pass through requests Sam Li
2022-08-16  6:25 ` [PATCH v7 6/8] config: add check to block layer Sam Li
2022-08-23  0:54   ` Stefan Hajnoczi
2022-08-23  4:25     ` Sam Li
2022-08-23 12:36       ` Stefan Hajnoczi [this message]
2022-08-16  6:25 ` [PATCH v7 7/8] qemu-iotests: test new zone operations Sam Li
2022-08-16  6:25 ` [PATCH v7 8/8] docs/zoned-storage: add zoned device documentation 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=YwTJ3+UGNrBrK5KH@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 \
    /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.