From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1albwB-0003ts-Oz for qemu-devel@nongnu.org; Thu, 31 Mar 2016 08:43:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1albw9-0001Ev-Gq for qemu-devel@nongnu.org; Thu, 31 Mar 2016 08:42:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1albw9-0001Eq-BA for qemu-devel@nongnu.org; Thu, 31 Mar 2016 08:42:57 -0400 From: Stefan Hajnoczi Date: Thu, 31 Mar 2016 13:35:36 +0100 Message-Id: <1459427738-5806-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1459427738-5806-1-git-send-email-stefanha@redhat.com> References: <1459427738-5806-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 2/4] trace: do not always call exit() in trace_enable_events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Hajnoczi , "Denis V. Lunev" From: "Denis V. Lunev" 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 Reviewed-by: Paolo Bonzini Message-id: 1458128212-4197-2-git-send-email-den@openvz.org CC: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- 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