From patchwork Mon Mar 14 11:21:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev" X-Patchwork-Id: 597010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qNwMh2HVXz9sdQ for ; Mon, 14 Mar 2016 22:22:40 +1100 (AEDT) Received: from localhost ([::1]:40178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afQa6-00022l-0w for incoming@patchwork.ozlabs.org; Mon, 14 Mar 2016 07:22:38 -0400 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 Received: from hades.sw.ru ([10.30.8.132]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u2EBLf92003660; Mon, 14 Mar 2016 14:21:46 +0300 (MSK) From: "Denis V. Lunev" To: Date: Mon, 14 Mar 2016 14:21:33 +0300 Message-Id: <1457954501-26528-2-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457954501-26528-1-git-send-email-den@openvz.org> References: <1457954501-26528-1-git-send-email-den@openvz.org> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x X-Received-From: 195.214.232.25 Cc: "Denis V. Lunev" , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini Subject: [Qemu-devel] [PATCH 1/9] trace: do not always call exit() in trace_enable_events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.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 CC: Stefan Hajnoczi CC: Paolo Bonzini Reviewed-by: 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); }