aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/e500.c
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel@redhat.com>2015-03-10 18:59:54 +0200
committerMichael S. Tsirkin <mst@redhat.com>2015-03-11 18:14:23 +0100
commit446f16a6906e9d05aa9ce0dde727d4f731a89298 (patch)
tree872eba40ba77b857f33b1fb339cba11dfd82d87f /hw/ppc/e500.c
parentd8870d0217216478888c2d3dd6bf62e155d978c8 (diff)
downloadqemu-446f16a6906e9d05aa9ce0dde727d4f731a89298.zip
qemu-446f16a6906e9d05aa9ce0dde727d4f731a89298.tar.gz
qemu-446f16a6906e9d05aa9ce0dde727d4f731a89298.tar.bz2
machine: query kernel-irqchip property
Running x86_64-softmmu/qemu-system-x86_64 -machine pc,kernel_irqchip=on -enable-kvm leads to crash: qemu-system-x86_64: qemu/util/qemu-option.c:387: qemu_opt_get_bool_helper: Assertion `opt->desc && opt->desc->type == QEMU_OPT_BOOL' failed. Aborted (core dumped) This happens because the commit e79d5a6 ("machine: remove qemu_machine_opts global list") removed the global option descriptions and moved them to MachineState's QOM properties. Fix this by querying machine properties through designated wrappers. Signed-off-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/ppc/e500.c')
-rw-r--r--hw/ppc/e500.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index d51fb60..c10e1b5 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -734,8 +734,8 @@ static DeviceState *ppce500_init_mpic_kvm(PPCE500Params *params,
return dev;
}
-static qemu_irq *ppce500_init_mpic(PPCE500Params *params, MemoryRegion *ccsr,
- qemu_irq **irqs)
+static qemu_irq *ppce500_init_mpic(MachineState *machine, PPCE500Params *params,
+ MemoryRegion *ccsr, qemu_irq **irqs)
{
qemu_irq *mpic;
DeviceState *dev = NULL;
@@ -745,17 +745,12 @@ static qemu_irq *ppce500_init_mpic(PPCE500Params *params, MemoryRegion *ccsr,
mpic = g_new0(qemu_irq, 256);
if (kvm_enabled()) {
- QemuOpts *machine_opts = qemu_get_machine_opts();
- bool irqchip_allowed = qemu_opt_get_bool(machine_opts,
- "kernel_irqchip", true);
- bool irqchip_required = qemu_opt_get_bool(machine_opts,
- "kernel_irqchip", false);
Error *err = NULL;
- if (irqchip_allowed) {
+ if (machine_kernel_irqchip_allowed(machine)) {
dev = ppce500_init_mpic_kvm(params, irqs, &err);
}
- if (irqchip_required && !dev) {
+ if (machine_kernel_irqchip_required(machine) && !dev) {
error_report("kernel_irqchip requested but unavailable: %s",
error_get_pretty(err));
exit(1);
@@ -879,7 +874,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
memory_region_add_subregion(address_space_mem, params->ccsrbar_base,
ccsr_addr_space);
- mpic = ppce500_init_mpic(params, ccsr_addr_space, irqs);
+ mpic = ppce500_init_mpic(machine, params, ccsr_addr_space, irqs);
/* Serial */
if (serial_hds[0]) {