summaryrefslogtreecommitdiffstats
path: root/include/hw
diff options
context:
space:
mode:
authorMarc-André Lureau2020-01-10 16:30:34 +0100
committerPaolo Bonzini2020-01-24 20:59:16 +0100
commit77b06bba62034a87cc61a9c8de1309ae3e527d97 (patch)
tree31644878066667339e6adb57fe026b74cdb78a5a /include/hw
parentqdev: move instance properties to class properties (diff)
downloadqemu-77b06bba62034a87cc61a9c8de1309ae3e527d97.tar.gz
qemu-77b06bba62034a87cc61a9c8de1309ae3e527d97.tar.xz
qemu-77b06bba62034a87cc61a9c8de1309ae3e527d97.zip
qdev: register properties as class properties
Use class properties facilities to add properties to the class during device_class_set_props(). qdev_property_add_static() must be adapted as PropertyInfo now operates with classes (and not instances), so we must set_default_value() on the ObjectProperty, before calling its init() method on the object instance. Also, PropertyInfo.create() is now exclusively used for class properties. Fortunately, qdev_property_add_static() is only used in target/arm/cpu.c so far, which doesn't use "link" properties (that require create()). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20200110153039.1379601-22-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/qdev-core.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 506ad359c9..5da94f872a 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -263,8 +263,8 @@ struct PropertyInfo {
const char *description;
const QEnumLookup *enum_table;
int (*print)(DeviceState *dev, Property *prop, char *dest, size_t len);
- void (*set_default_value)(Object *obj, const Property *prop);
- void (*create)(Object *obj, Property *prop, Error **errp);
+ void (*set_default_value)(ObjectProperty *op, const Property *prop);
+ void (*create)(ObjectClass *oc, Property *prop, Error **errp);
ObjectPropertyAccessor *get;
ObjectPropertyAccessor *set;
ObjectPropertyRelease *release;