Skip to content

Commit

Permalink
virtio-blk: add zoned storage emulation for zoned devices
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230407082528.18841-3-faithilikerun@gmail.com>
  • Loading branch information
sgzerolc authored and stefanhaRH committed Apr 28, 2023
1 parent e730704 commit bf3b8ac
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 bf3b8ac

Please sign in to comment.