virtio-blk: switch off scsi-passthrough by default
PATCH 1/1 virtio-blk: switch off scsi-passthrough by default
Devices that are compliant with virtio-1 do not support scsi passthrough any more (and it has not been a recommended setup anyway for quite some time). To avoid having to switch it off explicitly in newer qemus that turn on virtio-1 by default, let's switch the default to scsi=false for 2.5.
---
Note: this is based upon my s390x series from 10/14, as I otherwise could not test compat on s390x.
--- hw/block/virtio-blk.c | 2 +- hw/s390x/s390-virtio-ccw.c | 4 ++++ include/hw/compat.h | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-)
hw/block/virtio-blk.c +1 -1
@@ -975,7 +975,7 @@ static Property virtio_blk_properties[] = {DEFINE_PROP_STRING ("serial" , VirtIOBlock, conf.serial),DEFINE_PROP_BIT ("config-wce" , VirtIOBlock, conf.config_wce,0 , true), #ifdef __linux__ -DEFINE_PROP_BIT ("scsi" , VirtIOBlock, conf.scsi,0 , true), +DEFINE_PROP_BIT ("scsi" , VirtIOBlock, conf.scsi,0 , false), #endifDEFINE_PROP_BIT ("request-merging" , VirtIOBlock, conf.request_merging,0 , true),
hw/s390x/s390-virtio-ccw.c +4 -0
@@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { .driver = "vhost-scsi-ccw",\ .property = "max_revision",\ .value = "0",\ + },{\ + .driver = "virtio-blk-ccw",\ + .property = "scsi",\ + .value = "true",\ }, static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data)
include/hw/compat.h +5 -1
@@ -2,7 +2,11 @@#define HW_COMPAT_H #define HW_COMPAT_2_4 \ -/* empty */ + {\ + .driver = "virtio-blk-pci",\ + .property = "scsi",\ + .value = "true",\ + },#define HW_COMPAT_2_3 \ {\
Signature · 1 line
2.3.9
Quoted 21 lines · Cornelia Huck
hw/s390x/s390-virtio-ccw.c +4
-0@@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { .driver = "vhost-scsi-ccw",\ .property = "max_revision",\ .value = "0",\ + },{\ + .driver = "virtio-blk-ccw",\ + .property = "scsi",\ + .value = "true",\ }, static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data)include/hw/compat.h +0
-0@@ -2,7 +2,11 @@#define HW_COMPAT_H
include/hw/compat.h line 12
Quoted 10 lines
include/hw/compat.h +5
-1#define HW_COMPAT_2_4 \ -/* empty */ + {\ + .driver = "virtio-blk-pci",\ + .property = "scsi",\ + .value = "true",\ + },#define HW_COMPAT_2_3 \ {\
s390 should use HW_COMPAT_2_4 as well. Otherwise looks good.
Paolo
Quoted 31 lines · Paolo Bonzini
Quoted 28 lines · Cornelia Huck
hw/s390x/s390-virtio-ccw.c +4
-0@@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { .driver = "vhost-scsi-ccw",\ .property = "max_revision",\ .value = "0",\ + },{\ + .driver = "virtio-blk-ccw",\ + .property = "scsi",\ + .value = "true",\ }, static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data)include/hw/compat.h +5
-1@@ -2,7 +2,11 @@#define HW_COMPAT_H #define HW_COMPAT_2_4 \ -/* empty */ + {\ + .driver = "virtio-blk-pci",\ + .property = "scsi",\ + .value = "true",\ + },
Quoted 5 lines
include/hw/compat.h line 12
Quoted 3 lines
include/hw/compat.h +0
-0#define HW_COMPAT_2_3 \ {\s390 should use
HW_COMPAT_2_4as well. Otherwise looks good.
Hmm, ECONCISE probably. Sorry.
I mean that virtio-blk-ccw's scsi property should IMO go in HW_COMPAT_2_4 as well.
But I noticed now that:
* if it works it would be even better if the compat property used virtio-blk-device;
* a new pseries-2.4 machine also needs to be created.
Thanks,
Paolo
Quoted 40 lines · On Fri, 16 Oct 2015 10:46:31 +0200 Paolo Bonzini <[email protected]> wrote:
Quoted 31 lines · Paolo Bonzini
Quoted 28 lines · Cornelia Huck
hw/s390x/s390-virtio-ccw.c +4
-0@@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { .driver = "vhost-scsi-ccw",\ .property = "max_revision",\ .value = "0",\ + },{\ + .driver = "virtio-blk-ccw",\ + .property = "scsi",\ + .value = "true",\ }, static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data)include/hw/compat.h +5
-1@@ -2,7 +2,11 @@#define HW_COMPAT_H #define HW_COMPAT_2_4 \ -/* empty */ + {\ + .driver = "virtio-blk-pci",\ + .property = "scsi",\ + .value = "true",\ + },Quoted 5 lines
include/hw/compat.h line 12
Quoted 3 lines
include/hw/compat.h +0
-0#define HW_COMPAT_2_3 \ {\s390 should use
HW_COMPAT_2_4as well. Otherwise looks good.
Quoted 4 lines
Hmm, ECONCISE probably. Sorry.
I mean that virtio-blk-ccw's scsi property should IMO go in
HW_COMPAT_2_4as well.
I was wondering about the semantics of HW_COMPAT_*: Does any hw-related compat stuff go in there, even if it is architecture specific (like ccw)?
Quoted 5 lines
But I noticed now that:
* if it works it would be even better if the compat property used virtio-blk-device;
Hm. Previous virtio-compat always treated -pci explicitly, but we only gained s390x compat handling with 2.4, so it didn't really matter. But if it works, this is the saner approach.
Quoted 2 lines
* a new pseries-2.4 machine also needs to be created.
Ah, wasn't aware they do compat as well.
Quoted 43 lines · Cornelia Huck
Quoted 40 lines · On Fri, 16 Oct 2015 10:46:31 +0200 Paolo Bonzini <[email protected]> wrote:
Quoted 36 lines · Paolo Bonzini
Quoted 21 lines · Cornelia Huck
hw/s390x/s390-virtio-ccw.c +4
-0@@ -272,6 +272,10 @@ static const TypeInfo ccw_machine_info = { .driver = "vhost-scsi-ccw",\ .property = "max_revision",\ .value = "0",\ + },{\ + .driver = "virtio-blk-ccw",\ + .property = "scsi",\ + .value = "true",\ }, static void ccw_machine_2_4_class_init(ObjectClass *oc, void *data)include/hw/compat.h +0
-0@@ -2,7 +2,11 @@#define HW_COMPAT_H include/hw/compat.h line 12
Quoted 10 lines
include/hw/compat.h +5
-1#define HW_COMPAT_2_4 \ -/* empty */ + {\ + .driver = "virtio-blk-pci",\ + .property = "scsi",\ + .value = "true",\ + },#define HW_COMPAT_2_3 \ {\s390 should use
HW_COMPAT_2_4as well. Otherwise looks good.
Quoted 8 lines
Quoted 4 lines
Hmm, ECONCISE probably. Sorry.
I mean that virtio-blk-ccw's scsi property should IMO go in
HW_COMPAT_2_4as well.I was wondering about the semantics of HW_COMPAT_*: Does any hw-related compat stuff go in there, even if it is architecture specific (like ccw)?
It depends. For stuff like your max_revision I guess it makes sense to keep it in the board. Similarly, x86 CPU flags go in PC_COMPAT_*. But for stuff like virtio-blk-ccw, it makes some sense to keep it close to virtio-blk-pci.
Quoted 8 lines
Quoted 4 lines
But I noticed now that:
* if it works it would be even better if the compat property used virtio-blk-device;
Hm. Previous virtio-compat always treated -pci explicitly, but we only gained s390x compat handling with 2.4, so it didn't really matter. But if it works, this is the saner approach.
Yes, I agree.
Paolo