qemu-e2k/hw/core
Eduardo Habkost 0bcba41fe3 machine: Convert abstract typename on compat_props to subclass names
Original problem description by Greg Kurz:

> Since commit "9a4c0e220d8a hw/virtio-pci: fix virtio
> behaviour", passing -device virtio-blk-pci.disable-modern=off
> has no effect on 2.6 machine types because the internal
> virtio-pci.disable-modern=on compat property always prevail.

The same bug also affects other abstract type names mentioned on
compat_props by machine-types: apic-common, i386-cpu, pci-device,
powerpc64-cpu, s390-skeys, spapr-pci-host-bridge, usb-device,
virtio-pci, x86_64-cpu.

The right fix for this problem is to make sure compat_props and
-global options are always applied in the order they are
registered, instead of reordering them based on the type
hierarchy. But changing the ordering rules of -global is risky
and might break existing configurations, so we shouldn't do that
on a stable branch.

This is a temporary hack that will work around the bug when
registering compat_props properties: if we find an abstract class
on compat_props, register properties for all its non-abstract
subtypes instead. This will make sure -global won't be overridden
by compat_props, while keeping the existing ordering rules on
-global options.

Note that there's one case that won't be fixed by this hack:
"-global spapr-pci-vfio-host-bridge.<option>=<value>" won't be
able to override compat_props, because spapr-pci-host-bridge is
not an abstract class.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1481575745-26120-1-git-send-email-ehabkost@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-03-14 16:53:44 -03:00
..
Makefile.objs loader: Support Flattened Image Trees (FIT images) 2017-02-21 23:47:40 +00:00
bus.c bus: do not unref hotplug handler 2017-03-01 11:51:28 +04:00
empty_slot.c hw/core: Clean up includes 2016-01-29 15:07:25 +00:00
fw-path-provider.c hw/core: Clean up includes 2016-01-29 15:07:25 +00:00
generic-loader.c hw: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
hotplug.c qdev: hotplug: drop HotplugHandler.post_plug callback 2016-11-15 17:20:37 +02:00
irq.c tcg: drop global lock during TCG code execution 2017-02-24 10:32:45 +00:00
loader-fit.c loader: Support Flattened Image Trees (FIT images) 2017-02-21 23:47:40 +00:00
loader.c elf-loader: Allow late loading of elf 2017-02-28 12:04:48 +01:00
machine.c machine: Convert abstract typename on compat_props to subclass names 2017-03-14 16:53:44 -03:00
nmi.c nmi: remove x86 specific nmi handling 2016-05-23 16:53:46 +02:00
null-machine.c hw/core/null-machine: Add the possibility to instantiate a CPU and RAM 2017-01-23 21:26:27 -02:00
or-irq.c hw/core/or-irq: Mark the device with cannot_instantiate_with_device_add_yet 2017-02-28 09:03:38 +03:00
platform-bus.c sysbus: Remove ignored return value of FindSysbusDeviceFunc 2016-09-27 17:03:34 -03:00
ptimer.c qemu-timer: do not include sysemu/cpus.h from util/qemu-timer.h 2017-03-14 13:28:18 +01:00
qdev-properties-system.c hw/block: Request permissions 2017-02-28 20:40:36 +01:00
qdev-properties.c hw: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
qdev.c Migration pull 2017-03-02 17:39:12 +00:00
register.c register: fix incorrect read mask 2017-02-28 09:03:38 +03:00
reset.c hw: move reset handlers from vl.c to hw/core 2017-01-16 17:52:35 +01:00
stream.c hw/core: Clean up includes 2016-01-29 15:07:25 +00:00
sysbus.c hw: remove pio_addr_t 2016-05-19 16:42:30 +02:00
uboot_image.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00