]>
Commit | Line | Data |
---|---|---|
2a6a4076 MA |
1 | #ifndef LIBQOS_H |
2 | #define LIBQOS_H | |
dd0029c0 JS |
3 | |
4 | #include "libqtest.h" | |
5 | #include "libqos/pci.h" | |
6 | #include "libqos/malloc-pc.h" | |
7 | ||
90e5add6 JS |
8 | typedef struct QOSOps { |
9 | QGuestAllocator *(*init_allocator)(QAllocOpts); | |
10 | void (*uninit_allocator)(QGuestAllocator *); | |
2ecd7e2f LV |
11 | QPCIBus *(*qpci_init)(QGuestAllocator *alloc); |
12 | void (*qpci_free)(QPCIBus *bus); | |
90e5add6 JS |
13 | } QOSOps; |
14 | ||
dd0029c0 JS |
15 | typedef struct QOSState { |
16 | QTestState *qts; | |
17 | QGuestAllocator *alloc; | |
2ecd7e2f | 18 | QPCIBus *pcibus; |
90e5add6 | 19 | QOSOps *ops; |
dd0029c0 JS |
20 | } QOSState; |
21 | ||
90e5add6 JS |
22 | QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap); |
23 | QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...); | |
dd0029c0 | 24 | void qtest_shutdown(QOSState *qs); |
cb11e7b2 | 25 | bool have_qemu_img(void); |
122fdf2d JS |
26 | void mkimg(const char *file, const char *fmt, unsigned size_mb); |
27 | void mkqcow2(const char *file, unsigned size_mb); | |
085248ae JS |
28 | void set_context(QOSState *s); |
29 | void migrate(QOSState *from, QOSState *to, const char *uri); | |
72c85e94 | 30 | void prepare_blkdebug_script(const char *debug_fn, const char *event); |
ab4f7057 | 31 | void generate_pattern(void *buffer, size_t len, size_t cycle_len); |
dd0029c0 JS |
32 | |
33 | static inline uint64_t qmalloc(QOSState *q, size_t bytes) | |
34 | { | |
35 | return guest_alloc(q->alloc, bytes); | |
36 | } | |
37 | ||
38 | static inline void qfree(QOSState *q, uint64_t addr) | |
39 | { | |
40 | guest_free(q->alloc, addr); | |
41 | } | |
42 | ||
43 | #endif |