From patchwork Fri May 20 20:28:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9130197 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 66EFD60221 for ; Fri, 20 May 2016 23:25:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59D7C27CF9 for ; Fri, 20 May 2016 23:25:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EB7427E72; Fri, 20 May 2016 23:25:58 +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 EE0F127CF9 for ; Fri, 20 May 2016 23:25:57 +0000 (UTC) Received: from localhost ([::1]:37969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3tnp-0004Mt-3A for patchwork-qemu-devel@patchwork.kernel.org; Fri, 20 May 2016 19:25:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3t8U-0001GG-MV for qemu-devel@nongnu.org; Fri, 20 May 2016 18:43:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3r2Y-000168-Di for qemu-devel@nongnu.org; Fri, 20 May 2016 16:29:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3r2Y-000164-8W for qemu-devel@nongnu.org; Fri, 20 May 2016 16:28:58 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 DA7DCC05B1D1; Fri, 20 May 2016 20:28:57 +0000 (UTC) Received: from localhost (vpn1-7-50.gru2.redhat.com [10.97.7.50]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4KKSujF024844; Fri, 20 May 2016 16:28:57 -0400 From: Eduardo Habkost To: Peter Maydell Date: Fri, 20 May 2016 17:28:22 -0300 Message-Id: <1463776121-13529-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1463776121-13529-1-git-send-email-ehabkost@redhat.com> References: <1463776121-13529-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 20 May 2016 20:28:57 +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 02/21] vl: Use exit(1) when requested VGA interface is unavailable 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: , Cc: Marcel Apfelbaum , Paolo Bonzini , qemu-devel@nongnu.org, "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of using exit(0), use exit(1) when an unavailable VGA interface is used in the command-line to indicate it's an error. Reviewed-by: Eric Blake Reviewed-by: Marcel Apfelbaum Signed-off-by: Eduardo Habkost --- vl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vl.c b/vl.c index a43a3ba..edfb5b9 100644 --- a/vl.c +++ b/vl.c @@ -2027,28 +2027,28 @@ static void select_vgahw (const char *p) vga_interface_type = VGA_STD; } else { error_report("standard VGA not available"); - exit(0); + exit(1); } } else if (strstart(p, "cirrus", &opts)) { if (cirrus_vga_available()) { vga_interface_type = VGA_CIRRUS; } else { error_report("Cirrus VGA not available"); - exit(0); + exit(1); } } else if (strstart(p, "vmware", &opts)) { if (vmware_vga_available()) { vga_interface_type = VGA_VMWARE; } else { error_report("VMWare SVGA not available"); - exit(0); + exit(1); } } else if (strstart(p, "virtio", &opts)) { if (virtio_vga_available()) { vga_interface_type = VGA_VIRTIO; } else { error_report("Virtio VGA not available"); - exit(0); + exit(1); } } else if (strstart(p, "xenfb", &opts)) { vga_interface_type = VGA_XENFB; @@ -2057,21 +2057,21 @@ static void select_vgahw (const char *p) vga_interface_type = VGA_QXL; } else { error_report("QXL VGA not available"); - exit(0); + exit(1); } } else if (strstart(p, "tcx", &opts)) { if (tcx_vga_available()) { vga_interface_type = VGA_TCX; } else { error_report("TCX framebuffer not available"); - exit(0); + exit(1); } } else if (strstart(p, "cg3", &opts)) { if (cg3_vga_available()) { vga_interface_type = VGA_CG3; } else { error_report("CG3 framebuffer not available"); - exit(0); + exit(1); } } else if (!strstart(p, "none", &opts)) { invalid_vga: