[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/24] qtest: fix qtest log fd should be initialized
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 22/24] qtest: fix qtest log fd should be initialized before qtest chardev |
Date: |
Thu, 23 Oct 2014 15:34:10 +0200 |
From: Li Liu <address@hidden>
qtest_log_fp should be inited before qemu_chr_add_handlers.
If not the log dumped from callback functions may be lost.
easy to reproduce it by command:
"QTEST_LOG=1 QTEST_QEMU_BINARY=x86_64-softmmu/qemu-system-x86_64
gtester -k --verbose -m=quick tests/qdev-monitor-test"
The log "[I xxxxxx] OPENED" should be printed out by
qtest_event, but does not.
Signed-off-by: Li Liu <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qtest.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/qtest.c b/qtest.c
index 946b560..2bca04e 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;
}
--
1.8.3.1
- [Qemu-devel] [PULL 11/24] qdev: gpio: delete NamedGPIOList::out, (continued)
- [Qemu-devel] [PULL 11/24] qdev: gpio: delete NamedGPIOList::out, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 12/24] qdev: gpio: Remove qdev_init_gpio_out x1 restriction, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 13/24] qdev: gpio: Define qdev_pass_gpios(), Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 14/24] sysbus: Use TYPE_DEVICE GPIO functionality, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 16/24] MAINTAINERS: grab more files from Anthony's pile, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 17/24] MAINTAINERS: add Samuel Thibault as usb-serial.c and baum.c maintainer, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 18/24] MAINTAINERS: add myself for X86, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 19/24] MAINTAINERS: Add more TCG files, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 20/24] MAINTAINERS: add some tests directories, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 15/24] target-i386: warns users when CPU threads>1 for non-Intel CPUs, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 22/24] qtest: fix qtest log fd should be initialized before qtest chardev,
Paolo Bonzini <=
- [Qemu-devel] [PULL 21/24] MAINTAINERS: avoid M entries that point to mailing lists, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 24/24] get_maintainer.pl: restrict cases where it falls back to --git, Paolo Bonzini, 2014/10/23
- [Qemu-devel] [PULL 23/24] get_maintainer.pl: move git loop under "if ($email) {", Paolo Bonzini, 2014/10/23
- Re: [Qemu-devel] [PULL 00/24] SCSI, maintainers and more - 2014-10-17, Peter Maydell, 2014/10/23