summaryrefslogtreecommitdiff
path: root/qtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'qtest.c')
-rw-r--r--qtest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/qtest.c b/qtest.c
index 946b560d6a..2bca04ed4c 100644
--- a/qtest.c
+++ b/qtest.c
@@ -545,11 +545,6 @@ void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
return;
}
- qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr);
- qemu_chr_fe_set_echo(chr, true);
-
- inbuf = g_string_new("");
-
if (qtest_log) {
if (strcmp(qtest_log, "none") != 0) {
qtest_log_fp = fopen(qtest_log, "w+");
@@ -558,6 +553,10 @@ void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
qtest_log_fp = stderr;
}
+ qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr);
+ qemu_chr_fe_set_echo(chr, true);
+
+ inbuf = g_string_new("");
qtest_chr = chr;
}