From nobody Sun May 5 11:28:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1579295930; cv=none; d=zohomail.com; s=zohoarc; b=npBw0LyRDZuc4j9hzbZer9WiINiECls6zEoYBInsH2cRl1uMpBkw34x5AumUOHpKbOGku0MGmZXx6HIZnIo49TOWyvJVNjpiF4YVFl00JtVdQgbBoO3DztfMgSkdbu0Idb4TF3pXq2jPcKy4/1rA0i0FChMrL6UPKTQ5ZCNEtHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579295930; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=F8AU1bNDC+zXhRhL1CkSmobD9CslHzBEnt/QFRIlnME=; b=kWP2wa4UqsUNXqLqV9uZTYCvB5iu/VzJmiGjJuGD4dNB2amIDtAa4qlmNH/OXriX492zlg7cKNVoVxed1zbMs6YsbScIHN4MyaIlb6YRVs9vsY49RWAvMBxhbyiE8TOGjSWQK7519xYXHT7e3rfqDSIQ+8Rfs711IUNvqd1m2K4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1579295930291768.9346204228552; Fri, 17 Jan 2020 13:18:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-gW83BSRZN_ynkpzpCguHEQ-1; Fri, 17 Jan 2020 16:18:44 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFA1B800D48; Fri, 17 Jan 2020 21:18:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D2B85C1B5; Fri, 17 Jan 2020 21:18:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EADC718089CD; Fri, 17 Jan 2020 21:18:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 00HLIVO9000939 for ; Fri, 17 Jan 2020 16:18:31 -0500 Received: by smtp.corp.redhat.com (Postfix) id 06BFA2166B2A; Fri, 17 Jan 2020 21:18:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01EB02166B29 for ; Fri, 17 Jan 2020 21:18:28 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E40E80018B for ; Fri, 17 Jan 2020 21:18:28 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-b1s_H9RKP0q-OmOdrD6E1w-1; Fri, 17 Jan 2020 16:18:26 -0500 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 2D50852A; Fri, 17 Jan 2020 16:18:25 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 17 Jan 2020 16:18:25 -0500 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id E32AA3060A88; Fri, 17 Jan 2020 16:18:23 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579295926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=F8AU1bNDC+zXhRhL1CkSmobD9CslHzBEnt/QFRIlnME=; b=IaVxjdvbNNzOJTD2WHDr2G0Np8Fmo7JK5hHd3oZVUbyu1QnylNbnxvl1m/dtpL5B2FvqnS iZIFqmhLHxapwAJIHddDlbwEPe3iFkFAN4aEeztFIOhbudE2ej+DAawARlyIsa+VLF8SP+ tqR5GlBjKsX3rJhSXfppVuwJSOZwXUk= X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtdekgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffogggtohfgsehtkeertd ertdejnecuhfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgvtghk ihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqe enucfkphepledurdeihedrfeegrdeffeenucfrrghrrghmpehmrghilhhfrhhomhepmhgr rhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: libvir-list@redhat.com Subject: [RFC PATCH] libxl: support configuring paravirtualized keyboard Date: Fri, 17 Jan 2020 22:18:06 +0100 Message-Id: <20200117211806.1179-1-marmarek@invisiblethingslab.com> MIME-Version: 1.0 Organization: Invisible Things Lab X-MC-Unique: b1s_H9RKP0q-OmOdrD6E1w-1 X-MC-Unique: gW83BSRZN_ynkpzpCguHEQ-1 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 00HLIVO9000939 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Xen since 4.13 allows to configure whether PV vkb device is created or not - instead of always creating it. Plug it into device configuration and give the user a choice - setting PS2 keyboard disables PV one, and setting XEN keyboard enables PV. There is one issue with this approach: there are implicit keyboard and mouse device added with bus 'ps2'. This is at least done by the xen-xl -> libvirt xml config converter (why?). When one use a config generated this way, this commit will make behavior change - PV keyboard will get disabled. I'm not sure if that's a big issue - both keyboards works. Can it be this way? Or maybe some better idea how to represent vkb_device option in libvirt xml? Once the above is sorted out (or chosen to ignore), I'll send updated patch with tests and config converter support. Because the implicit keyboard is added, I also avoided to reject keybord device on too old Xen versions. This means will be _silently_ ignored on older Xen. Signed-off-by: Marek Marczykowski-G=C3=B3recki --- src/libxl/libxl_conf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 27de67d266..0999fb5678 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -637,6 +637,24 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, for (i =3D 0; i < def->ninputs; i++) { char **usbdevice; =20 +#ifdef LIBXL_HAVE_BUILDINFO_VKB_DEVICE + if (def->inputs[i]->type =3D=3D VIR_DOMAIN_INPUT_TYPE_KBD) { + switch (def->inputs[i]->bus) { + case VIR_DOMAIN_INPUT_BUS_PS2: + libxl_defbool_set(&b_info->u.hvm.vkb_device, false= ); + break; + case VIR_DOMAIN_INPUT_BUS_XEN: + libxl_defbool_set(&b_info->u.hvm.vkb_device, true); + break; + case VIR_DOMAIN_INPUT_BUS_VIRTIO: + default: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("libxenlight supports only ps2/xen keybo= ard device")); + return -1; + } + } +#endif + if (def->inputs[i]->bus !=3D VIR_DOMAIN_INPUT_BUS_USB) continue; =20 --=20 2.21.0