提交 e6426b74 编写于 作者: T Thomas Huth

tests/boot-serial: Get rid of global_qtest variable

The test does not use any of the functions that require global_qtest,
so we can simply get rid of this global variable here.
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NThomas Huth <thuth@redhat.com>
上级 791a289b
...@@ -161,6 +161,7 @@ static void test_machine(const void *data) ...@@ -161,6 +161,7 @@ static void test_machine(const void *data)
char codetmp[] = "/tmp/qtest-boot-serial-cXXXXXX"; char codetmp[] = "/tmp/qtest-boot-serial-cXXXXXX";
const char *codeparam = ""; const char *codeparam = "";
const uint8_t *code = NULL; const uint8_t *code = NULL;
QTestState *qts;
int ser_fd; int ser_fd;
ser_fd = mkstemp(serialtmp); ser_fd = mkstemp(serialtmp);
...@@ -189,11 +190,11 @@ static void test_machine(const void *data) ...@@ -189,11 +190,11 @@ static void test_machine(const void *data)
* Make sure that this test uses tcg if available: It is used as a * Make sure that this test uses tcg if available: It is used as a
* fast-enough smoketest for that. * fast-enough smoketest for that.
*/ */
global_qtest = qtest_initf("%s %s -M %s,accel=tcg:kvm " qts = qtest_initf("%s %s -M %s,accel=tcg:kvm -no-shutdown "
"-chardev file,id=serial0,path=%s " "-chardev file,id=serial0,path=%s "
"-no-shutdown -serial chardev:serial0 %s", "-serial chardev:serial0 %s",
codeparam, code ? codetmp : "", codeparam, code ? codetmp : "", test->machine,
test->machine, serialtmp, test->extra); serialtmp, test->extra);
if (code) { if (code) {
unlink(codetmp); unlink(codetmp);
} }
...@@ -204,7 +205,7 @@ static void test_machine(const void *data) ...@@ -204,7 +205,7 @@ static void test_machine(const void *data)
} }
unlink(serialtmp); unlink(serialtmp);
qtest_quit(global_qtest); qtest_quit(qts);
close(ser_fd); close(ser_fd);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册