mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
pci: fix info pci with host bridge.
This patch fixes 525e05147d.
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>
This commit is contained in:
parent
c730256b33
commit
b5937f2978
1 changed files with 3 additions and 3 deletions
6
hw/pci.c
6
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)
|
static QObject *pci_get_dev_dict(PCIDevice *dev, PCIBus *bus, int bus_num)
|
||||||
{
|
{
|
||||||
int class;
|
uint8_t type;
|
||||||
QObject *obj;
|
QObject *obj;
|
||||||
|
|
||||||
obj = qobject_from_jsonf("{ 'bus': %d, 'slot': %d, 'function': %d," "'class_info': %p, 'id': %p, 'regions': %p,"
|
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]));
|
qdict_put(qdict, "irq", qint_from_int(dev->config[PCI_INTERRUPT_LINE]));
|
||||||
}
|
}
|
||||||
|
|
||||||
class = pci_get_word(dev->config + PCI_CLASS_DEVICE);
|
type = dev->config[PCI_HEADER_TYPE] & ~PCI_HEADER_TYPE_MULTI_FUNCTION;
|
||||||
if (class == PCI_CLASS_BRIDGE_HOST || class == PCI_CLASS_BRIDGE_PCI) {
|
if (type == PCI_HEADER_TYPE_BRIDGE) {
|
||||||
QDict *qdict;
|
QDict *qdict;
|
||||||
QObject *pci_bridge;
|
QObject *pci_bridge;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue