diff mbox series

[v9,5/5] docs/zoned-storage:add zoned emulation use case

Message ID 20230324105418.3752-2-faithilikerun@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v9,1/5] include: update virtio_blk headers to v6.3-rc1 | expand

Commit Message

Sam Li March 24, 2023, 10:54 a.m. UTC
Add the documentation about the example of using virtio-blk driver
to pass the zoned block devices through to the guest.

Signed-off-by: Sam Li <faithilikerun@gmail.com>
---
 docs/devel/zoned-storage.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Sam Li March 24, 2023, 12:05 p.m. UTC | #1
Sam Li <faithilikerun@gmail.com> 于2023年3月24日周五 18:54写道:
>
> Add the documentation about the example of using virtio-blk driver
> to pass the zoned block devices through to the guest.
>
> Signed-off-by: Sam Li <faithilikerun@gmail.com>
> ---
>  docs/devel/zoned-storage.rst | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>
> diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned-storage.rst
> index 6a36133e51..05ecf3729c 100644
> --- a/docs/devel/zoned-storage.rst
> +++ b/docs/devel/zoned-storage.rst
> @@ -41,3 +41,20 @@ 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"
> +
> +To expose the host's zoned block device through virtio-blk, the command line
> +can be (includes the -device parameter):
> +    -blockdev node-name=drive0,driver=host_device,filename=/dev/nullb0,
> +    cache.direct=on \
> +    -device virtio-blk-pci,drive=drive0
> +Or only use the -drive parameter:
> +    -driver driver=host_device,file=/dev/nullb0,if=virtio,cache.direct=on
> +
> +Additionally, QEMU has several ways of supporting zoned storage, including:
> +(1) Using virtio-scsi: --device scsi-block allows for the passing through of
> +SCSI ZBC devices, enabling the attachment of ZBC or ZAC HDDs to QEMU.
> +(2) PCI device pass-through: While NVMe ZNS emulation is available for testing
> +purposes, it cannot yet pass through a zoned device from the host. To pass on
> +the NVMe ZNS device to the guest, use VFIO PCI pass the entire NVMe PCI adapter
> +through to the guest. Likewise, an HDD HBA can be passed on to QEMU all HDDs
> +attached to the HBA.
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/docs/devel/zoned-storage.rst b/docs/devel/zoned-storage.rst
index 6a36133e51..05ecf3729c 100644
--- a/docs/devel/zoned-storage.rst
+++ b/docs/devel/zoned-storage.rst
@@ -41,3 +41,20 @@  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"
+
+To expose the host's zoned block device through virtio-blk, the command line
+can be (includes the -device parameter):
+    -blockdev node-name=drive0,driver=host_device,filename=/dev/nullb0,
+    cache.direct=on \
+    -device virtio-blk-pci,drive=drive0
+Or only use the -drive parameter:
+    -driver driver=host_device,file=/dev/nullb0,if=virtio,cache.direct=on
+
+Additionally, QEMU has several ways of supporting zoned storage, including:
+(1) Using virtio-scsi: --device scsi-block allows for the passing through of
+SCSI ZBC devices, enabling the attachment of ZBC or ZAC HDDs to QEMU.
+(2) PCI device pass-through: While NVMe ZNS emulation is available for testing
+purposes, it cannot yet pass through a zoned device from the host. To pass on
+the NVMe ZNS device to the guest, use VFIO PCI pass the entire NVMe PCI adapter
+through to the guest. Likewise, an HDD HBA can be passed on to QEMU all HDDs
+attached to the HBA.