Eric Blake, on lun. 11 déc. 2017 08:30:39 -0600, wrote:
> On 12/10/2017 06:19 PM, Samuel Thibault wrote:
> > Baum device bigger than 84 do not actually exist, some guest drivers
> > would be upset by such sizes.
> > 
> > Signed-off-by: Samuel Thibault <samuel.thiba...@ens-lyon.org>
> > ---
> >  chardev/baum.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> 
> > @@ -239,6 +239,12 @@ static int baum_deferred_init(BaumChardev *baum)
> >          brlapi_perror("baum: brlapi__getDisplaySize");
> >          return 0;
> >      }
> > +    if (baum->y > 1) {
> > +        baum->y = 1;
> > +    }
> > +    if (baum->x > 84) {
> > +        baum->x = 84;
> > +    }
> 
> Is magic clamping desirable, or is it better to make it a hard error if
> the user configured a size that is not possible?

The thing is: the user didn't configure something, she just happened to
use a braille device bigger than 84 to display qemu's braille output.

This is the same situation as for the virtual video card: qemu could
expose resolutions as big as the size of the X display where qemu is
running on, but it's not a good idea to expose them all because some
drivers could go crazy with sizes bigger than what is supposed to be
supported by the hardware (or just assume the device is bogus and refuse
to drive it), and one should thus rather clamp them to what an actual
video device would support.

Samuel

Reply via email to