aboutsummaryrefslogtreecommitdiff
path: root/qom
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 /qom
parentcff8b715c0c881fb0f5e79e079f4cfb529e0b0af (diff)
downloadqemu-50545b2cc02942c1019edf5ecc79fa192c655295.zip
qemu-50545b2cc02942c1019edf5ecc79fa192c655295.tar.gz
qemu-50545b2cc02942c1019edf5ecc79fa192c655295.tar.bz2
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 'qom')
-rw-r--r--qom/object.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/qom/object.c b/qom/object.c
index dbdab0a..aa6f3a2 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -390,7 +390,17 @@ void object_apply_global_props(Object *obj, const GPtrArray *props, Error **errp
if (err != NULL) {
error_prepend(&err, "can't apply global %s.%s=%s: ",
p->driver, p->property, p->value);
- error_propagate(errp, err);
+ /*
+ * If errp != NULL, propagate error and return.
+ * If errp == NULL, report a warning, but keep going
+ * with the remaining globals.
+ */
+ if (errp) {
+ error_propagate(errp, err);
+ return;
+ } else {
+ warn_report_err(err);
+ }
}
}
}