From nobody Tue May 7 20:19:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512951679449274.90033249964506; Sun, 10 Dec 2017 16:21:19 -0800 (PST) Received: from localhost ([::1]:50260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOBq2-0006ta-Ic for importer@patchew.org; Sun, 10 Dec 2017 19:20:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOBp6-0006Y1-MP for qemu-devel@nongnu.org; Sun, 10 Dec 2017 19:19:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOBp5-00017R-RT for qemu-devel@nongnu.org; Sun, 10 Dec 2017 19:19:56 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:35903) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eOBp5-00015w-KW for qemu-devel@nongnu.org; Sun, 10 Dec 2017 19:19:55 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 39311F84F; Mon, 11 Dec 2017 01:19:56 +0100 (CET) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yxZtR4EtvmZ7; Mon, 11 Dec 2017 01:19:55 +0100 (CET) Received: from var.youpi.perso.aquilenet.fr (unknown [IPv6:2a01:cb19:181:c200:3602:86ff:fe2c:6a19]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 8BEB4F379; Mon, 11 Dec 2017 01:19:55 +0100 (CET) Received: from samy by var.youpi.perso.aquilenet.fr with local (Exim 4.90_RC3) (envelope-from ) id 1eOBp1-0007Fm-Ng; Mon, 11 Dec 2017 01:19:51 +0100 X-Virus-Scanned: Debian amavisd-new at aquilenet.fr From: Samuel Thibault To: qemu-devel@nongnu.org, pbonzini@redhat.com, marcandre.lureau@redhat.com Date: Mon, 11 Dec 2017 01:19:50 +0100 Message-Id: <20171211001950.27843-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.15.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a0c:e300::1 Subject: [Qemu-devel] [PATCH] baum: Truncate braille device size to 84x1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Baum device bigger than 84 do not actually exist, some guest drivers would be upset by such sizes. Signed-off-by: Samuel Thibault --- chardev/baum.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chardev/baum.c b/chardev/baum.c index 67fd783a59..78b0c87625 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -1,7 +1,7 @@ /* * QEMU Baum Braille Device * - * Copyright (c) 2008, 2010-2011, 2016 Samuel Thibault + * Copyright (c) 2008, 2010-2011, 2016-2017 Samuel Thibault * * Permission is hereby granted, free of charge, to any person obtaining a= copy * of this software and associated documentation files (the "Software"), t= o deal @@ -239,6 +239,12 @@ static int baum_deferred_init(BaumChardev *baum) brlapi_perror("baum: brlapi__getDisplaySize"); return 0; } + if (baum->y > 1) { + baum->y =3D 1; + } + if (baum->x > 84) { + baum->x =3D 84; + } =20 con =3D qemu_console_lookup_by_index(0); if (con && qemu_console_is_graphic(con)) { --=20 2.15.0