]> www.infradead.org Git - users/dwmw2/qemu.git/commit
qtest: Reintroduce qtest_qmp_receive with QMP event buffering
authorMaxim Levitsky <mlevitsk@redhat.com>
Tue, 6 Oct 2020 12:38:53 +0000 (15:38 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Oct 2020 15:50:48 +0000 (11:50 -0400)
commitc22045bfe6d5ceebd414ff53ff23fff7ad5930d1
tree4308e0c4336d2529d752f6595da5252f9e9314a6
parent1c3e2a38de4e3094dfaf1e4dd73b1e5a91df8fe9
qtest: Reintroduce qtest_qmp_receive with QMP event buffering

The new qtest_qmp_receive buffers all the received qmp events, allowing
qtest_qmp_eventwait_ref to return them.

This is intended to solve the race in regard to ordering of qmp events
vs qmp responses, as soon as the callers start using the new interface.

In addition to that, define qtest_qmp_event_ref a function which only scans
the buffer that qtest_qmp_receive stores the events to.  This is intended
for callers that are only interested in events that were received during
the last call to the qtest_qmp_receive.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201006123904.610658-3-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests/qtest/libqos/libqtest.h
tests/qtest/libqtest.c