From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5da-0003fg-9D for qemu-devel@nongnu.org; Wed, 20 Aug 2014 09:09:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XK5dS-0004Bx-3O for qemu-devel@nongnu.org; Wed, 20 Aug 2014 09:09:14 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:30764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XK5dR-0004Bs-Sf for qemu-devel@nongnu.org; Wed, 20 Aug 2014 09:09:06 -0400 Message-ID: <1408540131.14053.130.camel@abi.no.oracle.com> From: Knut Omang Date: Wed, 20 Aug 2014 15:08:51 +0200 In-Reply-To: <20140820113627.GG17371@redhat.com> References: <1408517593.25437.102.camel@ori.omang.mine.nu> <53F461E6.5020506@redhat.com> <1408527055.14053.107.camel@abi.no.oracle.com> <20140820113627.GG17371@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: Juan Quintela , Alexey Kardashevskiy , Marcel Apfelbaum , qemu-devel@nongnu.org, Markus Armbruster , Gonglei , Igor Mammedov , Paolo Bonzini On Wed, 2014-08-20 at 13:36 +0200, Michael S. Tsirkin wrote: > On Wed, Aug 20, 2014 at 11:30:55AM +0200, Knut Omang wrote: > > On Wed, 2014-08-20 at 10:52 +0200, Paolo Bonzini wrote: > > > Il 20/08/2014 08:53, Knut Omang ha scritto: > > > > A unique bus name is necessary to be able to refer to each instance > > > > from the command line and monitors. > > > > > > Is it needed? Can't you just add id= to the -device option? > > > > Yes, as far as I understand the problem is that the id= would work on > > the ioh3420 device itself, while what is needed here is to name the > > secondary bus of the ioh3420, which I haven't found a way to name from > > the command line. > > Did you try using the device name? I believe I did, I tried a lot back and forth back then... > For pci bridges, unless you set bus_name, bus name will > match device itself. See this code: > > * If we don't specify the name, the bus will be addressed as > * .0, where id is the device id. > * Since PCI Bridge devices have a single bus each, we don't need > * the index: > * let users address the bus using the device name. > */ > if (!br->bus_name && dev->qdev.id && *dev->qdev.id) { > br->bus_name = dev->qdev.id; > } but my testing of this may well have been before your patch with this logic - the cost of being so slow with my patches - it won't happen again... Both with the somewhat counterintuitive second re-provision of the bus name in - pci_bridge_map_irq(br, g_strdup(tmp), pci_swizzle_map_irq_fn); + pci_bridge_map_irq(br, br->bus_name, pci_swizzle_map_irq_fn); and actually with removing it due to Alex's commit 659fefee which was also not in when this was conceived, I am now able to instantiate two devices on two ports by means of: -device ioh3420,slot=0,id=pcie_port.0 -device ioh3420,slot=1,id=pcie_port.1 -device ,bus=pcie_port.0 -device ,bus=pcie_port.1 In light of Markus' enlightening description of the mess here, unless there are more issues, I'll repost the rest of the changes without this commit, Thanks, Knut > > Maybe an even better solution would be to have default names for > > everything, if not specified, from a user friendliness perspective? > > > > I suppose this is a more general issue of sensible default values > > though, but the fact that it is easy to create devices which cannot be > > referred has caused me some confusion from time to time. > > > > > Paolo > > > > Thanks, > > > > Knut