qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 12/14] pci: give pci devices a default name.


From: Anthony Liguori
Subject: [Qemu-devel] [PATCH 12/14] pci: give pci devices a default name.
Date: Fri, 16 Sep 2011 11:00:32 -0500

Bus names are derived from names so now that PCI devices have a name, they also
have different bus names.

pc_piix relies on the bus name (*sigh*) so we need to update it.

Signed-off-by: Anthony Liguori <address@hidden>
---
 hw/pc_piix.c |    6 ++++--
 hw/pci.c     |    3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 960589a..8f0ebd6 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -181,8 +181,10 @@ static void pc_init1(MemoryRegion *system_memory,
         } else {
             dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
         }
-        idebus[0] = qdev_get_child_bus(&dev->qdev, "ide.0");
-        idebus[1] = qdev_get_child_bus(&dev->qdev, "ide.1");
+        idebus[0] = qdev_get_child_bus(&dev->qdev,
+                                       "::i440fx::i440fx.0::slot[1.1].0");
+        idebus[1] = qdev_get_child_bus(&dev->qdev,
+                                       "::i440fx::i440fx.0::slot[1.1].1");
     } else {
         for(i = 0; i < MAX_IDE_BUS; i++) {
             ISADevice *dev;
diff --git a/hw/pci.c b/hw/pci.c
index abad900..b889ac3 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1736,7 +1736,8 @@ PCIDevice *pci_create_multifunction(PCIBus *bus, int 
devfn, bool multifunction,
 
     devfn = pci_assign_devfn(bus, devfn, name);
 
-    dev = qdev_create(&bus->qbus, name, NULL);
+    dev = qdev_create(&bus->qbus, name, "::slot[%d.%d]",
+                      (devfn >> 3) & 0x1F, (devfn & 0x7));
 
     qdev_prop_set_uint32(dev, "addr", devfn);
     qdev_prop_set_bit(dev, "multifunction", multifunction);
-- 
1.7.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]