diff mbox series

[4/4] hw/scsi: Don't realize zoned block devices for virtio-scsi legacy drivers

Message ID 20190709203806.17550-5-dmitry.fomichev@wdc.com (mailing list archive)
State New, archived
Headers show
Series virtio: handle zoned backing devices | expand

Commit Message

Dmitry Fomichev July 9, 2019, 8:38 p.m. UTC
From: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

Prevent scsi-hd and scsi-disk drivers from attaching a zoned block device
because it will appear as a regular block device at the guest and will
most certainly cause problems.

The functionality to support ZBDs is not planned for scsi-hd and
scsi-disk legacy drivers. It is supported via scsi-generic driver already
and discussion is ongoing for scsi-block driver.

Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
---
 hw/scsi/scsi-disk.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index ed7295bfd7..80682a61fb 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2401,6 +2401,11 @@  static void scsi_hd_realize(SCSIDevice *dev, Error **errp)
      * backend will be issued in scsi_realize
      */
     if (s->qdev.conf.blk) {
+        if (blk_is_zoned(s->qdev.conf.blk)) {
+            error_setg(errp, "zoned block devices are not supported");
+            return;
+        }
+
         ctx = blk_get_aio_context(s->qdev.conf.blk);
         aio_context_acquire(ctx);
         blkconf_blocksizes(&s->qdev.conf);