qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ps2: take exact use of ps2 buffer
@ 2016-06-02  6:05 Yang Hongyang
  2016-06-02  8:37 ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Hongyang @ 2016-06-02  6:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Gonglei, Juan Quintela

According to PS/2 Mouse/Keyboard Protocol, the keyboard output buffer
size is 16 bytes, but we only use 15 bytes actually, this causes some
problem, for example, if I submit "123456789" in a bunch through VNC,
the actual result will be "12345678888888888...", because the 16th key
event which is "8" key up is dropped.

Signed-off-by: Yang Hongyang <hongyang.yang@easystack.cn>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Gonglei <arei.gonglei@huawei.com>
Cc: Juan Quintela <quintela@redhat.com>
---
 hw/input/ps2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index a8aa36f..0726270 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -143,7 +143,7 @@ void ps2_queue(void *opaque, int b)
     PS2State *s = (PS2State *)opaque;
     PS2Queue *q = &s->queue;
 
-    if (q->count >= PS2_QUEUE_SIZE - 1)
+    if (q->count >= PS2_QUEUE_SIZE)
         return;
     q->data[q->wptr] = b;
     if (++q->wptr == PS2_QUEUE_SIZE)
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-02 10:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-02  6:05 [Qemu-devel] [PATCH] ps2: take exact use of ps2 buffer Yang Hongyang
2016-06-02  8:37 ` Gerd Hoffmann
2016-06-02  9:19   ` Yang Hongyang
2016-06-02 10:05     ` Gerd Hoffmann
2016-06-02 10:34       ` Yang Hongyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).