]> git.proxmox.com Git - mirror_qemu.git/blame - tests/libqos/libqos.h
libqtest: add qmp_async
[mirror_qemu.git] / tests / libqos / libqos.h
CommitLineData
dd0029c0
JS
1#ifndef __libqos_h
2#define __libqos_h
3
4#include "libqtest.h"
5#include "libqos/pci.h"
6#include "libqos/malloc-pc.h"
7
90e5add6
JS
8typedef struct QOSOps {
9 QGuestAllocator *(*init_allocator)(QAllocOpts);
10 void (*uninit_allocator)(QGuestAllocator *);
11} QOSOps;
12
dd0029c0
JS
13typedef struct QOSState {
14 QTestState *qts;
15 QGuestAllocator *alloc;
90e5add6 16 QOSOps *ops;
dd0029c0
JS
17} QOSState;
18
90e5add6
JS
19QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap);
20QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...);
dd0029c0 21void qtest_shutdown(QOSState *qs);
122fdf2d
JS
22void mkimg(const char *file, const char *fmt, unsigned size_mb);
23void mkqcow2(const char *file, unsigned size_mb);
dd0029c0
JS
24
25static inline uint64_t qmalloc(QOSState *q, size_t bytes)
26{
27 return guest_alloc(q->alloc, bytes);
28}
29
30static inline void qfree(QOSState *q, uint64_t addr)
31{
32 guest_free(q->alloc, addr);
33}
34
35#endif