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>
Christian Quante committed
Aug 25, 2026 at 09:51 UTC
a88191a0caecdfba440682e3c120b439681ccaca
1 file changed
+4
hw/input/ps2.c
+4
@@ -647,6 +647,10 @@ void ps2_write_keyboard(PS2KbdState *s, int val)
647
ps2_cqueue_1(ps2, KBD_REPLY_ACK);
648
break;
649
default:
650
+ /*
651
+ * A PS/2 device answers every command it is given; an unknown
652
+ * one draws a resend.
653
+ */
654
ps2_cqueue_1(ps2, KBD_REPLY_RESEND);
655
break;
656
}