From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqbcM-0006K0-Rh for qemu-devel@nongnu.org; Thu, 14 Apr 2016 03:23:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqbcH-0000vv-OJ for qemu-devel@nongnu.org; Thu, 14 Apr 2016 03:23:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqbcH-0000vr-Ie for qemu-devel@nongnu.org; Thu, 14 Apr 2016 03:23:05 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 A05383E50F2 for ; Thu, 14 Apr 2016 07:23:04 +0000 (UTC) References: <1460595118-23127-1-git-send-email-ehabkost@redhat.com> <1460595118-23127-2-git-send-email-ehabkost@redhat.com> From: Marcel Apfelbaum Message-ID: <570F4555.7000307@redhat.com> Date: Thu, 14 Apr 2016 10:23:01 +0300 MIME-Version: 1.0 In-Reply-To: <1460595118-23127-2-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.7 v2 1/3] vl: Use exit(1) when requested VGA interface is unavailable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Paolo Bonzini , "Michael S. Tsirkin" On 04/14/2016 03:51 AM, Eduardo Habkost wrote: > 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 > Signed-off-by: Eduardo Habkost > --- > vl.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/vl.c b/vl.c > index 9df534f..3c565bb 100644 > --- a/vl.c > +++ b/vl.c > @@ -2025,28 +2025,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; > @@ -2055,21 +2055,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: > Reviewed-by: Marcel Apfelbaum Thanks, Marcel