Daniel P. Berrangé <berra...@redhat.com> wrote: > 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é <berra...@redhat.com> > --- > tests/qtest/ahci-test.c | 31 ++++++++++++++-------------- > tests/qtest/boot-order-test.c | 5 +---- > tests/qtest/fdc-test.c | 15 +++++++------- > tests/qtest/ide-test.c | 5 +---- > tests/qtest/migration-test.c | 5 +---- > tests/qtest/test-filter-mirror.c | 5 +---- > tests/qtest/test-filter-redirector.c | 7 ++----- > tests/qtest/virtio-blk-test.c | 24 ++++++++++----------- > 8 files changed, 40 insertions(+), 57 deletions(-)
Reviewed-by: Juan Quintela <quint...@redhat.com> > -/* TODO actually test the results and get rid of this */ > -#define qmp_discard_response(s, ...) qobject_unref(qtest_qmp(s, __VA_ARGS__)) As it couldn't be otherwise, all bad patterns are copied.