Re: [PATCH] kvm tools: Fix virtio console input problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/16/2011 02:23 AM, Ingo Molnar wrote:
> 
> * Asias He <asias.hejun@xxxxxxxxx> wrote:
> 
>> Signed-off-by: Asias He <asias.hejun@xxxxxxxxx>
>> ---
>>  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
>From 6a123c8001c3c36ae5cc08d2980588491a6ef1ef Mon Sep 17 00:00:00 2001
From: Asias He <asias.hejun@xxxxxxxxx>
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 <asias.hejun@xxxxxxxxx>
---
 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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux