Received: from eggs.gnu.org ([2001:4830:134:3::10]:51395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQkHv-0001dD-VB for qemu-devel@nongnu.org; Sun, 07 Sep 2014 17:46:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQkHp-0001qi-TU for qemu-devel@nongnu.org; Sun, 07 Sep 2014 17:46:23 -0400 Received: from domu-toccata.ens-lyon.fr ([140.77.166.138]:55587 helo=sonata.ens-lyon.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQkHp-0001qe-NJ for qemu-devel@nongnu.org; Sun, 07 Sep 2014 17:46:17 -0400 Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 6F945200A9 for ; Sun, 7 Sep 2014 23:46:16 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E_8qywsPuL-L for ; Sun, 7 Sep 2014 23:46:16 +0200 (CEST) Received: from type.youpi.perso.aquilenet.fr (youpi.perso.aquilenet.fr [80.67.176.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id 3F896200A2 for ; Sun, 7 Sep 2014 23:46:16 +0200 (CEST) Received: from samy by type.youpi.perso.aquilenet.fr with local (Exim 4.84) (envelope-from ) id 1XQk7V-0006mn-P7 for qemu-devel@nongnu.org; Sun, 07 Sep 2014 23:35:37 +0200 Date: Sun, 7 Sep 2014 23:35:37 +0200 From: Samuel Thibault Message-ID: <20140907213537.GA25610@type.youpi.perso.aquilenet.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH, braille]: Error out if the real braille device is not connected List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU When the real braille device which will be used to render the output of the virtual one is not plugged, brlapi can not provide the size, and reports 0. This makes the baum virtual device basically ignore all display packets, thus failing probes from device drivers, without the possibility for any message to the user to understand what is happening. This change makes qemu refuse to configure the character device in such case, and let the user know what to fix. Signed-off-by: Samuel Thibault diff --git a/backends/baum.c b/backends/baum.c index 759003f..f5fcdaa 100644 --- a/backends/baum.c +++ b/backends/baum.c @@ -597,6 +597,11 @@ CharDriverState *chr_baum_init(void) goto fail; } + if (baum->x == 0 || baum->y == 0) { + fprintf(stderr, "baum_init: braille display size is %dx%d! Is a braille device connected on the host?\n", baum->x, baum->y); + goto fail; + } + #if defined(CONFIG_SDL) #if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0) memset(&info, 0, sizeof(info));