Skip to contentSkip to conversation

: Error out if the real braille device is not connected

PATCH New Samuel Thibault 1 participant 1 message Sep 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Error out if the real braille device is not connected

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.

backends/baum.c +5 -0
index 759003f..f5fcdaa 100644
@@ -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));