qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH, braille]: Error out if the real braille device is n


From: Samuel Thibault
Subject: [Qemu-devel] [PATCH, braille]: Error out if the real braille device is not connected
Date: Sun, 7 Sep 2014 23:35:37 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

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 <address@hidden>

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));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]