From: Christian Borntraeger <borntraeger@de.ibm.com>
To: aliguori@us.ibm.com
Cc: "Christian Borntraeger" <borntraeger@de.ibm.com>,
"Michael Mueller" <mimu@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, Lluís <xscript@gmx.net>
Subject: [Qemu-devel] [PATCH 02/12] trace+libvirt: start trace processing thread in final child process
Date: Mon, 15 Jul 2013 21:41:19 +0200 [thread overview]
Message-ID: <1373917279-15360-1-git-send-email-borntraeger@de.ibm.com> (raw)
From: Michael Mueller <mimu@linux.vnet.ibm.com>
When running with trace backend e.g. "simple" the writer thread needs to be
implemented in the same process context as the trace points that will be
processed. Under libvirtd control, qemu gets first started in daemonized
mode to privide its capabilities. Creating the writer thread in the initial
process context then leads to a dead lock because the thread gets termined
together with the initial parent. (-daemonize) This results in
stale qemu processes.
Fix this by deferring trace initialization.
Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
[Christian Borntraeger: white space fixes]
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
vl.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 25b8f2f..3c24108 100644
--- a/vl.c
+++ b/vl.c
@@ -3935,8 +3935,10 @@ int main(int argc, char **argv, char **envp)
qemu_set_log(mask);
}
- if (!trace_backend_init(trace_events, trace_file)) {
- exit(1);
+ if (!is_daemonized()) {
+ if (!trace_backend_init(trace_events, trace_file)) {
+ exit(1);
+ }
}
/* If no data_dir is specified then try to find it relative to the
@@ -4429,6 +4431,12 @@ int main(int argc, char **argv, char **envp)
os_setup_post();
+ if (is_daemonized()) {
+ if (!trace_backend_init(trace_events, trace_file)) {
+ exit(1);
+ }
+ }
+
main_loop();
bdrv_close_all();
pause_all_vcpus();
--
1.8.1.4
next reply other threads:[~2013-07-15 19:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 19:41 Christian Borntraeger [this message]
2013-07-16 3:05 ` [Qemu-devel] [PATCH 02/12] trace+libvirt: start trace processing thread in final child process Stefan Hajnoczi
2013-07-16 12:17 ` Michael Mueller
2013-07-17 2:08 ` Stefan Hajnoczi
2013-09-06 14:06 ` Michael Mueller
2013-09-23 13:09 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373917279-15360-1-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=mimu@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=xscript@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).