diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-08-23 18:39:34 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-08-24 20:26:37 +0200 |
commit | e2f64a688b70e2e6882b534f9a6a68ef589c261d (patch) | |
tree | eb024f8eb3480d2ed6e405562196be933aa4f129 /tests/test-qga.c | |
parent | aed877c53b5b8760b3fdb3605a212188c60f2eb3 (diff) | |
download | qemu-e2f64a688b70e2e6882b534f9a6a68ef589c261d.zip qemu-e2f64a688b70e2e6882b534f9a6a68ef589c261d.tar.gz qemu-e2f64a688b70e2e6882b534f9a6a68ef589c261d.tar.bz2 |
test-qga: Clean up how we test QGA synchronization
To permit recovering from arbitrary JSON parse errors, the JSON parser
resets itself on lexical errors. We recommend sending a 0xff byte for
that purpose, and test-qga covers this usage since commit 5229564b832.
That commit had to add an ugly hack to qmp_fd_vsend() to make capable
of sending this byte (it's designed to send only valid JSON).
The previous commit added a way to send arbitrary text. Put that to
use for this purpose, and drop the hack from qmp_fd_vsend().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-8-armbru@redhat.com>
Diffstat (limited to 'tests/test-qga.c')
-rw-r--r-- | tests/test-qga.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test-qga.c b/tests/test-qga.c index c552cc0..f69cdf6 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -147,8 +147,9 @@ static void test_qga_sync_delimited(gconstpointer fix) unsigned char c; QDict *ret; + qmp_fd_send_raw(fixture->fd, "\xff"); qmp_fd_send(fixture->fd, - "\xff{'execute': 'guest-sync-delimited'," + "{'execute': 'guest-sync-delimited'," " 'arguments': {'id': %u } }", r); |