From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MGujn-0000r2-Ev for qemu-devel@nongnu.org; Wed, 17 Jun 2009 08:59:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MGujk-0000qG-09 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 08:59:35 -0400 Received: from [199.232.76.173] (port=50750 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MGujj-0000qC-R7 for qemu-devel@nongnu.org; Wed, 17 Jun 2009 08:59:31 -0400 Received: from mx2.redhat.com ([66.187.237.31]:48425) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MGuji-0004Sg-TG for qemu-devel@nongnu.org; Wed, 17 Jun 2009 08:59:31 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5HCxTgM013265 for ; Wed, 17 Jun 2009 08:59:29 -0400 From: Gerd Hoffmann Date: Wed, 17 Jun 2009 14:59:19 +0200 Message-Id: <1245243565-24807-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1245243565-24807-1-git-send-email-kraxel@redhat.com> References: <1245243565-24807-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 04/10] qdev/pci: bus name List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- 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