From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK4OO-0005Ni-8J for qemu-devel@nongnu.org; Wed, 20 Aug 2014 07:49:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK4OH-0003U6-DH for qemu-devel@nongnu.org; Wed, 20 Aug 2014 07:49:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:53313 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK4OH-0003SX-70 for qemu-devel@nongnu.org; Wed, 20 Aug 2014 07:49:21 -0400 Message-ID: <53F48B3C.3050507@suse.de> Date: Wed, 20 Aug 2014 13:49:16 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1408517593.25437.102.camel@ori.omang.mine.nu> In-Reply-To: <1408517593.25437.102.camel@ori.omang.mine.nu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] ioh3420: Provide a unique bus name and an interrupt mapping function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Knut Omang , qemu-devel@nongnu.org Cc: Juan Quintela , Alexey Kardashevskiy , "Michael S.Tsirkin" , Markus Armbruster , Gonglei , Paolo Bonzini , Igor Mammedov , Marcel Apfelbaum Hi Knut, Am 20.08.2014 08:53, schrieb Knut Omang: >=20 > A unique bus name is necessary to be able to refer to each instance > from the command line and monitors. >=20 > Signed-off-by: Knut Omang > --- > hw/pci-bridge/ioh3420.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/hw/pci-bridge/ioh3420.c b/hw/pci-bridge/ioh3420.c > index 7cd87fc..8f6c8b0 100644 > --- a/hw/pci-bridge/ioh3420.c > +++ b/hw/pci-bridge/ioh3420.c > @@ -95,6 +95,9 @@ static int ioh3420_initfn(PCIDevice *d) > PCIEPort *p =3D PCIE_PORT(d); > PCIESlot *s =3D PCIE_SLOT(d); > int rc; > + char tmp[100]; > + sprintf(tmp, "pcie_port.%d", s->slot); > + pci_bridge_map_irq(br, g_strdup(tmp), pci_swizzle_map_irq_fn); Style issues apart (white line being dropped), this is a rather convoluted way of providing a bus name to something. ;) That makes me think something else is going wrong, or APIs may need to be improved. Could you elaborate for those not intimately familiar with this bridge what name you're seeing before, given a particular command line, and explain why IRQ mapping affects the bus name? Thanks, Andreas > =20 > rc =3D pci_bridge_initfn(d, TYPE_PCIE_BUS); > if (rc < 0) { > @@ -154,6 +157,7 @@ static void ioh3420_exitfn(PCIDevice *d) > pcie_cap_exit(d); > msi_uninit(d); > pci_bridge_exitfn(d); > + g_free((char*)br->bus_name); > } > =20 > PCIESlot *ioh3420_init(PCIBus *bus, int devfn, bool multifunction, --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg