From patchwork Mon Oct 26 18:08:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 536139 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 E019F1402B2 for ; Tue, 27 Oct 2015 05:08:32 +1100 (AEDT) Received: from localhost ([::1]:54432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqmC6-0001Ov-KO for incoming@patchwork.ozlabs.org; Mon, 26 Oct 2015 14:08:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqmBr-00017u-3J for qemu-devel@nongnu.org; Mon, 26 Oct 2015 14:08:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqmBm-00012T-4N for qemu-devel@nongnu.org; Mon, 26 Oct 2015 14:08:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39158) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqmBl-00012M-Uq for qemu-devel@nongnu.org; Mon, 26 Oct 2015 14:08:10 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 766978535A for ; Mon, 26 Oct 2015 18:08:09 +0000 (UTC) Received: from localhost (ovpn-113-193.phx2.redhat.com [10.3.113.193]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9QI87YP023124; Mon, 26 Oct 2015 14:08:08 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Mon, 26 Oct 2015 16:08:01 -0200 Message-Id: <1445882881-16364-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , Andrew Jones , Markus Armbruster Subject: [Qemu-devel] [PATCH] vl.c: Use error_report() when reporting shutdown signal 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 This usage of fprintf(stderr) can't be directly converted to error_report() like the others, because a single error message is split into multiple fprintf() calls. Make separate error_report() calls for each case. Suggested-by: Markus Armbruster Signed-off-by: Eduardo Habkost Reviewed-by: Markus Armbruster --- vl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vl.c b/vl.c index dffaf09..afe01b04 100644 --- a/vl.c +++ b/vl.c @@ -1624,14 +1624,14 @@ static int qemu_shutdown_requested(void) static void qemu_kill_report(void) { if (!qtest_driver() && shutdown_signal != -1) { - fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal); if (shutdown_pid == 0) { /* This happens for eg ^C at the terminal, so it's worth * avoiding printing an odd message in that case. */ - fputc('\n', stderr); + error_report("terminating on signal %d", shutdown_signal); } else { - fprintf(stderr, " from pid " FMT_pid "\n", shutdown_pid); + error_report("terminating on signal %d from pid " FMT_pid, + shutdown_signal, shutdown_pid); } shutdown_signal = -1; }