qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] ps2: take exact use of ps2 buffer


From: Yang Hongyang
Subject: [Qemu-devel] [PATCH] ps2: take exact use of ps2 buffer
Date: Thu, 2 Jun 2016 14:05:05 +0800

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 <address@hidden>
Cc: Gerd Hoffmann <address@hidden>
Cc: Gonglei <address@hidden>
Cc: Juan Quintela <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]