All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH, braille]: Error out if the real braille device is not connected
@ 2014-09-07 21:35 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2014-09-07 21:35 UTC (permalink / raw)
  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 <samuel.thibault@ens-lyon.org>

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-07 21:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-07 21:35 [Qemu-devel] [PATCH, braille]: Error out if the real braille device is not connected Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.