From nobody Thu Apr 25 11:06:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1520861407047565.1722365965088; Mon, 12 Mar 2018 06:30:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 117EA49016; Mon, 12 Mar 2018 13:30:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C999560172; Mon, 12 Mar 2018 13:29:57 +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 ACFBF4CA9A; Mon, 12 Mar 2018 13:29:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2CDTsgb014694 for ; Mon, 12 Mar 2018 09:29:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id EA0FF2026E04; Mon, 12 Mar 2018 13:29:53 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.40.205.128]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5188C2026E03 for ; Mon, 12 Mar 2018 13:29:53 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Mon, 12 Mar 2018 14:29:49 +0100 Message-Id: <20180312132949.24394-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] keycodemapdb: Update submodule 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 12 Mar 2018 13:30:05 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This time around it's not enough to just pick the latest commit, because with aed87bb2aa6ed83b49574eb982e3bdd4c36acf17 keycodemapdb renamed the 'rfb' keycode to 'qnum' and we need to accept the new name while maintaining backwards compatibility. Signed-off-by: Andrea Bolognani Reviewed-by: Daniel P. Berrang=C3=A9 --- include/libvirt/libvirt-domain.h | 9 ++++++++- src/keycodemapdb | 2 +- src/qemu/qemu_driver.c | 8 ++++---- src/util/Makefile.inc.am | 2 +- src/util/virkeycode.c | 8 ++++---- tests/virkeycodetest.c | 4 ++-- tools/virsh-domain.c | 5 +++++ tools/virsh.pod | 6 +++--- 8 files changed, 28 insertions(+), 16 deletions(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-dom= ain.h index 4048acf38a..4128d55852 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -2733,7 +2733,7 @@ typedef enum { VIR_KEYCODE_SET_XT_KBD =3D 6, VIR_KEYCODE_SET_USB =3D 7, VIR_KEYCODE_SET_WIN32 =3D 8, - VIR_KEYCODE_SET_RFB =3D 9, + VIR_KEYCODE_SET_QNUM =3D 9, =20 # ifdef VIR_ENUM_SENTINELS VIR_KEYCODE_SET_LAST @@ -2745,6 +2745,13 @@ typedef enum { # endif } virKeycodeSet; =20 +/** + * VIR_KEYCODE_SET_RFB: + * + * Compatibility alias for VIR_KEYCODE_SET_QNUM, which replaced it since 4= .2.0. + */ +# define VIR_KEYCODE_SET_RFB VIR_KEYCODE_SET_QNUM + /** * VIR_DOMAIN_SEND_KEY_MAX_KEYS: * diff --git a/src/keycodemapdb b/src/keycodemapdb index 267157b96c..16e5b07876 160000 --- a/src/keycodemapdb +++ b/src/keycodemapdb @@ -1 +1 @@ -Subproject commit 267157b96c62b5445de9cddd21de42fcd943ffe6 +Subproject commit 16e5b0787687d8904dad2c026107409eb9bfcb95 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e13544f832..8c872c1f08 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2580,17 +2580,17 @@ static int qemuDomainSendKey(virDomainPtr domain, =20 virCheckFlags(0, -1); =20 - /* translate the keycode to RFB for qemu driver */ - if (codeset !=3D VIR_KEYCODE_SET_RFB) { + /* translate the keycode to QNUM for qemu driver */ + if (codeset !=3D VIR_KEYCODE_SET_QNUM) { size_t i; int keycode; =20 for (i =3D 0; i < nkeycodes; i++) { - keycode =3D virKeycodeValueTranslate(codeset, VIR_KEYCODE_SET_= RFB, + keycode =3D virKeycodeValueTranslate(codeset, VIR_KEYCODE_SET_= QNUM, keycodes[i]); if (keycode < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot translate keycode %u of %s codese= t to rfb keycode"), + _("cannot translate keycode %u of %s codese= t to qnum keycode"), keycodes[i], virKeycodeSetTypeToString(codeset)); return -1; diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am index a91b30dca5..d0e1ec3625 100644 --- a/src/util/Makefile.inc.am +++ b/src/util/Makefile.inc.am @@ -214,7 +214,7 @@ EXTRA_DIST +=3D \ $(NULL) =20 =20 -KEYCODES =3D linux osx atset1 atset2 atset3 xtkbd usb win32 rfb +KEYCODES =3D linux osx atset1 atset2 atset3 xtkbd usb win32 qnum KEYNAMES =3D linux osx win32 =20 KEYTABLES =3D \ diff --git a/src/util/virkeycode.c b/src/util/virkeycode.c index eda263218c..8976bbf376 100644 --- a/src/util/virkeycode.c +++ b/src/util/virkeycode.c @@ -27,7 +27,7 @@ #include "virkeycodetable_atset3.h" #include "virkeycodetable_linux.h" #include "virkeycodetable_osx.h" -#include "virkeycodetable_rfb.h" +#include "virkeycodetable_qnum.h" #include "virkeycodetable_usb.h" #include "virkeycodetable_win32.h" #include "virkeycodetable_xtkbd.h" @@ -52,7 +52,7 @@ static const unsigned short *virKeymapValues[VIR_KEYCODE_= SET_LAST] =3D { [VIR_KEYCODE_SET_XT_KBD] =3D virKeyCodeTable_xtkbd, [VIR_KEYCODE_SET_USB] =3D virKeyCodeTable_usb, [VIR_KEYCODE_SET_WIN32] =3D virKeyCodeTable_win32, - [VIR_KEYCODE_SET_RFB] =3D virKeyCodeTable_rfb, + [VIR_KEYCODE_SET_QNUM] =3D virKeyCodeTable_qnum, }; =20 #define VIR_KEYMAP_ENTRY_MAX ARRAY_CARDINALITY(virKeyCodeTable_linux) @@ -64,7 +64,7 @@ verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virK= eyCodeTable_osx)); verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyCodeTable_xtkbd= )); verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyCodeTable_usb)); verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyCodeTable_win32= )); -verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyCodeTable_rfb)); +verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyCodeTable_qnum)= ); verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyNameTable_linux= )); verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyNameTable_osx)); verify(VIR_KEYMAP_ENTRY_MAX =3D=3D ARRAY_CARDINALITY(virKeyNameTable_win32= )); @@ -79,7 +79,7 @@ VIR_ENUM_IMPL(virKeycodeSet, VIR_KEYCODE_SET_LAST, "xt_kbd", "usb", "win32", - "rfb", + "qnum", ); =20 int virKeycodeValueFromString(virKeycodeSet codeset, diff --git a/tests/virkeycodetest.c b/tests/virkeycodetest.c index 24887a36d4..399a13fcae 100644 --- a/tests/virkeycodetest.c +++ b/tests/virkeycodetest.c @@ -54,8 +54,8 @@ static int testKeycodeMapping(const void *data ATTRIBUTE_= UNUSED) =20 TRANSLATE(LINUX, LINUX, 111, 111); TRANSLATE(LINUX, USB, 111, 76); - TRANSLATE(LINUX, RFB, 88, 88); - TRANSLATE(LINUX, RFB, 160, 163); + TRANSLATE(LINUX, QNUM, 88, 88); + TRANSLATE(LINUX, QNUM, 160, 163); TRANSLATE(ATSET2, ATSET3, 131, 55); TRANSLATE(OSX, WIN32, 90, 131); TRANSLATE(OSX, ATSET1, 90, 90); diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index c78cf7f219..2b775fc4cc 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8688,6 +8688,11 @@ cmdSendKey(vshControl *ctl, const vshCmd *cmd) if (vshCommandOptUInt(ctl, cmd, "holdtime", &holdtime) < 0) goto cleanup; =20 + /* The qnum codeset was originally called rfb, so we need to keep + * accepting the old name for backwards compatibility reasons */ + if (STREQ(codeset_option, "rfb")) + codeset_option =3D "qnum"; + codeset =3D virKeycodeSetTypeFromString(codeset_option); if (codeset < 0) { vshError(ctl, _("unknown codeset: '%s'"), codeset_option); diff --git a/tools/virsh.pod b/tools/virsh.pod index 8f0e8d74b0..378e26a20d 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -2249,14 +2249,14 @@ for keyboard input. No symbolic names are provided =20 See L =20 -=3Ditem B +=3Ditem B =20 -The numeric values are those defined by the RFB extension for sending +The numeric values are those defined by the QNUM extension for sending raw keycodes. These are a variant on the XT codeset, but extended keycodes have the low bit of the second byte set, instead of the high bit of the first byte. No symbolic names are provided. =20 -See L +See L =20 =3Dback =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list