diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-07-03 10:53:35 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-07-03 23:18:56 +0200 |
commit | 0fa39d0b0374b983535de8591e5e561401d1d5c6 (patch) | |
tree | 59d236d557bab134147b6d32d2ed8434cd52f9f3 /tests/test-qga.c | |
parent | b5f8431040549da931b31892cbbde73b8724ff48 (diff) | |
download | qemu-0fa39d0b0374b983535de8591e5e561401d1d5c6.zip qemu-0fa39d0b0374b983535de8591e5e561401d1d5c6.tar.gz qemu-0fa39d0b0374b983535de8591e5e561401d1d5c6.tar.bz2 |
qmp qemu-ga: Revert change that accidentally made qemu-ga accept "id"
Commit cf869d53172 "qmp: support out-of-band (oob) execution" changed
how we check "id":
Note that in the patch I exported qmp_dispatch_check_obj() to be
used to check the request earlier, and at the same time allowed
"id" field to be there since actually we always allow that.
The part after "and" is ill-advised: it makes qemu-ga accept and
ignore "id". Revert.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180703085358.13941-10-armbru@redhat.com>
Diffstat (limited to 'tests/test-qga.c')
-rw-r--r-- | tests/test-qga.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/test-qga.c b/tests/test-qga.c index 6b632e3..564a459 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -229,19 +229,16 @@ static void test_qga_ping(gconstpointer fix) static void test_qga_invalid_id(gconstpointer fix) { - /* - * FIXME "id" is ignored; it should either be repeated in the - * reply, or rejected on input - */ const TestFixture *fixture = fix; - QDict *ret, *val; + QDict *ret, *error; + const char *class; ret = qmp_fd(fixture->fd, "{'execute': 'guest-ping', 'id': 1}"); g_assert_nonnull(ret); - qmp_assert_no_error(ret); - val = qdict_get_qdict(ret, "return"); - g_assert(!qdict_haskey(val, "id")); + error = qdict_get_qdict(ret, "error"); + class = qdict_get_try_str(error, "class"); + g_assert_cmpstr(class, ==, "GenericError"); qobject_unref(ret); } |