tests/qtest: replace qmp_discard_response with qtest_qmp_assert_success
commit855436dbf756014a024f3e415001ead37301ef95
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 21 Apr 2023 17:14:06 +0000 (21 18:14 +0100)
committerThomas Huth <thuth@redhat.com>
Tue, 16 May 2023 07:14:18 +0000 (16 09:14 +0200)
treedf16140537c80af620907679b358c65cdad3ce4f
parenteb96660507ecbe479c6a38639861f65b23d067d7
tests/qtest: replace qmp_discard_response with qtest_qmp_assert_success

The qmp_discard_response method simply ignores the result of the QMP
command, merely unref'ing the object. This is a bad idea for tests
as it leaves no trace if the QMP command unexpectedly failed. The
qtest_qmp_assert_success method will validate that the QMP command
returned without error, and if errors occur, it will print a message
on the console aiding debugging.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230421171411.566300-2-berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/qtest/ahci-test.c
tests/qtest/boot-order-test.c
tests/qtest/fdc-test.c
tests/qtest/ide-test.c
tests/qtest/migration-test.c
tests/qtest/test-filter-mirror.c
tests/qtest/test-filter-redirector.c
tests/qtest/virtio-blk-test.c