qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Garzarella <sgarzare@redhat.com>
To: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, "Michael S . Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property
Date: Fri, 6 Sep 2019 10:11:17 +0200	[thread overview]
Message-ID: <20190906081117.asr67hq26eqqooxd@steredhat> (raw)
In-Reply-To: <20190904210100.10501-2-dmitry.fomichev@wdc.com>

On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote:
> This commit adds Zoned Device Model (as defined in T10 ZBC and
> T13 ZAC standards) as a block driver property, along with some
> useful access functions.
> 
> A new backend driver permission, BLK_PERM_SUPPORT_HM_ZONED, is also
> introduced. Only the drivers having this permission will be allowed
> to open host managed zoned block devices.
> 
> No code is added yet to initialize or check the value of this new
> property, therefore this commit doesn't change any functionality.
> 
> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> ---
>  block.c                   | 15 +++++++++++++++
>  include/block/block.h     | 19 ++++++++++++++++++-
>  include/block/block_int.h |  3 +++
>  3 files changed, 36 insertions(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index 874a29a983..69f565e1e9 100644
> --- a/block.c
> +++ b/block.c
> @@ -4679,6 +4679,21 @@ void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr)
>      *nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors;
>  }
>  
> +BdrvZonedModel bdrv_get_zoned_model(BlockDriverState *bs)
> +{
> +    return bs->bl.zoned_model;
> +}
> +
> +bool bdrv_is_hm_zoned(BlockDriverState *bs)
> +{
> +    /*
> +     * Host Aware zone devices are supposed to be able to work
> +     * just like regular block devices. Thus, we only consider
> +     * Host Managed devices to be zoned here.
> +     */
> +    return bdrv_get_zoned_model(bs) == BDRV_ZONED_MODEL_HM;
> +}
> +
>  bool bdrv_is_sg(BlockDriverState *bs)
>  {
>      return bs->sg;
> diff --git a/include/block/block.h b/include/block/block.h
> index 124ad40809..28d065ed80 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -271,18 +271,33 @@ enum {
>       */
>      BLK_PERM_GRAPH_MOD          = 0x10,
>  
> +    /**
> +     * This permission is required to open host-managed zoned block devices.
> +     */
> +    BLK_PERM_SUPPORT_HM_ZONED   = 0x20,
> +
>      BLK_PERM_ALL                = 0x1f,

Should we update BLK_PERM_ALL to 0x3f?

Thanks,
Stefano



  reply	other threads:[~2019-09-06  8:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 21:00 [Qemu-devel] [PATCH v6 0/4] virtio/block: handle zoned backing devices Dmitry Fomichev
2019-09-04 21:00 ` [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property Dmitry Fomichev
2019-09-06  8:11   ` Stefano Garzarella [this message]
2019-09-06 16:17     ` Dmitry Fomichev
2019-09-06 21:10       ` Stefano Garzarella
2019-09-06 21:21         ` Dmitry Fomichev
2019-09-04 21:00 ` [Qemu-devel] [PATCH v6 2/4] raw: Recognize zoned backing devices Dmitry Fomichev
2019-09-04 21:00 ` [Qemu-devel] [PATCH v6 3/4] block/ide/scsi: Set BLK_PERM_SUPPORT_HM_ZONED Dmitry Fomichev
2019-09-04 21:01 ` [Qemu-devel] [PATCH v6 4/4] raw: Don't open ZBDs if backend can't handle them Dmitry Fomichev
2019-09-05 15:42 ` [Qemu-devel] [PATCH v6 0/4] virtio/block: handle zoned backing devices Stefan Hajnoczi

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=20190906081117.asr67hq26eqqooxd@steredhat \
    --to=sgarzare@redhat.com \
    --cc=alistair.francis@wdc.com \
    --cc=dmitry.fomichev@wdc.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@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).