From: Thomas Huth <thuth@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, Thomas Huth <thuth@redhat.com>
Subject: [PATCH] hw/ppc/mac_newworld: Check for the availability of pci-ohci before using it
Date: Fri, 26 May 2023 14:53:23 +0200 [thread overview]
Message-ID: <20230526125323.2386324-1-thuth@redhat.com> (raw)
pci-ohci might habe been disabled in the QEMU binary (e.g. when "configure"
has been run with "--without-default-devices"). Thus we should check
for its availability before blindly using it.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/ppc/mac_newworld.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 535710314a..c7cca430e1 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -349,7 +349,8 @@ static void ppc_core99_init(MachineState *machine)
sysbus_mmio_get_region(s, 3));
}
- machine->usb |= defaults_enabled() && !machine->usb_disabled;
+ machine->usb |= defaults_enabled() && !machine->usb_disabled &&
+ module_object_class_by_name("pci-ohci") != 0;
has_pmu = (core99_machine->via_config != CORE99_VIA_CONFIG_CUDA);
has_adb = (core99_machine->via_config == CORE99_VIA_CONFIG_CUDA ||
core99_machine->via_config == CORE99_VIA_CONFIG_PMU_ADB);
--
2.31.1
next reply other threads:[~2023-05-26 12:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 12:53 Thomas Huth [this message]
2023-05-26 13:30 ` [PATCH] hw/ppc/mac_newworld: Check for the availability of pci-ohci before using it BALATON Zoltan
2023-05-26 17:24 ` Mark Cave-Ayland
2023-05-30 5:18 ` Thomas Huth
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=20230526125323.2386324-1-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--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).