From patchwork Mon Mar 8 12:07:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B8rn_Mork?= X-Patchwork-Id: 47112 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 50C9CB7CF0 for ; Mon, 8 Mar 2010 23:13:23 +1100 (EST) Received: from localhost ([127.0.0.1]:41628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NoblQ-0004XA-Ps for incoming@patchwork.ozlabs.org; Mon, 08 Mar 2010 07:08:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nobk5-0004Vm-Av for qemu-devel@nongnu.org; Mon, 08 Mar 2010 07:07:25 -0500 Received: from [199.232.76.173] (port=33811 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nobk4-0004V3-P3 for qemu-devel@nongnu.org; Mon, 08 Mar 2010 07:07:24 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nobk3-0002ax-8c for qemu-devel@nongnu.org; Mon, 08 Mar 2010 07:07:24 -0500 Received: from canardo.mork.no ([148.122.252.1]:48891) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nobk2-0002aR-Nw for qemu-devel@nongnu.org; Mon, 08 Mar 2010 07:07:23 -0500 Received: from canardo.mork.no (ip6-localhost [IPv6:::1]) by canardo.mork.no (8.14.3/8.14.3) with ESMTP id o28C7EEK007400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Mar 2010 13:07:14 +0100 Received: (from bjorn@localhost) by canardo.mork.no (8.14.3/8.14.3/Submit) id o28C7EhN007399; Mon, 8 Mar 2010 13:07:14 +0100 From: =?utf-8?q?Bj=C3=B8rn=20Mork?= To: qemu-devel@nongnu.org Date: Mon, 8 Mar 2010 13:07:14 +0100 Message-Id: <1268050034-7376-1-git-send-email-bjorn@mork.no> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.95.3 at canardo X-Virus-Status: Clean X-MIME-Autoconverted: from 8bit to quoted-printable by canardo.mork.no id o28C7EEK007400 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: =?utf-8?q?Bj=C3=B8rn=20Mork?= Subject: [Qemu-devel] [PATCH] sdl: improve error message on fatal error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The SDL_SetVideoMode() error condition is easily triggered by a user by simply configure a guest with a host unsupported display resolution and attempting to enable fullscreen. Since the error is fatal, adding a bit of debugging help can't harm. Sample output with this change: (qemu) Could not open SDL display (1280x1024x32): No video mode large enough for 1280x1024 The width x height might seem redundant as SDL also provides it in SDL_GetError(), but I believe there are situations where it is useful. I.e. if there is some other SDL error. Anyway, redundant information in fatal error messages has never harmed a single gerbil. Signed-off-by: Bjørn Mork --- sdl.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/sdl.c b/sdl.c index f26035c..34061c0 100644 --- a/sdl.c +++ b/sdl.c @@ -112,7 +112,8 @@ static void do_sdl_resize(int new_width, int new_height, int bpp) height = new_height; real_screen = SDL_SetVideoMode(width, height, bpp, flags); if (!real_screen) { - fprintf(stderr, "Could not open SDL display\n"); + fprintf(stderr, "Could not open SDL display (%dx%dx%d): %s\n", width, + height, bpp, SDL_GetError()); exit(1); } }