]> git.proxmox.com Git - mirror_qemu.git/blame - tests/qtest/libqmp.h
Clean up ill-advised or unusual header guards
[mirror_qemu.git] / tests / qtest / libqmp.h
CommitLineData
c6d3bcb4
MAL
1/*
2 * libqmp test unit
3 *
4 * Copyright IBM, Corp. 2012
5 * Copyright Red Hat, Inc. 2012
6 * Copyright SUSE LINUX Products GmbH 2013
7 *
8 * Authors:
9 * Anthony Liguori <aliguori@us.ibm.com>
10 * Paolo Bonzini <pbonzini@redhat.com>
11 * Andreas Färber <afaerber@suse.de>
12 *
13 * This work is licensed under the terms of the GNU GPL, version 2 or later.
14 * See the COPYING file in the top-level directory.
15 *
16 */
9c092804
MA
17
18#ifndef LIBQMP_H
19#define LIBQMP_H
c6d3bcb4
MAL
20
21#include "qapi/qmp/qdict.h"
22
23QDict *qmp_fd_receive(int fd);
24void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
25 const char *fmt, va_list ap) G_GNUC_PRINTF(4, 0);
26void qmp_fd_vsend(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
27void qmp_fd_send(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
28void qmp_fd_send_raw(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
29void qmp_fd_vsend_raw(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
30QDict *qmp_fdv(int fd, const char *fmt, va_list ap) G_GNUC_PRINTF(2, 0);
31QDict *qmp_fd(int fd, const char *fmt, ...) G_GNUC_PRINTF(2, 3);
32
33/**
34 * qmp_rsp_is_err:
35 * @rsp: QMP response to check for error
36 *
37 * Test @rsp for error and discard @rsp.
38 * Returns 'true' if there is error in @rsp and 'false' otherwise.
39 */
40bool qmp_rsp_is_err(QDict *rsp);
41
42/**
43 * qmp_expect_error_and_unref:
44 * @rsp: QMP response to check for error
45 * @class: an error class
46 *
47 * Assert the response has the given error class and discard @rsp.
48 */
49void qmp_expect_error_and_unref(QDict *rsp, const char *class);
50
9c092804 51#endif /* LIBQMP_H */