qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Correctly assign PCI domain numbers
@ 2011-08-01  6:51 David Gibson
  2011-08-01  8:31 ` Isaku Yamahata
  2011-08-01 10:10 ` Michael S. Tsirkin
  0 siblings, 2 replies; 16+ messages in thread
From: David Gibson @ 2011-08-01  6:51 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

qemu already almost supports PCI domains; that is, several entirely
independent PCI host bridges on the same machine.  However, a bug in
pci_bus_new_inplace() means that every host bridge gets assigned domain
number zero and so can't be properly distinguished.  This patch fixes the
bug, giving each new host bridge a new domain number.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/pci.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 36db58b..2b4aecb 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -262,6 +262,8 @@ int pci_find_domain(const PCIBus *bus)
     return -1;
 }
 
+static int pci_next_domain; /* = 0 */
+
 void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
                          const char *name,
                          MemoryRegion *address_space,
@@ -274,7 +276,8 @@ void pci_bus_new_inplace(PCIBus *bus, DeviceState *parent,
 
     /* host bridge */
     QLIST_INIT(&bus->child);
-    pci_host_bus_register(0, bus); /* for now only pci domain 0 is supported */
+
+    pci_host_bus_register(pci_next_domain++, bus);
 
     vmstate_register(NULL, -1, &vmstate_pcibus, bus);
 }
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-10-02 10:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01  6:51 [Qemu-devel] [PATCH] Correctly assign PCI domain numbers David Gibson
2011-08-01  8:31 ` Isaku Yamahata
2011-08-01 13:32   ` David Gibson
2011-08-01 10:10 ` Michael S. Tsirkin
2011-08-01 13:33   ` David Gibson
2011-08-01 14:03     ` Michael S. Tsirkin
2011-08-01 14:15       ` David Gibson
2011-08-03 13:28         ` Michael S. Tsirkin
2011-08-04  9:00           ` David Gibson
2011-08-04 19:14             ` Michael S. Tsirkin
2011-08-10  8:34             ` Michael S. Tsirkin
2011-08-11  6:38               ` David Gibson
2011-10-02 10:35                 ` Michael S. Tsirkin
2011-08-03 10:13   ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2011-08-03 10:21     ` Michael S. Tsirkin
2011-08-10  3:05   ` [Qemu-devel] " David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).