qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	"Denis V. Lunev" <den@openvz.org>
Subject: [Qemu-devel] [PULL 2/4] trace: do not always call exit() in trace_enable_events
Date: Thu, 31 Mar 2016 13:35:36 +0100	[thread overview]
Message-ID: <1459427738-5806-3-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1459427738-5806-1-git-send-email-stefanha@redhat.com>

From: "Denis V. Lunev" <den@openvz.org>

The problem is that
  virsh qemu-monitor-command --hmp VM log trace:help
forces QEMU to exit even when running VM normally.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1458128212-4197-2-git-send-email-den@openvz.org
CC: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 trace/control.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/trace/control.c b/trace/control.c
index ccddda5..d099f73 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -20,6 +20,7 @@
 #include "qemu/log.h"
 #endif
 #include "qemu/error-report.h"
+#include "monitor/monitor.h"
 
 int trace_events_enabled_count;
 bool trace_events_dstate[TRACE_EVENT_COUNT];
@@ -132,7 +133,9 @@ void trace_enable_events(const char *line_buf)
 {
     if (is_help_option(line_buf)) {
         trace_list_events();
-        exit(0);
+        if (cur_mon == NULL) {
+            exit(0);
+        }
     } else {
         do_trace_enable_events(line_buf);
     }
-- 
2.5.5

  parent reply	other threads:[~2016-03-31 12:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31 12:35 [Qemu-devel] [PULL 0/4] Tracing patches Stefan Hajnoczi
2016-03-31 12:35 ` [Qemu-devel] [PULL 1/4] docs: Update documentation for stderr (now log) tracing backend Stefan Hajnoczi
2016-03-31 12:35 ` Stefan Hajnoczi [this message]
2016-03-31 12:35 ` [Qemu-devel] [PULL 3/4] log: move qemu_log_close/qemu_log_flush from header to log.c Stefan Hajnoczi
2016-03-31 12:35 ` [Qemu-devel] [PULL 4/4] trace-events: Fix typos (found by codespell) Stefan Hajnoczi
2016-03-31 13:58 ` [Qemu-devel] [PULL 0/4] Tracing patches Peter Maydell

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=1459427738-5806-3-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=den@openvz.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).