* [Qemu-devel] [PATCH] qtest: fix qtest log fd should be initialized before qtest chardev
@ 2014-09-03 9:52 john.liuli
2014-09-22 16:21 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: john.liuli @ 2014-09-03 9:52 UTC (permalink / raw)
To: mst; +Cc: Li Liu, qemu-devel
From: Li Liu <john.liuli@huawei.com>
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 <john.liuli@huawei.com>
---
qtest.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/qtest.c b/qtest.c
index ef0d991..2a33d98 100644
--- a/qtest.c
+++ b/qtest.c
@@ -537,11 +537,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+");
@@ -550,6 +545,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.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] qtest: fix qtest log fd should be initialized before qtest chardev
2014-09-03 9:52 [Qemu-devel] [PATCH] qtest: fix qtest log fd should be initialized before qtest chardev john.liuli
@ 2014-09-22 16:21 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2014-09-22 16:21 UTC (permalink / raw)
To: john.liuli; +Cc: qemu-devel, Andreas Faerber, mst
[-- Attachment #1: Type: text/plain, Size: 681 bytes --]
On Wed, Sep 03, 2014 at 05:52:06PM +0800, john.liuli wrote:
> From: Li Liu <john.liuli@huawei.com>
>
> 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 <john.liuli@huawei.com>
> ---
> qtest.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-22 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 9:52 [Qemu-devel] [PATCH] qtest: fix qtest log fd should be initialized before qtest chardev john.liuli
2014-09-22 16:21 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).