diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-07 20:35:53 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-06-19 14:56:29 +0200 |
commit | a2740ad584839ac84f3cdb2d928de93a0d7f4e72 (patch) | |
tree | 8230dd4feda8eec4323bb09ca9b25baa3883d3b3 /hw/core/qdev.c | |
parent | edf8bc98424d62035d5e4c0f39542722d72d7979 (diff) |
qdev: remove PropertyInfo.qtype field
Remove dependency on qapi qtype, replace a field by a few PropertyInfo
callbacks to set the default value type (introduced in commit 4f2d3d7).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20170607163635.17635-2-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/core/qdev.c')
-rw-r--r-- | hw/core/qdev.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 0ce45a2019..849952a8d4 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -793,17 +793,8 @@ void qdev_property_add_static(DeviceState *dev, Property *prop, prop->info->description, &error_abort); - if (prop->qtype == QTYPE_NONE) { - return; - } - - if (prop->qtype == QTYPE_QBOOL) { - object_property_set_bool(obj, prop->defval, prop->name, &error_abort); - } else if (prop->info->enum_table) { - object_property_set_str(obj, prop->info->enum_table[prop->defval], - prop->name, &error_abort); - } else if (prop->qtype == QTYPE_QINT) { - object_property_set_int(obj, prop->defval, prop->name, &error_abort); + if (prop->info->set_default_value) { + prop->info->set_default_value(obj, prop); } } |