aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2010-02-08 15:40:38 +0900
committerBlue Swirl <blauwirbel@gmail.com>2010-02-13 07:37:11 +0000
commitb5937f297819bec5bf704dda1df9807fc7f0a766 (patch)
tree20a7bb06808cbef9ba0663f3a1b0b3709d7ef53f
parentc730256b331cc0494793a7b9b45d3e7496a3ebad (diff)
pci: fix info pci with host bridge.
This patch fixes 525e05147d5a3bdc08caa422d108c1ef71b584b5. pci host bridge doesn't have header type of bridge. The check should be by header type, instead of pci class device. Cc: Blue Swirl <blauwirbel@gmail.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--hw/pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/pci.c b/hw/pci.c
index e91d2e693..eb2043e50 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1273,7 +1273,7 @@ static QObject *pci_get_devices_list(PCIBus *bus, int bus_num);
static QObject *pci_get_dev_dict(PCIDevice *dev, PCIBus *bus, int bus_num)
{
- int class;
+ uint8_t type;
QObject *obj;
obj = qobject_from_jsonf("{ 'bus': %d, 'slot': %d, 'function': %d," "'class_info': %p, 'id': %p, 'regions': %p,"
@@ -1289,8 +1289,8 @@ static QObject *pci_get_dev_dict(PCIDevice *dev, PCIBus *bus, int bus_num)
qdict_put(qdict, "irq", qint_from_int(dev->config[PCI_INTERRUPT_LINE]));
}
- class = pci_get_word(dev->config + PCI_CLASS_DEVICE);
- if (class == PCI_CLASS_BRIDGE_HOST || class == PCI_CLASS_BRIDGE_PCI) {
+ type = dev->config[PCI_HEADER_TYPE] & ~PCI_HEADER_TYPE_MULTI_FUNCTION;
+ if (type == PCI_HEADER_TYPE_BRIDGE) {
QDict *qdict;
QObject *pci_bridge;