[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/15] Revert "machine: Convert abstract typename on
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 05/15] Revert "machine: Convert abstract typename on compat_props to subclass names" |
Date: |
Mon, 17 Jul 2017 15:50:41 -0300 |
This reverts commit 0bcba41fe379e4c6834adcf1456d9099db31a5b2.
The bug addressed by that commit is now fixed in a better way by the
commit "qdev: fix the order compat and global properties are applied".
Signed-off-by: Eduardo Habkost <address@hidden>
Message-Id: <address@hidden>
Acked-by: Cornelia Huck <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: Halil Pasic <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
hw/core/machine.c | 26 +++-----------------------
1 file changed, 3 insertions(+), 23 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index dc431fa..41b53a1 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -770,18 +770,11 @@ static void machine_class_finalize(ObjectClass *klass,
void *data)
g_free(mc->name);
}
-static void machine_register_compat_for_subclass(ObjectClass *oc, void *opaque)
-{
- GlobalProperty *p = opaque;
- register_compat_prop(object_class_get_name(oc), p->property, p->value);
-}
-
void machine_register_compat_props(MachineState *machine)
{
MachineClass *mc = MACHINE_GET_CLASS(machine);
int i;
GlobalProperty *p;
- ObjectClass *oc;
if (!mc->compat_props) {
return;
@@ -789,22 +782,9 @@ void machine_register_compat_props(MachineState *machine)
for (i = 0; i < mc->compat_props->len; i++) {
p = g_array_index(mc->compat_props, GlobalProperty *, i);
- oc = object_class_by_name(p->driver);
- if (oc && object_class_is_abstract(oc)) {
- /* temporary hack to make sure we do not override
- * globals set explicitly on -global: if an abstract class
- * is on compat_props, register globals for all its
- * non-abstract subtypes instead.
- *
- * This doesn't solve the problem for cases where
- * a non-abstract typename mentioned on compat_props
- * has subclasses, like spapr-pci-host-bridge.
- */
- object_class_foreach(machine_register_compat_for_subclass,
- p->driver, false, p);
- } else {
- register_compat_prop(p->driver, p->property, p->value);
- }
+ /* Machine compat_props must never cause errors: */
+ p->errp = &error_abort;
+ qdev_prop_register_global(p);
}
}
--
2.9.4
- [Qemu-devel] [PULL 00/15] x86 and machine queue for 2.10 soft freeze, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 01/15] device-crash-test: Fix regexp on whitelist, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 02/15] tests: Test case for object_resolve_path*(), Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 03/15] qdev: fix the order compat and global properties are applied, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 04/15] test-qdev-global-props: Test global property ordering, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 07/15] fw_cfg: switch fw_cfg_find() to locate the fw_cfg device by type rather than path, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 05/15] Revert "machine: Convert abstract typename on compat_props to subclass names",
Eduardo Habkost <=
- [Qemu-devel] [PULL 08/15] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 06/15] qom: Fix ambiguous path detection when ambiguous=NULL, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 09/15] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 10/15] i386: expose "TCGTCGTCGTCG" in the 0x40000000 CPUID leaf, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 12/15] i386: add Skylake-Server cpu model, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 13/15] tests: Simplify abstract-interfaces check with a helper, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 11/15] i386: Update comment about XSAVES on Skylake-Client, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 14/15] qmp: Include 'abstract' field on 'qom-list-types' output, Eduardo Habkost, 2017/07/17
- [Qemu-devel] [PULL 15/15] qmp: Include parent type on 'qom-list-types' output, Eduardo Habkost, 2017/07/17
- Re: [Qemu-devel] [PULL 00/15] x86 and machine queue for 2.10 soft freeze, Peter Maydell, 2017/07/18