From patchwork Wed Mar 16 11:36:51 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: 8598841 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 346359F44D for ; Wed, 16 Mar 2016 11:38:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F8D320225 for ; Wed, 16 Mar 2016 11:38:26 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A482320212 for ; Wed, 16 Mar 2016 11:38:25 +0000 (UTC) Received: from localhost ([::1]:55393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag9mT-0008Fe-3v for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Mar 2016 07:38:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag9lD-0006TP-OD for qemu-devel@nongnu.org; Wed, 16 Mar 2016 07:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ag9l9-0001Th-Oz for qemu-devel@nongnu.org; Wed, 16 Mar 2016 07:37:07 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:23481 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ag9l9-0001Sr-Cs for qemu-devel@nongnu.org; Wed, 16 Mar 2016 07:37:03 -0400 Received: from irbis.sw.ru ([10.30.2.139]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id u2GBaqAn029599; Wed, 16 Mar 2016 14:36:56 +0300 (MSK) From: "Denis V. Lunev" To: qemu-devel@nongnu.org Date: Wed, 16 Mar 2016 14:36:51 +0300 Message-Id: <1458128212-4197-2-git-send-email-den@openvz.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458128212-4197-1-git-send-email-den@openvz.org> References: <1458128212-4197-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: pbonzini@redhat.com, Stefan Hajnoczi , "Denis V. Lunev" Subject: [Qemu-devel] [PATCH 1/2] 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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); }