From patchwork Mon Oct 23 09:19:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 10022199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C2AC601E8 for ; Mon, 23 Oct 2017 09:21:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FAC628503 for ; Mon, 23 Oct 2017 09:21:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24B9128818; Mon, 23 Oct 2017 09:21:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A740E28503 for ; Mon, 23 Oct 2017 09:21:24 +0000 (UTC) Received: from localhost ([::1]:37623 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6YvD-0005yw-Bu for patchwork-qemu-devel@patchwork.kernel.org; Mon, 23 Oct 2017 05:21:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Ytp-0005y5-4G for qemu-devel@nongnu.org; Mon, 23 Oct 2017 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Ytl-0005Yf-Dn for qemu-devel@nongnu.org; Mon, 23 Oct 2017 05:19:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58058) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e6Ytl-0005YI-7b for qemu-devel@nongnu.org; Mon, 23 Oct 2017 05:19:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A5DE2D0FAE for ; Mon, 23 Oct 2017 09:19:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5A5DE2D0FAE Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com Received: from sirius.home.kraxel.org (ovpn-117-195.ams2.redhat.com [10.36.117.195]) by smtp.corp.redhat.com (Postfix) with ESMTP id C28E97767D; Mon, 23 Oct 2017 09:19:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C0DAE4FD7C; Mon, 23 Oct 2017 11:19:47 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 23 Oct 2017 11:19:40 +0200 Message-Id: <20171023091947.20771-3-kraxel@redhat.com> In-Reply-To: <20171023091947.20771-1-kraxel@redhat.com> References: <20171023091947.20771-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 23 Oct 2017 09:19:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/9] ui: fix crash with sendkey and raw key numbers 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: Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Daniel P. Berrange" Previously we enforced that all key events are using QKeyCodes at time they are sent: commit af07e5ff02ae6d4258fc5331007811d0b1c4d35a Author: Daniel P. Berrange Date: Fri Sep 29 11:12:00 2017 +0100 ui: convert key events to QKeyCodes immediately This commit forget to fix the code for the legacy 'sendkey' command which still accepts key numbers from the user, which then need converting to QKeyCodes Signed-off-by: Daniel P. Berrange Reviewed-by: Eric Blake Message-id: 20171019142848.572-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/input-legacy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/input-legacy.c b/ui/input-legacy.c index 6bc3525499..c75aba1549 100644 --- a/ui/input-legacy.c +++ b/ui/input-legacy.c @@ -76,6 +76,11 @@ static KeyValue *copy_key_value(KeyValue *src) { KeyValue *dst = g_new(KeyValue, 1); memcpy(dst, src, sizeof(*src)); + if (dst->type == KEY_VALUE_KIND_NUMBER) { + QKeyCode code = qemu_input_key_number_to_qcode(dst->u.number.data); + dst->type = KEY_VALUE_KIND_QCODE; + dst->u.qcode.data = code; + } return dst; }