From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel@redhat.com>,
Halil Pasic <pasic@linux.vnet.ibm.com>,
Cornelia Huck <cohuck@redhat.com>, Greg Kurz <groug@kaod.org>
Subject: [Qemu-devel] [PATCH 3/3] Revert "machine: Convert abstract typename on compat_props to subclass names"
Date: Mon, 10 Jul 2017 21:43:03 -0300 [thread overview]
Message-ID: <20170711004303.3902-4-ehabkost@redhat.com> (raw)
In-Reply-To: <20170711004303.3902-1-ehabkost@redhat.com>
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 <ehabkost@redhat.com>
---
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 ecb5552..1d10b01 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
next prev parent reply other threads:[~2017-07-11 0:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 0:43 [Qemu-devel] [PATCH 0/3] qdev: fix the order compat and global properties are applied Eduardo Habkost
2017-07-11 0:43 ` [Qemu-devel] [PATCH 1/3] " Eduardo Habkost
2017-07-11 12:46 ` Cornelia Huck
2017-07-12 17:33 ` Halil Pasic
2017-07-12 18:29 ` Eduardo Habkost
2017-07-13 11:54 ` Halil Pasic
2017-07-13 16:15 ` Eduardo Habkost
2017-07-16 12:21 ` Halil Pasic
2017-07-11 0:43 ` [Qemu-devel] [PATCH 2/3] test-qdev-global-props: Test global property ordering Eduardo Habkost
2017-07-11 12:48 ` Cornelia Huck
2017-07-11 13:16 ` Greg Kurz
2017-07-12 18:06 ` Halil Pasic
2017-07-12 18:48 ` Eduardo Habkost
2017-07-16 12:35 ` Halil Pasic
2017-07-17 17:38 ` Eduardo Habkost
2017-07-11 0:43 ` Eduardo Habkost [this message]
2017-07-11 12:49 ` [Qemu-devel] [PATCH 3/3] Revert "machine: Convert abstract typename on compat_props to subclass names" Cornelia Huck
2017-07-11 13:16 ` Greg Kurz
2017-07-12 17:49 ` Halil Pasic
2017-07-12 19:20 ` Eduardo Habkost
2017-07-13 12:11 ` Halil Pasic
2017-07-13 16:20 ` Eduardo Habkost
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=20170711004303.3902-4-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=cohuck@redhat.com \
--cc=groug@kaod.org \
--cc=marcel@redhat.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.