aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-11-07 15:35:34 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-07 16:18:42 +0400
commit50545b2cc02942c1019edf5ecc79fa192c655295 (patch)
treeff03632899bc5823ed1d1d1c41c9857bbfba45fc /hw/core
parentcff8b715c0c881fb0f5e79e079f4cfb529e0b0af (diff)
qdev-props: call object_apply_global_props()
It's now possible to use the common function. Teach object_apply_global_props() to warn if Error argument is NULL. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev-properties.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 5f9046b84a..5da1439a8b 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -1223,28 +1223,8 @@ int qdev_prop_check_globals(void)
void qdev_prop_set_globals(DeviceState *dev)
{
- int i;
-
- for (i = 0; i < global_props()->len; i++) {
- GlobalProperty *prop;
- Error *err = NULL;
-
- prop = g_ptr_array_index(global_props(), i);
- if (object_dynamic_cast(OBJECT(dev), prop->driver) == NULL) {
- continue;
- }
- prop->used = true;
- object_property_parse(OBJECT(dev), prop->value, prop->property, &err);
- if (err != NULL) {
- error_prepend(&err, "can't apply global %s.%s=%s: ",
- prop->driver, prop->property, prop->value);
- if (!dev->hotplugged) {
- error_propagate(&error_fatal, err);
- } else {
- warn_report_err(err);
- }
- }
- }
+ object_apply_global_props(OBJECT(dev), global_props(),
+ dev->hotplugged ? NULL : &error_fatal);
}
/* --- 64bit unsigned int 'size' type --- */