From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nrved-00047k-N2 for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:31 -0400 Received: from [199.232.76.173] (port=47300 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nrved-00047J-4e for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:31 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nrveb-0001Pl-H6 for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:30 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:46160) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nrveb-0001MN-6b for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:29 -0400 Received: by mail-pw0-f45.google.com with SMTP id 9so827239pwi.4 for ; Wed, 17 Mar 2010 08:59:28 -0700 (PDT) Message-ID: <4BA0FC5D.9040806@codemonkey.ws> Date: Wed, 17 Mar 2010 10:59:25 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] sdl: improve error message on fatal error References: <1268050034-7376-1-git-send-email-bjorn@mork.no> In-Reply-To: <1268050034-7376-1-git-send-email-bjorn@mork.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmrDuHJuIE1vcms=?= Cc: qemu-devel@nongnu.org On 03/08/2010 06:07 AM, Bjørn Mork wrote: > 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 > Applied. Thanks. Regards, Anthony Liguori > --- > 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); > } > } >