diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-02-02 09:47:13 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-02-07 13:52:41 +0100 |
commit | d822979bdf80c3ea9752615af15f231b4c4ce547 (patch) | |
tree | 108ee38d18a61cf3550d2f24a70de6b601fd897d /hw/qdev.c | |
parent | 1d9c5a12cefcd914d99c32de9aac72966a4788ae (diff) | |
download | qemu-d822979bdf80c3ea9752615af15f231b4c4ce547.zip |
qdev: remove direct calls to print/parse
There's no need to call into ->parse and ->print manually. The
QOM legacy properties do that for us.
Furthermore, in some cases legacy and static properties have exactly
the same behavior, and we could drop the legacy properties right away.
Add an appropriate fallback to prepare for this.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/qdev.c')
-rw-r--r-- | hw/qdev.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -581,6 +581,15 @@ void qdev_property_add_legacy(DeviceState *dev, Property *prop, void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp) { + /* + * TODO qdev_prop_ptr does not have getters or setters. It must + * go now that it can be replaced with links. The test should be + * removed along with it: all static properties are read/write. + */ + if (!prop->info->get && !prop->info->set) { + return; + } + object_property_add(OBJECT(dev), prop->name, prop->info->name, prop->info->get, prop->info->set, NULL, |