From patchwork Sat Apr 16 01:45:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Asias He X-Patchwork-Id: 711891 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3G1keLv015641 for ; Sat, 16 Apr 2011 01:46:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755515Ab1DPBqg (ORCPT ); Fri, 15 Apr 2011 21:46:36 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type; bh=qtoFOTZoFbbX9fziRzdLT6JwvMwASWhr0yLJESwIAAE=; b=RkgaQQEOEB0LwzM5uKB7TKQ4Cp0GLJWjkGT//JRFbgXyftj4Wmp1kzBtAw6zHs4GSp XJMZpMHUU1zVRVpP+cVb0K1Z7jdw+WwchlQlSZ7VpgXfCCEm3cOAUysq9LZ7CtaFJDi+ M6dUTVf6SOzTp8guQSXav0sVGL7Y1Co9u9sXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=u8owYV2yy67ij4knHvn00kwVuWj/3PuJ5406j9m2cTXPVepo/kubaEtBv3KwqCZugE 1Ulhpn/ub73TS7AC1Zeqp9nAogc7V99KB/69HMCGUJTmmWKeVLNRbFnm0vKBHS8fiC3F CyodNqfWAMJ741/u0C2gCCm3uQRiygwLgDgA8= Received: by 10.143.36.21 with SMTP id o21mr1156981wfj.23.1302918395852; Fri, 15 Apr 2011 18:46:35 -0700 (PDT) Received: from [192.168.21.242] ([202.112.128.131]) by mx.google.com with ESMTPS id w11sm4388879wfh.18.2011.04.15.18.46.32 (version=SSLv3 cipher=OTHER); Fri, 15 Apr 2011 18:46:34 -0700 (PDT) Message-ID: <4DA8F4BD.2050903@gmail.com> Date: Sat, 16 Apr 2011 09:45:33 +0800 From: Asias He User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Ingo Molnar , Pekka Enberg CC: Cyrill Gorcunov , kvm@vger.kernel.org Subject: Re: [PATCH] kvm tools: Fix virtio console input problem References: <1302879507-6490-1-git-send-email-asias.hejun@gmail.com> <20110415182313.GA13961@elte.hu> In-Reply-To: <20110415182313.GA13961@elte.hu> X-Enigmail-Version: 1.1.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 16 Apr 2011 01:46:41 +0000 (UTC) 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. 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