mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 01:43:39 +00:00
tests: qtest: print device_add error before failing test
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-2-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
eac7a7791b
commit
0711c28497
|
@ -1435,6 +1435,10 @@ void qtest_qmp_device_add_qdict(QTestState *qts, const char *drv,
|
|||
resp = qtest_qmp(qts, "{'execute': 'device_add', 'arguments': %p}", args);
|
||||
g_assert(resp);
|
||||
g_assert(!qdict_haskey(resp, "event")); /* We don't expect any events */
|
||||
if (qdict_haskey(resp, "error")) {
|
||||
fprintf(stderr, "error: %s\n",
|
||||
qdict_get_str(qdict_get_qdict(resp, "error"), "desc"));
|
||||
}
|
||||
g_assert(!qdict_haskey(resp, "error"));
|
||||
qobject_unref(resp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue