5 #include "libqos/pci.h"
6 #include "libqos/malloc-pc.h"
8 typedef struct QOSState QOSState
;
10 typedef struct QOSOps
{
11 QGuestAllocator
*(*init_allocator
)(QAllocOpts
);
12 void (*uninit_allocator
)(QGuestAllocator
*);
13 QPCIBus
*(*qpci_init
)(QGuestAllocator
*alloc
);
14 void (*qpci_free
)(QPCIBus
*bus
);
15 void (*shutdown
)(QOSState
*);
20 QGuestAllocator
*alloc
;
25 QOSState
*qtest_vboot(QOSOps
*ops
, const char *cmdline_fmt
, va_list ap
);
26 QOSState
*qtest_boot(QOSOps
*ops
, const char *cmdline_fmt
, ...);
27 void qtest_common_shutdown(QOSState
*qs
);
28 void qtest_shutdown(QOSState
*qs
);
29 bool have_qemu_img(void);
30 void mkimg(const char *file
, const char *fmt
, unsigned size_mb
);
31 void mkqcow2(const char *file
, unsigned size_mb
);
32 void set_context(QOSState
*s
);
33 void migrate(QOSState
*from
, QOSState
*to
, const char *uri
);
34 void prepare_blkdebug_script(const char *debug_fn
, const char *event
);
35 void generate_pattern(void *buffer
, size_t len
, size_t cycle_len
);
37 static inline uint64_t qmalloc(QOSState
*q
, size_t bytes
)
39 return guest_alloc(q
->alloc
, bytes
);
42 static inline void qfree(QOSState
*q
, uint64_t addr
)
44 guest_free(q
->alloc
, addr
);