From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: agraf@suse.de
Cc: aik@ozlabs.ru, qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH 3/4] spapr: Code more defensively against lack of primary PCI bus
Date: Tue, 30 Apr 2013 14:33:53 +1000 [thread overview]
Message-ID: <1367296434-15453-4-git-send-email-aik@ozlabs.ru> (raw)
In-Reply-To: <1367296434-15453-1-git-send-email-aik@ozlabs.ru>
Currently sPAPR always creates a primary PCI host bridge for emulated PCI
devices. However, because the platform supports native virtual IO, and
can also support multiple independent PCI host bridges, it's quite often
useful to disable the primary bridge for debugging purposes.
This patch, therefore, makes the code cope more gracefully with a missing
primary host bridge.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/spapr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c96ac81..d07c74a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -732,7 +732,7 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args)
const char *boot_device = args->boot_device;
PowerPCCPU *cpu;
CPUPPCState *env;
- PCIHostState *phb;
+ PCIHostState *phb = NULL;
int i;
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
@@ -898,11 +898,11 @@ static void ppc_spapr_init(QEMUMachineInitArgs *args)
}
/* Graphics */
- if (spapr_vga_init(phb->bus)) {
+ if (phb && spapr_vga_init(phb->bus)) {
spapr->has_graphics = true;
}
- if (usb_enabled(spapr->has_graphics)) {
+ if (phb && usb_enabled(spapr->has_graphics)) {
pci_create_simple(phb->bus, -1, "pci-ohci");
if (spapr->has_graphics) {
usbdevice_create("keyboard");
--
1.7.10.4
next prev parent reply other threads:[~2013-04-30 4:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-30 4:33 [Qemu-devel] [0/4] General updates for pseries Alexey Kardashevskiy
2013-04-30 4:33 ` [Qemu-devel] [PATCH 1/4] pseries: Factor out check for out-of-bounds LIOBN Alexey Kardashevskiy
2013-04-30 4:33 ` [Qemu-devel] [PATCH 2/4] pseries: Fix debug message for out-of-bounds address in H_PUT_TCE Alexey Kardashevskiy
2013-04-30 4:33 ` Alexey Kardashevskiy [this message]
2013-04-30 9:45 ` [Qemu-devel] [PATCH 3/4] spapr: Code more defensively against lack of primary PCI bus Alexander Graf
2013-04-30 11:15 ` Alexey Kardashevskiy
2013-04-30 11:30 ` Alexander Graf
2013-04-30 11:52 ` Alexey Kardashevskiy
2013-04-30 11:56 ` Alexander Graf
2013-04-30 12:07 ` Alexey Kardashevskiy
2013-04-30 12:29 ` Alexander Graf
2013-04-30 4:33 ` [Qemu-devel] [PATCH 4/4] pseries: Update SLOF firmware image Alexey Kardashevskiy
2013-04-30 9:39 ` [Qemu-devel] [0/4] General updates for pseries Alexander Graf
2013-04-30 9:46 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2013-04-30 11:17 ` [Qemu-devel] " Alexey Kardashevskiy
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=1367296434-15453-4-git-send-email-aik@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=agraf@suse.de \
--cc=david@gibson.dropbear.id.au \
--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).