Prevent virtio-blk code from attaching a zoned block device because it will otherwise appear as a reqular block device at the guest and that will most certainly cause problems.
The functionality to support ZBDs via virtio-blk should be pretty useful and there are some attempts underway to get it implemented, but such work will inevitably lead to some modifications in virtio protocol spec. Therefore, this activity is considered a more long-term effort. So for now, we just don't allow zoned block devices to work via virtio-blk. Signed-off-by: Dmitry Fomichev <dmitry.fomic...@wdc.com> --- hw/block/virtio-blk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index cbb3729158..c11e028308 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -1140,6 +1140,11 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp) return; } + if (blk_is_zoned(conf->conf.blk)) { + error_setg(errp, "zoned block devices are not supported"); + return; + } + if (virtio_has_feature(s->host_features, VIRTIO_BLK_F_DISCARD) && (!conf->max_discard_sectors || conf->max_discard_sectors > BDRV_REQUEST_MAX_SECTORS)) { -- 2.21.0