qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Alexey Kardashevskiy" <aik@ozlabs.ru>,
	"open list:sPAPR" <qemu-ppc@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>,
	"Alexander Graf" <agraf@suse.de>
Subject: [Qemu-devel] [PULL for-2.0-rc0 11/31] spapr-pci: Change the default PCI bus naming
Date: Wed, 12 Mar 2014 22:09:43 +0100	[thread overview]
Message-ID: <1394658603-13650-12-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1394658603-13650-1-git-send-email-afaerber@suse.de>

From: Alexey Kardashevskiy <aik@ozlabs.ru>

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 bus name and lets QEMU make up default names.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 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 cea9469..3063109 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -510,7 +510,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;
@@ -594,26 +593,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);
-- 
1.8.4.5

  parent reply	other threads:[~2014-03-12 21:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-12 21:09 [Qemu-devel] [PULL for-2.0-rc0 00/31] QOM devices patch queue 2014-03-12 Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 01/31] qdev: Fix bus dependency of DeviceState::hotpluggable getter Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 02/31] qdev: Set DeviceClass::hotpluggable default in class_init() Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 03/31] qdev-monitor: Set properties after parent is assigned in device_add Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 04/31] qom: Avoid leaking str and bool properties on failure Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 05/31] ssi: Convert legacy SSI_SLAVE -> DEVICE casts Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 06/31] ssi: Convert legacy SSI_BUS -> BUS casts Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 07/31] misc/max111x: Create abstract max111x type Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 08/31] misc/max111x: QOM casting sweep Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 09/31] ssi: Remove SSI_SLAVE_FROM_QDEV() macro Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 10/31] block/m25p80: Remove FROM_SSI_SLAVE() usages Andreas Färber
2014-03-12 21:09 ` Andreas Färber [this message]
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 12/31] qdev-monitor-test: Simplify using g_assert_cmpstr() Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 13/31] qdev-monitor-test: Don't test human-readable error message Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 14/31] hw/core: Introduce QEMU machine as QOM object Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 15/31] vl: Use MachineClass instead of global QEMUMachine list Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 16/31] hw/boards: Convert current_machine to MachineState Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 17/31] qom-test: Test QOM properties Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 18/31] tests: Clean up IndustryPack TPCI200 gcov paths Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 19/31] tests: Add virtio-blk qtest Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 20/31] tests: Add virtio-balloon qtest Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 21/31] tests: Add virtio-rng qtest Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 22/31] tests: Add virtio-scsi qtest Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 23/31] tests: Add virtio-serial qtest Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 24/31] tests: Add virtio-console qtest Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 25/31] virtio-console: QOM cast cleanup for VirtConsole Andreas Färber
2014-03-13 15:32   ` [Qemu-devel] virtio-serial broken in qemu.git (was: Re: [PULL for-2.0-rc0 25/31] virtio-console: QOM cast cleanup for VirtConsole) Richard W.M. Jones
2014-03-13 15:43     ` Richard W.M. Jones
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 26/31] virtio-serial-port: Convert to QOM realize/unrealize Andreas Färber
2014-03-12 21:09 ` [Qemu-devel] [PULL for-2.0-rc0 27/31] tests: Add spapr-pci-host-bridge qtest Andreas Färber
2014-03-12 21:10 ` [Qemu-devel] [PULL for-2.0-rc0 28/31] qdev: Prepare realize/unrealize hooks for BusState Andreas Färber
2014-03-12 21:10 ` [Qemu-devel] [PULL for-2.0-rc0 29/31] qdev: Realize buses on device realization Andreas Färber
2014-03-12 21:10 ` [Qemu-devel] [PULL for-2.0-rc0 30/31] pci: Move VMState registration/unregistration to QOM realize/unrealize Andreas Färber
2014-03-12 21:10 ` [Qemu-devel] [PULL for-2.0-rc0 31/31] libqtest: Fix possible deadlock in qtest initialization Andreas Färber
2014-03-12 22:42 ` [Qemu-devel] [PULL for-2.0-rc0 00/31] QOM devices patch queue 2014-03-12 Peter Maydell
2014-03-13  0:19   ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394658603-13650-12-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).