qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH V2 4/5] virtio-blk: fail the init when both 1.0 and


From: Jason Wang
Subject: [Qemu-devel] [PATCH V2 4/5] virtio-blk: fail the init when both 1.0 and scsi is set
Date: Wed, 15 Jul 2015 13:30:00 +0800

Scsi passthrough was no longer supported in 1.0, so fail the
initialization when user want both features.

Cc: Stefan Hajnoczi <address@hidden>
Cc: Kevin Wolf <address@hidden>
Cc: address@hidden
Signed-off-by: Jason Wang <address@hidden>
---
 hw/block/virtio-blk.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 362fe53..4a0ef68 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -732,6 +732,10 @@ static uint64_t virtio_blk_get_features(VirtIODevice 
*vdev, uint64_t features,
     virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);
     virtio_add_feature(&features, VIRTIO_BLK_F_BLK_SIZE);
     if (s->conf.scsi) {
+        if (__virtio_has_feature(features, VIRTIO_F_VERSION_1)) {
+            error_setg(errp, "Virtio 1.0 does not support scsi passthrough");
+            return 0;
+        }
         virtio_add_feature(&features, VIRTIO_BLK_F_SCSI);
     }
 
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]