mirror of https://gitee.com/openkylin/qemu.git
object_add: consolidate error handling
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
0169c51155
commit
69252c0467
10
qmp.c
10
qmp.c
|
@ -549,15 +549,17 @@ void object_add(const char *type, const char *id, const QDict *qdict,
|
|||
for (e = qdict_first(qdict); e; e = qdict_next(qdict, e)) {
|
||||
object_property_set(obj, v, e->key, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
object_unref(obj);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object_property_add_child(container_get(object_get_root(), "/objects"),
|
||||
id, obj, errp);
|
||||
id, obj, &local_err);
|
||||
out:
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
}
|
||||
object_unref(obj);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue