From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
"Julia Suvorova" <jusual@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Aarushi Mehta" <mehta.aaru20@gmail.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Richard Henderson" <rth@twiddle.net>,
"Kevin Wolf" <kwolf@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Stefano Garzarella" <sgarzare@redhat.com>,
qemu-block@nongnu.org, "Hanna Reitz" <hreitz@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
kvm@vger.kernel.org, "Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Sam Li" <faithilikerun@gmail.com>,
"Damien Le Moal" <damien.lemoal@opensource.wdc.com>,
"Dmitry Fomichev" <dmitry.fomichev@wdc.com>
Subject: [PULL 08/17] docs/zoned-storage: add zoned device documentation
Date: Fri, 28 Apr 2023 08:39:45 -0400 [thread overview]
Message-ID: <20230428123954.179035-9-stefanha@redhat.com> (raw)
In-Reply-To: <20230428123954.179035-1-stefanha@redhat.com>
From: Sam Li <faithilikerun@gmail.com>
Add the documentation about the zoned device support to virtio-blk
emulation.
Signed-off-by: Sam Li <faithilikerun@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20230427172019.3345-9-faithilikerun@gmail.com
Message-id: 20230324090605.28361-9-faithilikerun@gmail.com
[Add index-api.rst to fix "zoned-storage.rst:document isn't included in
any toctree" error and fix pre-formatted command-line indentation.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
docs/devel/index-api.rst | 1 +
docs/devel/zoned-storage.rst | 43 ++++++++++++++++++++++++++
docs/system/qemu-block-drivers.rst.inc | 6 ++++
3 files changed, 50 insertions(+)
create mode 100644 docs/devel/zoned-storage.rst
diff --git a/docs/devel/index-api.rst b/docs/devel/index-api.rst
index 60c0d7459d..7108821746 100644
--- a/docs/devel/index-api.rst
+++ b/docs/devel/index-api.rst
@@ -12,3 +12,4 @@ generated from in-code annotations to function prototypes.
memory
modules
ui
+ zoned-storage
diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned-storage.rst
new file mode 100644
index 0000000000..da78db2783
--- /dev/null
+++ b/docs/devel/zoned-storage.rst
@@ -0,0 +1,43 @@
+=============
+zoned-storage
+=============
+
+Zoned Block Devices (ZBDs) divide the LBA space into block regions called zones
+that are larger than the LBA size. They can only allow sequential writes, which
+can reduce write amplification in SSDs, and potentially lead to higher
+throughput and increased capacity. More details about ZBDs can be found at:
+
+https://zonedstorage.io/docs/introduction/zoned-storage
+
+1. Block layer APIs for zoned storage
+-------------------------------------
+QEMU block layer supports three zoned storage models:
+- BLK_Z_HM: The host-managed zoned model only allows sequential writes access
+to zones. It supports ZBD-specific I/O commands that can be used by a host to
+manage the zones of a device.
+- BLK_Z_HA: The host-aware zoned model allows random write operations in
+zones, making it backward compatible with regular block devices.
+- BLK_Z_NONE: The non-zoned model has no zones support. It includes both
+regular and drive-managed ZBD devices. ZBD-specific I/O commands are not
+supported.
+
+The block device information resides inside BlockDriverState. QEMU uses
+BlockLimits struct(BlockDriverState::bl) that is continuously accessed by the
+block layer while processing I/O requests. A BlockBackend has a root pointer to
+a BlockDriverState graph(for example, raw format on top of file-posix). The
+zoned storage information can be propagated from the leaf BlockDriverState all
+the way up to the BlockBackend. If the zoned storage model in file-posix is
+set to BLK_Z_HM, then block drivers will declare support for zoned host device.
+
+The block layer APIs support commands needed for zoned storage devices,
+including report zones, four zone operations, and zone append.
+
+2. Emulating zoned storage controllers
+--------------------------------------
+When the BlockBackend's BlockLimits model reports a zoned storage device, users
+like the virtio-blk emulation or the qemu-io-cmds.c utility can use block layer
+APIs for zoned storage emulation or testing.
+
+For example, to test zone_report on a null_blk device using qemu-io is::
+
+ $ path/to/qemu-io --image-opts -n driver=host_device,filename=/dev/nullb0 -c "zrp offset nr_zones"
diff --git a/docs/system/qemu-block-drivers.rst.inc b/docs/system/qemu-block-drivers.rst.inc
index dfe5d2293d..105cb9679c 100644
--- a/docs/system/qemu-block-drivers.rst.inc
+++ b/docs/system/qemu-block-drivers.rst.inc
@@ -430,6 +430,12 @@ Hard disks
you may corrupt your host data (use the ``-snapshot`` command
line option or modify the device permissions accordingly).
+Zoned block devices
+ Zoned block devices can be passed through to the guest if the emulated storage
+ controller supports zoned storage. Use ``--blockdev host_device,
+ node-name=drive0,filename=/dev/nullb0,cache.direct=on`` to pass through
+ ``/dev/nullb0`` as ``drive0``.
+
Windows
^^^^^^^
--
2.40.0
next prev parent reply other threads:[~2023-04-28 12:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 12:39 [PULL 00/17] Block patches Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 01/17] block/block-common: add zoned device structs Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 02/17] block/file-posix: introduce helper functions for sysfs attributes Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 03/17] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 04/17] block/raw-format: add zone operations to pass through requests Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 05/17] block: add zoned BlockDriver check to block layer Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 06/17] iotests: test new zone operations Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 07/17] block: add some trace events for new block layer APIs Stefan Hajnoczi
2023-04-28 12:39 ` Stefan Hajnoczi [this message]
2023-04-28 12:39 ` [PULL 09/17] file-posix: add tracking of the zone write pointers Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 10/17] block: introduce zone append write for zoned devices Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 11/17] qemu-iotests: test zone append operation Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 12/17] block: add some trace events for zone append Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 13/17] include: update virtio_blk headers to v6.3-rc1 Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 14/17] virtio-blk: add zoned storage emulation for zoned devices Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 15/17] block: add accounting for zone append operation Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 16/17] virtio-blk: add some trace events for zoned emulation Stefan Hajnoczi
2023-04-28 12:39 ` [PULL 17/17] docs/zoned-storage:add zoned emulation use case Stefan Hajnoczi
2023-04-29 22:05 ` [PULL 00/17] Block patches Richard Henderson
2023-05-01 11:56 ` 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=20230428123954.179035-9-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=cohuck@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=hreitz@redhat.com \
--cc=jusual@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mehta.aaru20@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=raphael.norwitz@nutanix.com \
--cc=rth@twiddle.net \
--cc=sgarzare@redhat.com \
--cc=thuth@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).