Skip to contentSkip to conversation

kvm tools: Fix virtio console input problem

PATCH In review Asias He 2 participants 4 messages Apr 15, 2011 – Apr 16, 2011 KVM

lore
Share & tools
lore

Asias He

author
#0 lore raw

PATCH 1/1 kvm tools: Fix virtio console input problem

---
 tools/kvm/term.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/kvm/term.c +2 -2
index 2245c8d..2bd038d 100644
@@ -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)
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 4 lines · 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?

Thanks,

Ingo

author
#2 lore raw
Quoted 9 lines · Ingo Molnar
Quoted 4 lines · 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.

Signature · 2 lines
Best Regards,
Asias He
Quoted 1 line

From 6a123c8001c3c36ae5cc08d2980588491a6ef1ef Mon Sep 17 00:00:00 2001

From: Asias He <[email protected]>
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^@^@^@

---
 tools/kvm/term.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
tools/kvm/term.c +1 -2
index 2245c8d..689d52d 100644
@@ -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)
Signature · 1 line
1.7.4.4
#3 lore raw
Quoted 4 lines · Asias He
Quoted 3 lines · Ingo Molnar

* Asias He <[email protected]> wrote:

Quoted 29 lines
Quoted 6 lines
Quoted 4 lines
---
 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.

Signature · 2 lines
Best Regards,
Asias He
Quoted 1 line

From 6a123c8001c3c36ae5cc08d2980588491a6ef1ef Mon Sep 17 00:00:00 2001

From: Asias He <[email protected]>
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^@^@^@

---
 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