qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	qemu-devel@nongnu.org, pbonzini@redhat.com,
	marcandre.lureau@redhat.com
Subject: Re: [Qemu-devel] [PATCH] baum: Truncate braille device size to 84x1
Date: Mon, 11 Dec 2017 08:30:39 -0600	[thread overview]
Message-ID: <f0cb9660-757c-385f-ace7-73330014e733@redhat.com> (raw)
In-Reply-To: <20171211001950.27843-1-samuel.thibault@ens-lyon.org>

[-- Attachment #1: Type: text/plain, Size: 865 bytes --]

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.thibault@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?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2017-12-11 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11  0:19 [Qemu-devel] [PATCH] baum: Truncate braille device size to 84x1 Samuel Thibault
2017-12-11 14:30 ` Eric Blake [this message]
2017-12-11 14:51   ` Samuel Thibault
2017-12-12 14:11     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0cb9660-757c-385f-ace7-73330014e733@redhat.com \
    --to=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@ens-lyon.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).