From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLWmD-00083h-4r for qemu-devel@nongnu.org; Thu, 06 Mar 2014 06:47:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLWm8-00020S-7E for qemu-devel@nongnu.org; Thu, 06 Mar 2014 06:47:49 -0500 Message-ID: <53186050.8030503@redhat.com> Date: Thu, 06 Mar 2014 12:47:28 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1394075460-17400-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1394075460-17400-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] spapr-pci: change the default PCI bus naming List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Alexander Graf , "Hong-Hua . Yin @ freescale . com" , =?ISO-8859-15?Q?Andreas_F=E4rber?= Il 06/03/2014 04:11, Alexey Kardashevskiy ha scritto: > Previously libvirt required the first/default PCI bus to have name "pci". > Since QEMU can support multiple buses now, libvirt wants "pci.0" now. > > This removes custom busname and lets QEMU make up default names. > > Signed-off-by: Alexey Kardashevskiy > --- > > I tested this with: > -netdev tap,id=id0,ifname=tapqemu-tap-00,script=ifup.sh,downscript=ifdown.sh \ > -device e1000,id=id1,netdev=id0,mac=C0:41:49:4b:00:00 \ > -device \ > spapr-pci-host-bridge,index=5,id=aikbus \ > -netdev tap,id=id2,ifname=tap-1,script=ifup.sh,downscript=ifdown.sh \ > -device rtl8139,id=id3,netdev=id2,bus=aikbus.0,mac=C0:41:49:4b:00:01 \ > -device spapr-pci-vfio-host-bridge,id=id4,index=10,iommu=4 \ > > This creates a default PCI, an additional emulated PCI bus (named aikbus, > if I omit the name, it is pci.1 which is also fine) and VFIO bus (which is > not in upstream yet but still), this all works fine and I cannot see any flaw. Thanks! Andreas, are you taking this patch? Paolo > > --- > hw/ppc/spapr_pci.c | 23 ++--------------------- > 1 file changed, 2 insertions(+), 21 deletions(-) > > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c > index 66ddf10..7ecb3df 100644 > --- a/hw/ppc/spapr_pci.c > +++ b/hw/ppc/spapr_pci.c > @@ -499,7 +499,6 @@ static int spapr_phb_init(SysBusDevice *s) > DeviceState *dev = DEVICE(s); > sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s); > PCIHostState *phb = PCI_HOST_BRIDGE(s); > - const char *busname; > char *namebuf; > int i; > PCIBus *bus; > @@ -583,26 +582,8 @@ static int spapr_phb_init(SysBusDevice *s) > get_system_io(), 0, SPAPR_PCI_IO_WIN_SIZE); > memory_region_add_subregion(get_system_memory(), sphb->io_win_addr, > &sphb->iowindow); > - /* > - * Selecting a busname is more complex than you'd think, due to > - * interacting constraints. If the user has specified an id > - * explicitly for the phb , then we want to use the qdev default > - * of naming the bus based on the bridge device (so the user can > - * then assign devices to it in the way they expect). For the > - * first / default PCI bus (index=0) we want to use just "pci" > - * because libvirt expects there to be a bus called, simply, > - * "pci". Otherwise, we use the same name as in the device tree, > - * since it's unique by construction, and makes the guest visible > - * BUID clear. > - */ > - if (dev->id) { > - busname = NULL; > - } else if (sphb->index == 0) { > - busname = "pci"; > - } else { > - busname = sphb->dtbusname; > - } > - bus = pci_register_bus(dev, busname, > + > + bus = pci_register_bus(dev, NULL, > pci_spapr_set_irq, pci_spapr_map_irq, sphb, > &sphb->memspace, &sphb->iospace, > PCI_DEVFN(0, 0), PCI_NUM_PINS, TYPE_PCI_BUS); >