* [PATCH] kvm tools: Fix virtio console input problem
@ 2011-04-15 14:58 Asias He
2011-04-15 18:23 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Asias He @ 2011-04-15 14:58 UTC (permalink / raw)
To: Pekka Enberg, Cyrill Gorcunov, Ingo Molnar; +Cc: kvm, Asias He
Signed-off-by: Asias He <asias.hejun@gmail.com>
---
tools/kvm/term.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/kvm/term.c b/tools/kvm/term.c
index 2245c8d..2bd038d 100644
--- a/tools/kvm/term.c
+++ b/tools/kvm/term.c
@@ -71,9 +71,9 @@ 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);
+ iov[0].iov_len = sizeof(char);
- return sizeof(int);
+ return sizeof(char);
}
int term_putc_iov(int who, struct iovec *iov, int iovcnt)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm tools: Fix virtio console input problem
2011-04-15 14:58 [PATCH] kvm tools: Fix virtio console input problem Asias He
@ 2011-04-15 18:23 ` Ingo Molnar
2011-04-16 1:45 ` Asias He
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2011-04-15 18:23 UTC (permalink / raw)
To: Asias He; +Cc: Pekka Enberg, Cyrill Gorcunov, kvm
* Asias He <asias.hejun@gmail.com> wrote:
> Signed-off-by: Asias He <asias.hejun@gmail.com>
> ---
> tools/kvm/term.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
Mind explaining in the changelog what input problem this is about?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm tools: Fix virtio console input problem
2011-04-15 18:23 ` Ingo Molnar
@ 2011-04-16 1:45 ` Asias He
2011-04-16 7:42 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Asias He @ 2011-04-16 1:45 UTC (permalink / raw)
To: Ingo Molnar, Pekka Enberg; +Cc: Cyrill Gorcunov, kvm
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]
On 04/16/2011 02:23 AM, Ingo Molnar wrote:
>
> * Asias He <asias.hejun@gmail.com> wrote:
>
>> Signed-off-by: Asias He <asias.hejun@gmail.com>
>> ---
>> 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
[-- Attachment #2: 0001-kvm-tools-Fix-virtio-console-input-problem.patch --]
[-- Type: text/x-patch, Size: 962 bytes --]
>From 6a123c8001c3c36ae5cc08d2980588491a6ef1ef Mon Sep 17 00:00:00 2001
From: Asias He <asias.hejun@gmail.com>
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@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm tools: Fix virtio console input problem
2011-04-16 1:45 ` Asias He
@ 2011-04-16 7:42 ` Ingo Molnar
0 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2011-04-16 7:42 UTC (permalink / raw)
To: Asias He; +Cc: Pekka Enberg, Cyrill Gorcunov, kvm
* Asias He <asias.hejun@gmail.com> wrote:
> On 04/16/2011 02:23 AM, Ingo Molnar wrote:
> >
> > * Asias He <asias.hejun@gmail.com> wrote:
> >
> >> Signed-off-by: Asias He <asias.hejun@gmail.com>
> >> ---
> >> 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@gmail.com>
> 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@gmail.com>
> ---
> tools/kvm/term.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
Ok, that changelog is much more informative, thanks!
Small typo: s/bewlow/below.
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-16 7:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-15 14:58 [PATCH] kvm tools: Fix virtio console input problem Asias He
2011-04-15 18:23 ` Ingo Molnar
2011-04-16 1:45 ` Asias He
2011-04-16 7:42 ` Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.