aboutsummaryrefslogtreecommitdiff
path: root/hw/scsi/scsi-generic.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-04-05 18:09:51 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2018-04-09 16:36:39 +0200
commit2343be0d7ee8a6e02c2bf99d0243492085c8d399 (patch)
tree9b93823a3f0e4283a7082aec69932d49343d6d6a /hw/scsi/scsi-generic.c
parent37c51741892a89cf5710f5ac231091fb0a6352c7 (diff)
scsi-disk: allow customizing the SCSI version
We would like to have different behavior for passthrough devices depending on the SCSI version they expose. To prepare for that, allow the user of emulated devices to specify the desired SCSI level, and adjust the emulation according to the property value. The next patch will set the level for scsi-block and scsi-generic devices. Based on a patch by Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/scsi/scsi-generic.c')
-rw-r--r--hw/scsi/scsi-generic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 4753f8738f..1870085762 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -474,6 +474,7 @@ static void scsi_generic_reset(DeviceState *dev)
{
SCSIDevice *s = SCSI_DEVICE(dev);
+ s->scsi_version = s->default_scsi_version;
scsi_device_purge_requests(s, SENSE_CODE(RESET));
}