diff mbox

[09/24] libqtest: Fix qmp() & friends to abort on JSON parse errors

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

Commit Message

Markus Armbruster Feb. 27, 2017, 11:20 a.m. UTC
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/libqtest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kevin Wolf Feb. 28, 2017, 4:51 p.m. UTC | #1
Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben:
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Aha, I was just too quick! :-)

Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Markus Armbruster Feb. 28, 2017, 6:05 p.m. UTC | #2
Kevin Wolf <kwolf@redhat.com> writes:

> Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben:
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Aha, I was just too quick! :-)

I'll add something to the previous commit's message.

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

Thanks!
diff mbox

Patch

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 683d5e3..bb444d5 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -21,6 +21,7 @@ 
 #include <sys/wait.h>
 #include <sys/un.h>
 
+#include "qapi/error.h"
 #include "qapi/qmp/json-parser.h"
 #include "qapi/qmp/json-streamer.h"
 #include "qapi/qmp/qjson.h"
@@ -442,7 +443,7 @@  void qmp_fd_sendv(int fd, const char *fmt, va_list ap)
      * is an array type.
      */
     va_copy(ap_copy, ap);
-    qobj = qobject_from_jsonv(fmt, &ap_copy, NULL);
+    qobj = qobject_from_jsonv(fmt, &ap_copy, &error_abort);
     va_end(ap_copy);
 
     /* No need to send anything for an empty QObject.  */