提交 1d9358e6 编写于 作者: M Markus Armbruster 提交者: Anthony Liguori

libqtest: New qtest_end() to go with qtest_start()

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NAndreas Färber <afaerber@suse.de>
Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
Message-id: 1371711329-9144-3-git-send-email-armbru@redhat.com
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 fdd26fca
...@@ -556,7 +556,7 @@ int main(int argc, char **argv) ...@@ -556,7 +556,7 @@ int main(int argc, char **argv)
ret = g_test_run(); ret = g_test_run();
/* Cleanup */ /* Cleanup */
qtest_quit(global_qtest); qtest_end();
unlink(test_image); unlink(test_image);
return ret; return ret;
......
...@@ -244,7 +244,7 @@ static void test_ide_none(void) ...@@ -244,7 +244,7 @@ static void test_ide_none(void)
setup_common(argv, ARRAY_SIZE(argv)); setup_common(argv, ARRAY_SIZE(argv));
qtest_start(g_strjoinv(" ", argv)); qtest_start(g_strjoinv(" ", argv));
test_cmos(); test_cmos();
qtest_quit(global_qtest); qtest_end();
} }
static void test_ide_mbr(bool use_device, MBRcontents mbr) static void test_ide_mbr(bool use_device, MBRcontents mbr)
...@@ -262,7 +262,7 @@ static void test_ide_mbr(bool use_device, MBRcontents mbr) ...@@ -262,7 +262,7 @@ static void test_ide_mbr(bool use_device, MBRcontents mbr)
} }
qtest_start(g_strjoinv(" ", argv)); qtest_start(g_strjoinv(" ", argv));
test_cmos(); test_cmos();
qtest_quit(global_qtest); qtest_end();
} }
/* /*
...@@ -334,7 +334,7 @@ static void test_ide_drive_user(const char *dev, bool trans) ...@@ -334,7 +334,7 @@ static void test_ide_drive_user(const char *dev, bool trans)
g_free(opts); g_free(opts);
qtest_start(g_strjoinv(" ", argv)); qtest_start(g_strjoinv(" ", argv));
test_cmos(); test_cmos();
qtest_quit(global_qtest); qtest_end();
} }
/* /*
...@@ -387,7 +387,7 @@ static void test_ide_drive_cd_0(void) ...@@ -387,7 +387,7 @@ static void test_ide_drive_cd_0(void)
} }
qtest_start(g_strjoinv(" ", argv)); qtest_start(g_strjoinv(" ", argv));
test_cmos(); test_cmos();
qtest_quit(global_qtest); qtest_end();
} }
int main(int argc, char **argv) int main(int argc, char **argv)
......
...@@ -122,7 +122,7 @@ static void ide_test_start(const char *cmdline_fmt, ...) ...@@ -122,7 +122,7 @@ static void ide_test_start(const char *cmdline_fmt, ...)
static void ide_test_quit(void) static void ide_test_quit(void)
{ {
qtest_quit(global_qtest); qtest_end();
} }
static QPCIDevice *get_pci_device(uint16_t *bmdma_base) static QPCIDevice *get_pci_device(uint16_t *bmdma_base)
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#ifndef LIBQTEST_H #ifndef LIBQTEST_H
#define LIBQTEST_H #define LIBQTEST_H
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -318,6 +319,17 @@ static inline QTestState *qtest_start(const char *args) ...@@ -318,6 +319,17 @@ static inline QTestState *qtest_start(const char *args)
return global_qtest; return global_qtest;
} }
/**
* qtest_end:
*
* Shut down the QEMU process started by qtest_start().
*/
static inline void qtest_end(void)
{
qtest_quit(global_qtest);
global_qtest = NULL;
}
/** /**
* qmp: * qmp:
* @fmt...: QMP message to send to qemu * @fmt...: QMP message to send to qemu
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册