From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afQZT-0000ta-Dv for qemu-devel@nongnu.org; Mon, 14 Mar 2016 07:22:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afQZP-0003DX-Jh for qemu-devel@nongnu.org; Mon, 14 Mar 2016 07:21:59 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:21645 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afQZP-00038R-6i for qemu-devel@nongnu.org; Mon, 14 Mar 2016 07:21:55 -0400 From: "Denis V. Lunev" Date: Mon, 14 Mar 2016 14:21:33 +0300 Message-Id: <1457954501-26528-2-git-send-email-den@openvz.org> In-Reply-To: <1457954501-26528-1-git-send-email-den@openvz.org> References: <1457954501-26528-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] [PATCH 1/9] trace: do not always call exit() in trace_enable_events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Denis V. Lunev" , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini 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 CC: Stefan Hajnoczi CC: Paolo Bonzini --- trace/control.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trace/control.c b/trace/control.c index 20d3370..2d404c3 100644 --- a/trace/control.c +++ b/trace/control.c @@ -19,6 +19,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]; @@ -131,7 +132,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.0