From patchwork Thu Mar 31 12:35:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 8712621 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B9CD6C0554 for ; Thu, 31 Mar 2016 12:43:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 300C820270 for ; Thu, 31 Mar 2016 12:43:17 +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 A94F7200F3 for ; Thu, 31 Mar 2016 12:43:11 +0000 (UTC) Received: from localhost ([::1]:60180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1albwN-0003vu-46 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 31 Mar 2016 08:43:11 -0400 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 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id EF602C04FF87; Thu, 31 Mar 2016 12:42:56 +0000 (UTC) Received: from localhost (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2VCgt0p005622; Thu, 31 Mar 2016 08:42:56 -0400 From: Stefan Hajnoczi To: 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Cc: Peter Maydell , Stefan Hajnoczi , "Denis V. Lunev" Subject: [Qemu-devel] [PULL 2/4] 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 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); }