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>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Asias He
2011-04-15 22:55:04 +08:00
committed by Will Deacon
parent 6c6f79b69d
commit fbf15b307a
+1 -2
View File
@@ -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)