tests/qtest: add support for callback to receive QMP events
commit0150e75d012b34182fa1951d346377f8196464e4
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 1 Jun 2023 16:13:39 +0000 (1 17:13 +0100)
committerJuan Quintela <quintela@redhat.com>
Fri, 2 Jun 2023 09:46:19 +0000 (2 11:46 +0200)
tree7148597e189f58c2a43462e6e1937bae62ed1e41
parent28760edcd9589c1d8a39b25993ec46128865ca30
tests/qtest: add support for callback to receive QMP events

Currently code must call one of the qtest_qmp_event* functions to
fetch events. These are only usable if the immediate caller knows
the particular event they want to capture, and are only interested
in one specific event type. Adding ability to register an event
callback lets the caller capture a range of events over any period
of time.

Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230601161347.1803440-3-berrange@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
tests/qtest/libqtest.c
tests/qtest/libqtest.h