qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 04/10] qdev/pci: bus name


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 04/10] qdev/pci: bus name
Date: Wed, 17 Jun 2009 14:59:19 +0200

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 hw/pci.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/pci.c b/hw/pci.c
index 5f91175..099658c 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -101,6 +101,12 @@ PCIBus *pci_register_bus(DeviceState *parent, const char 
*name,
 {
     PCIBus *bus;
     static int nbus = 0;
+    char defname[32];
+
+    if (!name) {
+        snprintf(defname, sizeof(defname), "pci%d", nbus);
+        name = defname;
+    }
 
     bus = FROM_QBUS(PCIBus, qbus_create(&pci_bus_info, parent, name));
     bus->set_irq = set_irq;
-- 
1.6.2.2





reply via email to

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