diff mbox

[15/24] test-visitor-serialization: Pass &error_abort to qobject_from_json()

Message ID 1488194450-28056-16-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Feb. 27, 2017, 11:20 a.m. UTC
qmp_deserialize() calls qobject_from_json() ignoring errors.  It
passes the result to qobject_input_visitor_new(), which asserts it's
not null.  Therefore, we can just as well pass &error_abort to
qobject_from_json().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/test-visitor-serialization.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kevin Wolf Feb. 28, 2017, 5:09 p.m. UTC | #1
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben:
> qmp_deserialize() calls qobject_from_json() ignoring errors.  It
> passes the result to qobject_input_visitor_new(), which asserts it's
> not null.  Therefore, we can just as well pass &error_abort to
> qobject_from_json().
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
diff mbox

Patch

diff --git a/tests/test-visitor-serialization.c b/tests/test-visitor-serialization.c
index 37dff41..4d47cee 100644
--- a/tests/test-visitor-serialization.c
+++ b/tests/test-visitor-serialization.c
@@ -1037,7 +1037,7 @@  static void qmp_deserialize(void **native_out, void *datap,
     visit_complete(d->qov, &d->obj);
     obj_orig = d->obj;
     output_json = qobject_to_json(obj_orig);
-    obj = qobject_from_json(qstring_get_str(output_json), NULL);
+    obj = qobject_from_json(qstring_get_str(output_json), &error_abort);
 
     QDECREF(output_json);
     d->qiv = qobject_input_visitor_new(obj);