summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorDenis V. Lunev2018-09-18 11:58:52 +0200
committerDr. David Alan Gilbert2018-09-25 15:48:44 +0200
commit5383a705207790bbd82516b3665ba7d99522ce4a (patch)
treee082d036c21103549c910160689390062d297834 /hw
parenthmp: fix migrate status timer leak (diff)
downloadqemu-5383a705207790bbd82516b3665ba7d99522ce4a.tar.gz
qemu-5383a705207790bbd82516b3665ba7d99522ce4a.tar.xz
qemu-5383a705207790bbd82516b3665ba7d99522ce4a.zip
qmp, hmp: add PCI subsystem id and vendor id to PCI info
This is a long story. Red Hat has relicensed Windows KVM device drivers in 2018 and there was an agreement that to avoid WHQL driver conflict software manufacturers should set proper PCI subsystem vendor ID in their distributions. Thus PCI subsystem vendor id becomes actively used. The problem is that this field is applied by us via hardware compats. Thus technically it could be lost. This patch adds PCI susbsystem id and vendor id to exportable parameters for validation. Signed-off-by: Denis V. Lunev <den@openvz.org> CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com> CC: Eric Blake <eblake@redhat.com> CC: Markus Armbruster <armbru@redhat.com> Message-Id: <20180918095852.28422-1-den@openvz.org> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci/pci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 80bc45930d..51d0dec466 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1737,6 +1737,9 @@ 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 : "");