libqtest: split QMP part in libqmp

This will help moving QAPI/QMP in a common subproject.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-03-30 13:34:11 +04:00
parent 907b5105f1
commit c6d3bcb4b9
6 changed files with 290 additions and 234 deletions

View file

@ -19,6 +19,7 @@
#include "qapi/qmp/qobject.h"
#include "qapi/qmp/qdict.h"
#include "libqmp.h"
typedef struct QTestState QTestState;
@ -690,16 +691,6 @@ void qtest_remove_abrt_handler(void *data);
void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
G_GNUC_PRINTF(2, 3);
QDict *qmp_fd_receive(int fd);
void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0);
void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
QDict *qmp_fdv(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
QDict *qmp_fd(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
/**
* qtest_cb_for_every_machine:
* @cb: Pointer to the callback function
@ -771,24 +762,6 @@ void qtest_qmp_add_client(QTestState *qts, const char *protocol, int fd);
*/
void qtest_qmp_device_del(QTestState *qts, const char *id);
/**
* qmp_rsp_is_err:
* @rsp: QMP response to check for error
*
* Test @rsp for error and discard @rsp.
* Returns 'true' if there is error in @rsp and 'false' otherwise.
*/
bool qmp_rsp_is_err(QDict *rsp);
/**
* qmp_expect_error_and_unref:
* @rsp: QMP response to check for error
* @class: an error class
*
* Assert the response has the given error class and discard @rsp.
*/
void qmp_expect_error_and_unref(QDict *rsp, const char *class);
/**
* qtest_probe_child:
* @s: QTestState instance to operate on.