libqtest: Clean up qmp_response() a bit

Use qobject_to_qdict() instead of a type cast.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1487363905-9480-6-git-send-email-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Markus Armbruster 2017-02-17 21:38:16 +01:00
parent 9eaaf97168
commit 4d96f329cc

View File

@ -379,9 +379,9 @@ static void qmp_response(JSONMessageParser *parser, GQueue *tokens)
exit(1);
}
g_assert(qobject_type(obj) == QTYPE_QDICT);
g_assert(!qmp->response);
qmp->response = (QDict *)obj;
qmp->response = qobject_to_qdict(obj);
g_assert(qmp->response);
}
QDict *qmp_fd_receive(int fd)