From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: Re: [PATCH] kvm tools: Fix virtio console input problem Date: Sat, 16 Apr 2011 09:45:33 +0800 Message-ID: <4DA8F4BD.2050903@gmail.com> References: <1302879507-6490-1-git-send-email-asias.hejun@gmail.com> <20110415182313.GA13961@elte.hu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050504030001020503070403" Cc: Cyrill Gorcunov , kvm@vger.kernel.org To: Ingo Molnar , Pekka Enberg Return-path: Received: from mail-pv0-f174.google.com ([74.125.83.174]:44381 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964Ab1DPBqg (ORCPT ); Fri, 15 Apr 2011 21:46:36 -0400 Received: by pvg12 with SMTP id 12so1331088pvg.19 for ; Fri, 15 Apr 2011 18:46:35 -0700 (PDT) In-Reply-To: <20110415182313.GA13961@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------050504030001020503070403 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/16/2011 02:23 AM, Ingo Molnar wrote: > > * Asias He wrote: > >> Signed-off-by: Asias He >> --- >> tools/kvm/term.c | 4 ++-- >> 1 files changed, 2 insertions(+), 2 deletions(-) > > Mind explaining in the changelog what input problem this is about? Sure. See attached patch. -- Best Regards, Asias He --------------050504030001020503070403 Content-Type: text/x-patch; name="0001-kvm-tools-Fix-virtio-console-input-problem.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-kvm-tools-Fix-virtio-console-input-problem.patch" >>From 6a123c8001c3c36ae5cc08d2980588491a6ef1ef Mon Sep 17 00:00:00 2001 From: Asias He Date: Fri, 15 Apr 2011 22:55:04 +0800 Subject: [PATCH] kvm tools: Fix virtio console input problem term_getc only get one char at a time, so term_getc_iov should send one char back to guest. Otherwise, you will get four input chars when you only type one like bewlow: sid login: r^@^@^@o^@^@^@o^@^@^@t^@^@^@ Signed-off-by: Asias He --- tools/kvm/term.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/tools/kvm/term.c b/tools/kvm/term.c index 2245c8d..689d52d 100644 --- a/tools/kvm/term.c +++ b/tools/kvm/term.c @@ -71,9 +71,8 @@ int term_getc_iov(int who, struct iovec *iov, int iovcnt) return 0; *((int *)iov[0].iov_base) = c; - iov[0].iov_len = sizeof(int); - return sizeof(int); + return sizeof(char); } int term_putc_iov(int who, struct iovec *iov, int iovcnt) -- 1.7.4.4 --------------050504030001020503070403--