Received: by 10.192.165.156 with SMTP id m28csp689177imm; Thu, 19 Apr 2018 06:03:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/CVl7ePS0GrRqi6ZJ96Yl5An/UumuoCF/DY0k4yURv0+y36Ujzoz826b9cGzTOlG/qxHaa X-Received: by 10.98.196.19 with SMTP id y19mr1167754pff.97.1524143007731; Thu, 19 Apr 2018 06:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524143007; cv=none; d=google.com; s=arc-20160816; b=OMax3nyR/AAVmBkY5KT2ocbIJTxU6EQlZElk85nOx6+c1O2zXP6Ewnl/NI9llNNrql ZfgXEKqYv03AItSjDKn9gCt4jJ75MSDsnKrfGbwBHoERSyEmvOMQMcuabM+3H1knh/Dl nA0xgzekHBbk5RW65WvOUBw5AjWkokHSKnV03YBEpC80QCX6fYcTZ9Y4J6z8E28dPZMg GjY285GEEX8E1R/9tGbbkQFK/qObYOHqOLSSnPz0eLnNnfHI+DitH1UgzEBnSjKOAs4p B1/XTtl5y1yo8gelHRVoXUh3glf0l2G5ZFoxD82fy00A2FeubWn8b/ImedIBrVeA6YSt t2vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=mXC3jECUaGK4XbYv7CJEmi15NLigErWM658AErp26tE=; b=EhxgpdbFvN2AakpnFMWIGdIYfGkZ8PRZE5uY5971CqX70brz/exYZcQUG9wha+j8ze YpVkNP44q0xnV28u7FA06PBVi55qtBSGmOWsSGqdL+x5LMACpoIqqXZQZsIachUP42RY KErfpuSVt4WO4WkgEiq50ON8bfOdGeB4YjdGUJ313iIQn3hGMYaY0ShkuIVP1pCZl8kS t06BMlTAoUcadgsJQKQxLqbwV3PCjHxMvItH6LfqvoqIyaSSwi4LV8OKoOS0+nS0dGZi QMiWVfyqq5Q0HocXcQ7nTptzEv+nz/DMZwVuyozPpv2pvi5oZVQkxNN0/OhHjEg0BxVi gKvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S9JQKJZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a66-v6si2073408pla.313.2018.04.19.06.03.13; Thu, 19 Apr 2018 06:03:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S9JQKJZf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbeDSNB1 (ORCPT + 99 others); Thu, 19 Apr 2018 09:01:27 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33741 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753032AbeDSNBY (ORCPT ); Thu, 19 Apr 2018 09:01:24 -0400 Received: by mail-lf0-f65.google.com with SMTP id d79-v6so53223lfd.0; Thu, 19 Apr 2018 06:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=mXC3jECUaGK4XbYv7CJEmi15NLigErWM658AErp26tE=; b=S9JQKJZfQO9UnD2vUG3003Nso5idLIwmVQboz4ZbSYhVfUYHErsNbw/HUb4So1JFU7 JOZ/Bjzrpvgz0FHMbBqu+B5VAxsF6MydP1Wt/p47qYGlWCZU64SfnDR8sX26qhRzyI88 BmX+pHwkGCORpfX5rmLXbU90xoBVXbtAFOuhMQgjLrGlD0KYWR4eZZELD7WSfKZ+nvqH qKzMoq2mupdC2Dg7Ins+9xwz/jiVwVafKZkhPP5Gg3E/6xBaayWlSrMeWue3JP7LQtOG AeyWBjmAEiBwrGfs2xEDknOIMEIzsjH2/bm6TV6/vVZKA1h3Xcvnv92NODvoflEAR5hu 7jsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=mXC3jECUaGK4XbYv7CJEmi15NLigErWM658AErp26tE=; b=ZUYTPD95dFkvA8537kW4Pi7TAunZ2jbXuxbbDshF372JOL9sjIpciX/ysQb+MrZUXf 0od2qrjoZJGLqPplUUpjR6e3KnMNtEXVlBtzSolO56GJkTlF7v3Pw+318Zya066LHQbr ZzTe4hb3cJTVMIyt1nPG9rMs0eFliWEJmKimg4afHSnbTyPK5jTfyOmh/8lbg98VnMx5 MJgxn8UrTISpuzo0DYWU3IZ4ieAKt5PNRjguP21fUmOqq6MRYrE/eC/IoE0+PF8Hr5XK ByE6HTdAzqDVgl4RwFALyl133es0xHD8BgYT4GBHELpHhgdc0k/RIpei8wPLNj0PwTK3 Yepw== X-Gm-Message-State: ALQs6tCTge3Iq9EP/i7rs+JBlE2cUnoMOgTinO1Vn2nt7KIi66jIWHLx N4AubVHC+KExl94mU1OzdOw= X-Received: by 10.46.157.84 with SMTP id y20mr4095384ljj.107.1524142882933; Thu, 19 Apr 2018 06:01:22 -0700 (PDT) Received: from [10.17.182.9] (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id e23-v6sm740866lfi.58.2018.04.19.06.01.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:01:22 -0700 (PDT) Subject: Re: [PATCH] Input: xen-kbdfront - allow better run-time configuration To: Juergen Gross , xen-devel@lists.xenproject.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, lyan@suse.com, boris.ostrovsky@oracle.com Cc: andrii_chepurnyi@epam.com, Oleksandr Andrushchenko References: <20180418150445.9805-1-andr2000@gmail.com> <2bff035e-303e-d644-5f51-5e64150c097c@gmail.com> From: Oleksandr Andrushchenko Message-ID: Date: Thu, 19 Apr 2018 16:01:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/19/2018 03:52 PM, Juergen Gross wrote: > On 19/04/18 13:44, Oleksandr Andrushchenko wrote: >> On 04/19/2018 02:25 PM, Juergen Gross wrote: >>> On 18/04/18 17:04, Oleksandr Andrushchenko wrote: >>>> From: Oleksandr Andrushchenko >>>> >>>> It is now only possible to control if multi-touch virtual device >>>> is created or not (via the corresponding XenStore entries), >>>> but keyboard and pointer devices are always created. >>> Why don't you want to go that route for keyboard and mouse, too? >>> Or does this really make no sense? >> Well, I would prefer not to touch anything outside Linux and >> this driver. And these settings seem to be implementation specific. >> So, this is why introduce Linux module parameters and don't extend >> the kbdif protocol. >>>> In some cases this is not desirable. For example, if virtual >>>> keyboard device is exposed to Android then the latter won't >>>> automatically show on-screen keyboard as it expects that a >>>> physical keyboard device can be used for typing. >>>> >>>> Make it possible to configure which virtual devices are created >>>> with module parameters: >>>>    - no_ptr_dev=1 if no pointer device needs to be created >>>>    - no_kbd_dev=1 if no keyboard device needs to be created >>>> Keep old behavior by default. >>>> >>>> Signed-off-by: Oleksandr Andrushchenko >>>> >>>> Suggested-by: Andrii Chepurnyi >>>> Tested-by: Andrii Chepurnyi >>>> --- >>>>   drivers/input/misc/xen-kbdfront.c | 159 +++++++++++++++++------------- >>>>   1 file changed, 92 insertions(+), 67 deletions(-) >>>> >>>> diff --git a/drivers/input/misc/xen-kbdfront.c >>>> b/drivers/input/misc/xen-kbdfront.c >>>> index d91f3b1c5375..a3306aad40b0 100644 >>>> --- a/drivers/input/misc/xen-kbdfront.c >>>> +++ b/drivers/input/misc/xen-kbdfront.c >>>> @@ -51,6 +51,16 @@ module_param_array(ptr_size, int, NULL, 0444); >>>>   MODULE_PARM_DESC(ptr_size, >>>>       "Pointing device width, height in pixels (default 800,600)"); >>>>   +static unsigned int no_ptr_dev; >>>> +module_param(no_ptr_dev, uint, 0); >>> Use type invbool instead? >> Hm, better bool then? invbool will require parameter name change to >> something like "with_ptr_dev" which might confuse, e.g. >> default was to go with pointer device, now we have with_ptr_dev >> module parameter: do I now need to set it to preserve the old behavior? >> The answer is no (because of invbool), but you have to dig for it. >> >> Will bool work for you? > As long as the default won't change from today: yes. Ok, so I'll send v2 with the following changes: diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index a3306aad40b0..d8cca212f737 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c @@ -51,13 +51,13 @@ module_param_array(ptr_size, int, NULL, 0444);  MODULE_PARM_DESC(ptr_size,         "Pointing device width, height in pixels (default 800,600)"); -static unsigned int no_ptr_dev; -module_param(no_ptr_dev, uint, 0); +static bool no_ptr_dev; +module_param(no_ptr_dev, bool, 0);  MODULE_PARM_DESC(no_ptr_dev,         "If set then no virtual pointing device exposed to the guest"); -static unsigned int no_kbd_dev; -module_param(no_kbd_dev, uint, 0); +static bool no_kbd_dev; +module_param(no_kbd_dev, bool, 0);  MODULE_PARM_DESC(no_kbd_dev,         "If set then no virtual keyboard device exposed to the guest"); > > Juergen