Commit a88191a0ca for qemu.org
commit a88191a0caecdfba440682e3c120b439681ccaca
Author: Christian Quante <christian@quante.one>
Date: Tue Aug 25 09:51:27 2026 +0200
hw/input/ps2: say why unknown keyboard commands draw a resend
The keyboard path has answered unknown commands with KBD_REPLY_RESEND
since commit 06b3611fc2a3 ("ps2: reject unknown commands, instead of
blindly accepting them"), but never said why. Give it the comment the
mouse path just gained, so the reasoning is written down in both
places.
Suggested-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Christian Quante <christian@quante.one>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Message-ID: <20260825075127.34876-3-christian@quante.one>
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index e8300d2d83..01af4350b3 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -647,6 +647,10 @@ void ps2_write_keyboard(PS2KbdState *s, int val)
ps2_cqueue_1(ps2, KBD_REPLY_ACK);
break;
default:
+ /*
+ * A PS/2 device answers every command it is given; an unknown
+ * one draws a resend.
+ */
ps2_cqueue_1(ps2, KBD_REPLY_RESEND);
break;
}