diff options
author | Laurent Vivier | 2016-09-29 12:32:46 +0200 |
---|---|---|
committer | David Gibson | 2016-10-06 07:15:53 +0200 |
commit | 61ae5cf3a2e1a7764a60fec69cd8731516d5fb83 (patch) | |
tree | d2badf5b2c18e8873ece68426e40d70bfa350531 /tests/libqos/libqos.h | |
parent | libqos: add PCI management in qtest_vboot()/qtest_shutdown() (diff) | |
download | qemu-61ae5cf3a2e1a7764a60fec69cd8731516d5fb83.tar.gz qemu-61ae5cf3a2e1a7764a60fec69cd8731516d5fb83.tar.xz qemu-61ae5cf3a2e1a7764a60fec69cd8731516d5fb83.zip |
libqos: use generic qtest_shutdown()
Machine specific shutdown function can be registered by
the machine specific qtest_XXX_boot() if needed.
So we will not have to test twice the architecture (on boot and on
shutdown) if the test can be run on several architectures.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/libqos/libqos.h')
-rw-r--r-- | tests/libqos/libqos.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/libqos/libqos.h b/tests/libqos/libqos.h index a9f699019c..231969766f 100644 --- a/tests/libqos/libqos.h +++ b/tests/libqos/libqos.h @@ -5,22 +5,26 @@ #include "libqos/pci.h" #include "libqos/malloc-pc.h" +typedef struct QOSState QOSState; + typedef struct QOSOps { QGuestAllocator *(*init_allocator)(QAllocOpts); void (*uninit_allocator)(QGuestAllocator *); QPCIBus *(*qpci_init)(QGuestAllocator *alloc); void (*qpci_free)(QPCIBus *bus); + void (*shutdown)(QOSState *); } QOSOps; -typedef struct QOSState { +struct QOSState { QTestState *qts; QGuestAllocator *alloc; QPCIBus *pcibus; QOSOps *ops; -} QOSState; +}; QOSState *qtest_vboot(QOSOps *ops, const char *cmdline_fmt, va_list ap); QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...); +void qtest_common_shutdown(QOSState *qs); void qtest_shutdown(QOSState *qs); bool have_qemu_img(void); void mkimg(const char *file, const char *fmt, unsigned size_mb); |