From patchwork Mon Jun 20 15:00:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 9187983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F158D607D1 for ; Mon, 20 Jun 2016 15:57:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE8492766D for ; Mon, 20 Jun 2016 15:57:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D35D9279E0; Mon, 20 Jun 2016 15:57:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id D31C52766D for ; Mon, 20 Jun 2016 15:57:44 +0000 (UTC) Received: from localhost ([::1]:44550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF1a3-0002F3-Oj for patchwork-qemu-devel@patchwork.kernel.org; Mon, 20 Jun 2016 11:57:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF0gf-0001FJ-FT for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:00:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF0gd-000217-6h for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:00:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF0gc-00020l-V8 for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:00:27 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4047A49E4 for ; Mon, 20 Jun 2016 15:00:25 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-49.ams2.redhat.com [10.36.116.49]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5KF0OB8006348 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 20 Jun 2016 11:00:25 -0400 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D58EB11386AD; Mon, 20 Jun 2016 17:00:23 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 20 Jun 2016 17:00:17 +0200 Message-Id: <1466434823-22789-2-git-send-email-armbru@redhat.com> In-Reply-To: <1466434823-22789-1-git-send-email-armbru@redhat.com> References: <1466434823-22789-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 20 Jun 2016 15:00:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/7] vl: Error messages need to go to stderr, fix some X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 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" X-Virus-Scanned: ClamAV using ClamSMTP We print a few fatal error messages to stdout instead of stderr. Reproducer: $ qemu-system-x86_64 -g 1024x768 Option g not supported for this target $ qemu-system-x86_64 -g 1024x768 >/dev/null Fix by printing them with error_report(). This also improves the messages. The above one becomes qemu-system-x86_64: -g 1024x768: Option not supported for this target Reported-by: Tobi {github.com/tobimensch} Signed-off-by: Markus Armbruster Message-Id: <1464683498-28779-1-git-send-email-armbru@redhat.com> Reviewed-by: Marcel Apfelbaum --- vl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vl.c b/vl.c index 2f63eb4..18af70a 100644 --- a/vl.c +++ b/vl.c @@ -3068,7 +3068,7 @@ int main(int argc, char **argv, char **envp) popt = lookup_opt(argc, argv, &optarg, &optind); if (!(popt->arch_mask & arch_type)) { - printf("Option %s not supported for this target\n", popt->name); + error_report("Option not supported for this target"); exit(1); } switch(popt->index) { @@ -3846,21 +3846,21 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_xen_domid: if (!(xen_available())) { - printf("Option %s not supported for this target\n", popt->name); + error_report("Option not supported for this target"); exit(1); } xen_domid = atoi(optarg); break; case QEMU_OPTION_xen_create: if (!(xen_available())) { - printf("Option %s not supported for this target\n", popt->name); + error_report("Option not supported for this target"); exit(1); } xen_mode = XEN_CREATE; break; case QEMU_OPTION_xen_attach: if (!(xen_available())) { - printf("Option %s not supported for this target\n", popt->name); + error_report("Option not supported for this target"); exit(1); } xen_mode = XEN_ATTACH;