From: Marcel Apfelbaum <marcel@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.7 v2 1/3] vl: Use exit(1) when requested VGA interface is unavailable
Date: Thu, 14 Apr 2016 10:23:01 +0300 [thread overview]
Message-ID: <570F4555.7000307@redhat.com> (raw)
In-Reply-To: <1460595118-23127-2-git-send-email-ehabkost@redhat.com>
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 <eblake@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> 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 <marcel@redhat.com>
Thanks,
Marcel
next prev parent reply other threads:[~2016-04-14 7:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 0:51 [Qemu-devel] [PATCH for-2.7 v2 0/3] vl: Simplify vga interface configuration code Eduardo Habkost
2016-04-14 0:51 ` [Qemu-devel] [PATCH for-2.7 v2 1/3] vl: Use exit(1) when requested VGA interface is unavailable Eduardo Habkost
2016-04-14 7:23 ` Marcel Apfelbaum [this message]
2016-04-14 0:51 ` [Qemu-devel] [PATCH for-2.7 v2 2/3] vl: Table-based select_vgahw() Eduardo Habkost
2016-04-14 7:28 ` Marcel Apfelbaum
2016-04-14 0:51 ` [Qemu-devel] [PATCH for-2.7 v2 3/3] vl: Replace *_vga_available() functions with class_names field Eduardo Habkost
2016-04-14 7:40 ` Marcel Apfelbaum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=570F4555.7000307@redhat.com \
--to=marcel@redhat.com \
--cc=ehabkost@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).