From d822979bdf80c3ea9752615af15f231b4c4ce547 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 Feb 2012 09:47:13 +0100 Subject: 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 Signed-off-by: Paolo Bonzini --- hw/qdev.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hw/qdev.c') diff --git a/hw/qdev.c b/hw/qdev.c index e3b53b7..acb7829 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -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, -- cgit v1.1