From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7HE3-0003He-BS for qemu-devel@nongnu.org; Thu, 30 Aug 2012 22:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7HE2-0004yn-CU for qemu-devel@nongnu.org; Thu, 30 Aug 2012 22:44:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7HE2-0004yf-3v for qemu-devel@nongnu.org; Thu, 30 Aug 2012 22:44:50 -0400 Message-ID: <5040251C.10901@redhat.com> Date: Fri, 31 Aug 2012 10:44:44 +0800 From: Amos Kong MIME-Version: 1.0 References: <1345437569-13862-1-git-send-email-akong@redhat.com> <1345437569-13862-6-git-send-email-akong@redhat.com> <20120830144638.3d68eb0d@doriath.home> In-Reply-To: <20120830144638.3d68eb0d@doriath.home> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 5/6] add the QKeyCode enum and the key_defs table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org On 31/08/12 01:46, Luiz Capitulino wrote: > On Mon, 20 Aug 2012 12:39:28 +0800 > Amos Kong wrote: > >> key_defs[] in monitor.c is a mapping table of keys and keycodes, >> this patch added a QKeyCode enum and a new key_defs table, >> key's index in the enmu is same as keycode's index in new key_defs[]. >> >> And added two help functions to convert key/code to index of mapping >> table, those functions will return Q_KEY_CODE_MAX if the code/key is >> invalid. >> >> 'key_defs' was dropped from the monitor, monitor functions were >> changed to access key_defs directly. >> >> Signed-off-by: Amos Kong > > This patch (and probably the next one too) doesn't apply on master, could > you rebase please? Will send V8 later. > As you'll have to respin, please change versions to 1.3.0. I also have > comments below (minor, but as you'll respin anyway). Ok. >> --- >> console.h | 6 ++ >> input.c | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> monitor.c | 183 +++------------------------------------------------- >> qapi-schema.json | 26 ++++++++ >> 4 files changed, 229 insertions(+), 172 deletions(-) >> >> diff --git a/console.h b/console.h >> index 4334db5..7934b11 100644 >> --- a/console.h >> +++ b/console.h >> @@ -6,6 +6,7 @@ >> #include "notify.h" >> #include "monitor.h" >> #include "trace.h" >> +#include "qapi-types.h" >> >> /* keyboard/mouse support */ >> >> @@ -397,4 +398,9 @@ static inline int vnc_display_pw_expire(DisplayState *ds, time_t expires) >> /* curses.c */ >> void curses_display_init(DisplayState *ds, int full_screen); >> >> +/* input.c */ >> +extern const int key_defs[]; > > Why are you exporting key_defs[]? It should be static. key_defs[] is used in do_send_key() after applying this patch, so export key_defs[]. It will be changed to static in next patch. > Also, it would be better to move the addition of QKeyCode out of this patch > (ie. you first add it and then move the table). Will do it. -- Amos.