aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2018-11-12 19:56:47 +0100
committerThomas Huth <thuth@redhat.com>2018-12-17 15:36:40 +0100
commite6426b74199e2c83185ef016596a624ab491e8a0 (patch)
treeed2b50ab2d7f3ea9176e4ad068d88ee7e60067ba
parent791a289badd77a9c920c59609ce0a4f5b1ed5f5e (diff)
downloadqemu-e6426b74199e2c83185ef016596a624ab491e8a0.zip
qemu-e6426b74199e2c83185ef016596a624ab491e8a0.tar.gz
qemu-e6426b74199e2c83185ef016596a624ab491e8a0.tar.bz2
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: Eric Blake <eblake@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/boot-serial-test.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c
index 8ec6aed..366fe51 100644
--- a/tests/boot-serial-test.c
+++ b/tests/boot-serial-test.c
@@ -161,6 +161,7 @@ static void test_machine(const void *data)
char codetmp[] = "/tmp/qtest-boot-serial-cXXXXXX";
const char *codeparam = "";
const uint8_t *code = NULL;
+ QTestState *qts;
int ser_fd;
ser_fd = mkstemp(serialtmp);
@@ -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
* fast-enough smoketest for that.
*/
- global_qtest = qtest_initf("%s %s -M %s,accel=tcg:kvm "
- "-chardev file,id=serial0,path=%s "
- "-no-shutdown -serial chardev:serial0 %s",
- codeparam, code ? codetmp : "",
- test->machine, serialtmp, test->extra);
+ qts = qtest_initf("%s %s -M %s,accel=tcg:kvm -no-shutdown "
+ "-chardev file,id=serial0,path=%s "
+ "-serial chardev:serial0 %s",
+ codeparam, code ? codetmp : "", test->machine,
+ serialtmp, test->extra);
if (code) {
unlink(codetmp);
}
@@ -204,7 +205,7 @@ static void test_machine(const void *data)
}
unlink(serialtmp);
- qtest_quit(global_qtest);
+ qtest_quit(qts);
close(ser_fd);
}