From d905ccc97f9e206acc67b1ab85e911dcd80ccb45 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <14b740b7e3fbafdbfe2e6a302f51d6aa4fa96bf7.1350309834.git.minovotn@redhat.com> References: <14b740b7e3fbafdbfe2e6a302f51d6aa4fa96bf7.1350309834.git.minovotn@redhat.com> From: Paolo Bonzini Date: Fri, 12 Oct 2012 16:22:47 +0200 Subject: [PATCH 15/17] virtio-scsi: add backwards-compatibility properties for 6.3 and earlier machines RH-Author: Paolo Bonzini Message-id: <1350058967-27351-11-git-send-email-pbonzini@redhat.com> Patchwork-id: 43066 O-Subject: [RHEL 6.4 qemu-kvm PATCH v2 10/10] virtio-scsi: add backwards-compatibility properties for 6.3 and earlier machines Bugzilla: 808660 RH-Acked-by: Markus Armbruster RH-Acked-by: Laszlo Ersek RH-Acked-by: Orit Wasserman Bugzilla: 808660 Hotplug and parameter change are new in 6.4, disable them via compat properties for rhel6.3.0 and earlier. Signed-off-by: Paolo Bonzini (cherry-picked from commit 07a5298c3067ed63f7d82d8c1a6f479146447289) --- hw/pc.c | 8 ++++++++ hw/virtio-scsi.c | 7 ------- hw/virtio-scsi.h | 9 ++++++++- 3 file modificati, 16 inserzioni(+), 8 rimozioni(-) Signed-off-by: Michal Novotny --- hw/pc.c | 8 ++++++++ hw/virtio-scsi.c | 7 ------- hw/virtio-scsi.h | 9 ++++++++- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 957dec1..7d73146 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -1567,6 +1567,14 @@ static void rhel_common_init(const char *type1_version, .property = "create_unique_serial",\ .value = "0",\ },{\ + .driver = "virtio-scsi-pci",\ + .property = "hotplug",\ + .value = "off",\ + },{\ + .driver = "virtio-scsi-pci",\ + .property = "param_change",\ + .value = "off",\ + },{\ .driver = "qxl-vga",\ .property = "revision",\ .value = stringify(3),\ diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c index fd9dae8..cfb9764 100644 --- a/hw/virtio-scsi.c +++ b/hw/virtio-scsi.c @@ -25,11 +25,6 @@ #define VIRTIO_SCSI_MAX_TARGET 255 #define VIRTIO_SCSI_MAX_LUN 16383 -/* Feature Bits */ -#define VIRTIO_SCSI_F_INOUT 0 -#define VIRTIO_SCSI_F_HOTPLUG 1 -#define VIRTIO_SCSI_F_CHANGE 2 - /* Response codes */ #define VIRTIO_SCSI_S_OK 0 #define VIRTIO_SCSI_S_OVERRUN 1 @@ -561,8 +556,6 @@ static void virtio_scsi_set_config(VirtIODevice *vdev, static uint32_t virtio_scsi_get_features(VirtIODevice *vdev, uint32_t requested_features) { - requested_features |= (1UL << VIRTIO_SCSI_F_HOTPLUG); - requested_features |= (1UL << VIRTIO_SCSI_F_CHANGE); return requested_features; } diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h index 4bc889d..91924f6 100644 --- a/hw/virtio-scsi.h +++ b/hw/virtio-scsi.h @@ -21,6 +21,11 @@ /* The ID for virtio_scsi */ #define VIRTIO_ID_SCSI 8 +/* Feature Bits */ +#define VIRTIO_SCSI_F_INOUT 0 +#define VIRTIO_SCSI_F_HOTPLUG 1 +#define VIRTIO_SCSI_F_CHANGE 2 + struct VirtIOSCSIConf { uint32_t num_queues; uint32_t max_sectors; @@ -31,6 +36,8 @@ struct VirtIOSCSIConf { DEFINE_VIRTIO_COMMON_FEATURES(_state, _features_field), \ DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \ DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, 0xFFFF), \ - DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128) + DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128), \ + DEFINE_PROP_BIT("hotplug", _state, _features_field, VIRTIO_SCSI_F_HOTPLUG, true), \ + DEFINE_PROP_BIT("param_change", _state, _features_field, VIRTIO_SCSI_F_CHANGE, true) #endif /* _QEMU_VIRTIO_SCSI_H */ -- 1.7.11.7