From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3mJ0-000617-Ne for qemu-devel@nongnu.org; Sat, 13 Jun 2015 10:21:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3mIw-0004mh-Sp for qemu-devel@nongnu.org; Sat, 13 Jun 2015 10:21:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3mIw-0004l0-Df for qemu-devel@nongnu.org; Sat, 13 Jun 2015 10:21:02 -0400 From: Markus Armbruster Date: Sat, 13 Jun 2015 16:20:50 +0200 Message-Id: <1434205258-1932-4-git-send-email-armbru@redhat.com> In-Reply-To: <1434205258-1932-1-git-send-email-armbru@redhat.com> References: <1434205258-1932-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH 03/11] vl: Use error_report() for --display errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, mdroth@linux.vnet.ibm.com, stefanha@redhat.com, lcapitulino@redhat.com Results in nicer error messages. Before this patch: Invalid GTK option string: gtk,lirum-larum After: qemu-system-x86_64: -display gtk,lirum-larum: Invalid GTK option string Of course, the thing ought to use QemuOpts instead of parsing by hand. Signed-off-by: Markus Armbruster --- vl.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vl.c b/vl.c index 3a6de4d..10c2cfc 100644 --- a/vl.c +++ b/vl.c @@ -2007,13 +2007,13 @@ static DisplayType select_display(const char *p) } } else { invalid_sdl_args: - fprintf(stderr, "Invalid SDL option string: %s\n", p); + error_report("Invalid SDL option string"); exit(1); } opts = nextopt; } #else - fprintf(stderr, "SDL support is disabled\n"); + error_report("SDL support is disabled"); exit(1); #endif } else if (strstart(p, "vnc", &opts)) { @@ -2024,18 +2024,18 @@ static DisplayType select_display(const char *p) exit(1); } } else { - fprintf(stderr, "VNC requires a display argument vnc=\n"); + error_report("VNC requires a display argument vnc="); exit(1); } #else - fprintf(stderr, "VNC support is disabled\n"); + error_report("VNC support is disabled"); exit(1); #endif } else if (strstart(p, "curses", &opts)) { #ifdef CONFIG_CURSES display = DT_CURSES; #else - fprintf(stderr, "Curses support is disabled\n"); + error_report("Curses support is disabled"); exit(1); #endif } else if (strstart(p, "gtk", &opts)) { @@ -2064,19 +2064,19 @@ static DisplayType select_display(const char *p) } } else { invalid_gtk_args: - fprintf(stderr, "Invalid GTK option string: %s\n", p); + error_report("Invalid GTK option string"); exit(1); } opts = nextopt; } #else - fprintf(stderr, "GTK support is disabled\n"); + error_report("GTK support is disabled"); exit(1); #endif } else if (strstart(p, "none", &opts)) { display = DT_NONE; } else { - fprintf(stderr, "Unknown display type: %s\n", p); + error_report("Unknown display type"); exit(1); } -- 1.9.3