summaryrefslogtreecommitdiffstats
path: root/hw/pci/pci.c
diff options
context:
space:
mode:
authorPeter Maydell2018-10-12 12:00:07 +0200
committerPeter Maydell2018-10-12 12:00:07 +0200
commit05b656dcaa62bd91c97bcfd335a2802f2a2d678d (patch)
tree66e05da35ffb20d3229130fb7ec3ade8bbb55c86 /hw/pci/pci.c
parentMerge remote-tracking branch 'remotes/armbru/tags/pull-misc-2018-10-10' into ... (diff)
parentmigration-test: Only generate a single target architecture (diff)
downloadqemu-05b656dcaa62bd91c97bcfd335a2802f2a2d678d.tar.gz
qemu-05b656dcaa62bd91c97bcfd335a2802f2a2d678d.tar.xz
qemu-05b656dcaa62bd91c97bcfd335a2802f2a2d678d.zip
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-migration-20181011a' into staging
Migration pull 2018-10-11 With one bonus HMP fix. # gpg: Signature made Thu 11 Oct 2018 20:23:12 BST # gpg: using RSA key 0516331EBC5BFDE7 # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A 9FA9 0516 331E BC5B FDE7 * remotes/dgilbert/tags/pull-migration-20181011a: migration-test: Only generate a single target architecture qmp, hmp: make subsystem/system-vendor identities optional vhost-user: Don't ask for reply on postcopy mem table set vhost-user: Fix userfaultfd leak migration: Stop postcopy fault thread before notifying tests/migration: Enable the migration test on s390x, too tests: Add migration test for aarch64 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r--hw/pci/pci.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 51d0dec466..b937f0dc0a 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1737,9 +1737,6 @@ static PciDeviceInfo *qmp_query_pci_device(PCIDevice *dev, PCIBus *bus,
info->id = g_new0(PciDeviceId, 1);
info->id->vendor = pci_get_word(dev->config + PCI_VENDOR_ID);
info->id->device = pci_get_word(dev->config + PCI_DEVICE_ID);
- info->id->subsystem = pci_get_word(dev->config + PCI_SUBSYSTEM_ID);
- info->id->subsystem_vendor =
- pci_get_word(dev->config + PCI_SUBSYSTEM_VENDOR_ID);
info->regions = qmp_query_pci_regions(dev);
info->qdev_id = g_strdup(dev->qdev.id ? dev->qdev.id : "");
@@ -1752,6 +1749,16 @@ static PciDeviceInfo *qmp_query_pci_device(PCIDevice *dev, PCIBus *bus,
if (type == PCI_HEADER_TYPE_BRIDGE) {
info->has_pci_bridge = true;
info->pci_bridge = qmp_query_pci_bridge(dev, bus, bus_num);
+ } else if (type == PCI_HEADER_TYPE_NORMAL) {
+ info->id->has_subsystem = info->id->has_subsystem_vendor = true;
+ info->id->subsystem = pci_get_word(dev->config + PCI_SUBSYSTEM_ID);
+ info->id->subsystem_vendor =
+ pci_get_word(dev->config + PCI_SUBSYSTEM_VENDOR_ID);
+ } else if (type == PCI_HEADER_TYPE_CARDBUS) {
+ info->id->has_subsystem = info->id->has_subsystem_vendor = true;
+ info->id->subsystem = pci_get_word(dev->config + PCI_CB_SUBSYSTEM_ID);
+ info->id->subsystem_vendor =
+ pci_get_word(dev->config + PCI_CB_SUBSYSTEM_VENDOR_ID);
}
return info;