]> git.proxmox.com Git - mirror_qemu.git/blob - tests/libqos/libqos.h
Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging
[mirror_qemu.git] / tests / libqos / libqos.h
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
8 typedef struct QOSOps {
9 QGuestAllocator *(*init_allocator)(QAllocOpts);
10 void (*uninit_allocator)(QGuestAllocator *);
11 } QOSOps;
12
13 typedef struct QOSState {
14 QTestState *qts;
15 QGuestAllocator *alloc;
16 QOSOps *ops;
17 } QOSState;
18
19 QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap);
20 QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...);
21 void qtest_shutdown(QOSState *qs);
22
23 static inline uint64_t qmalloc(QOSState *q, size_t bytes)
24 {
25 return guest_alloc(q->alloc, bytes);
26 }
27
28 static inline void qfree(QOSState *q, uint64_t addr)
29 {
30 guest_free(q->alloc, addr);
31 }
32
33 #endif