summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorShmulik Ladkani <shmulik.ladkani@ravellosystems.com>2015-12-13 10:08:27 +0200
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:19 -0600
commitbb2ccbe3bfe6b81e9978fa46356a6cee6679f6a5 (patch)
tree71a274fb36028491df304f1b8b6b75ff9345072f /hw
parent56257e1df35e5dfba50c25e2d8f59cfcde7a7071 (diff)
downloadhqemu-bb2ccbe3bfe6b81e9978fa46356a6cee6679f6a5.zip
hqemu-bb2ccbe3bfe6b81e9978fa46356a6cee6679f6a5.tar.gz
vmw_pvscsi: Set device subsystem and revision
To be VMware PVSCSI SCSI Controller, rev 02. As reported by the VMware virtual hardware. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Message-Id: <1449994112-7054-2-git-send-email-shmulik.ladkani@ravellosystems.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/scsi/vmw_pvscsi.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 9c71f31..ce099f9 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -52,6 +52,14 @@
#define TYPE_PVSCSI "pvscsi"
#define PVSCSI(obj) OBJECT_CHECK(PVSCSIState, (obj), TYPE_PVSCSI)
+/* Compatability flags for migration */
+#define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT 0
+#define PVSCSI_COMPAT_OLD_PCI_CONFIGURATION \
+ (1 << PVSCSI_COMPAT_OLD_PCI_CONFIGURATION_BIT)
+
+#define PVSCSI_USE_OLD_PCI_CONFIGURATION(s) \
+ ((s)->compat_flags & PVSCSI_COMPAT_OLD_PCI_CONFIGURATION)
+
typedef struct PVSCSIRingInfo {
uint64_t rs_pa;
uint32_t txr_len_mask;
@@ -100,6 +108,8 @@ typedef struct {
PVSCSIRingInfo rings; /* Data transfer rings manager */
uint32_t resetting; /* Reset in progress */
+
+ uint32_t compat_flags;
} PVSCSIState;
typedef struct PVSCSIRequest {
@@ -1069,9 +1079,16 @@ pvscsi_init(PCIDevice *pci_dev)
trace_pvscsi_state("init");
- /* PCI subsystem ID */
- pci_dev->config[PCI_SUBSYSTEM_ID] = 0x00;
- pci_dev->config[PCI_SUBSYSTEM_ID + 1] = 0x10;
+ /* PCI subsystem ID, subsystem vendor ID, revision */
+ if (PVSCSI_USE_OLD_PCI_CONFIGURATION(s)) {
+ pci_set_word(pci_dev->config + PCI_SUBSYSTEM_ID, 0x1000);
+ } else {
+ pci_set_word(pci_dev->config + PCI_SUBSYSTEM_VENDOR_ID,
+ PCI_VENDOR_ID_VMWARE);
+ pci_set_word(pci_dev->config + PCI_SUBSYSTEM_ID,
+ PCI_DEVICE_ID_VMWARE_PVSCSI);
+ pci_config_set_revision(pci_dev->config, 0x2);
+ }
/* PCI latency timer = 255 */
pci_dev->config[PCI_LATENCY_TIMER] = 0xff;
OpenPOWER on IntegriCloud