Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sgzerolc authored and Stefan Hajnoczi committed May 15, 2023
1 parent 6c811e1 commit 4f73665
Show file tree
Hide file tree
Showing 3 changed files with 393 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hw/block/virtio-blk-common.c
Expand Up @@ -29,6 +29,8 @@ static const VirtIOFeature feature_sizes[] = {
.end = endof(struct virtio_blk_config, discard_sector_alignment)},
{.flags = 1ULL << VIRTIO_BLK_F_WRITE_ZEROES,
.end = endof(struct virtio_blk_config, write_zeroes_may_unmap)},
{.flags = 1ULL << VIRTIO_BLK_F_ZONED,
.end = endof(struct virtio_blk_config, zoned)},
{}
};

Expand Down

0 comments on commit 4f73665

Please sign in to comment.