virtio-blk: add zoned storage emulation for zoned devices
authorSam Li <faithilikerun@gmail.com>
Mon, 8 May 2023 05:19:13 +0000 (13:19 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 May 2023 12:18:10 +0000 (08:18 -0400)
commit4f7366506a96c862c796d4ea1913110d9c341e7d
tree3374f38968c1b615e272ae9603812357fd335d17
parent6c811e19bb61213cf62018dc137036603af71ad0
virtio-blk: add zoned storage emulation for zoned devices

This patch extends virtio-blk emulation to handle zoned device commands
by calling the new block layer APIs to perform zoned device I/O on
behalf of the guest. It supports Report Zone, four zone oparations (open,
close, finish, reset), and Append Zone.

The VIRTIO_BLK_F_ZONED feature bit will only be set if the host does
support zoned block devices. Regular block devices(conventional zones)
will not be set.

The guest os can use blktests, fio to test those commands on zoned devices.
Furthermore, using zonefs to test zone append write is also supported.

Signed-off-by: Sam Li <faithilikerun@gmail.com>
Message-id: 20230508051916.178322-2-faithilikerun@gmail.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/block/virtio-blk-common.c
hw/block/virtio-blk.c
hw/virtio/virtio-qmp.c