On Tue, Feb 19, 2019 at 10:05:03AM +0100, Jiri Denemark wrote:
From: Chris Venteicher <cventeic(a)redhat.com>
qemuProcessQMPStart starts a QEMU process and monitor connection that
can be used by multiple functions possibly for multiple QMP commands.
The QMP exchange to exit capabilities negotiation mode and enter command
mode can only be performed once after the monitor connection is
established.
Move responsibility for entering QMP command mode into the
qemuProcessQMP code so multiple functions can issue QMP commands in
arbitrary orders.
This also simplifies the functions using the connection provided by
qemuProcessQMPStart to issue QMP commands.
Test code now needs to call qemuMonitorSetCapabilities to send the
message to switch to command mode because the test code does not use the
qemuProcessQMP command that internally calls qemuMonitorSetCapabilities.
Signed-off-by: Chris Venteicher <cventeic(a)redhat.com>
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Version 7:
- qemuMonitorSetCapabilities call was moved into a new
qemuProcessQMPInitMonitor function, which is called from
qemuProcessQMPConnectMonitor and the tests
src/qemu/qemu_capabilities.c | 12 ------------
src/qemu/qemu_process.c | 16 ++++++++++++++++
src/qemu/qemu_processpriv.h | 2 ++
tests/qemucapabilitiestest.c | 9 +++++++++
4 files changed, 27 insertions(+), 12 deletions(-)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano