HomeFreeBSD

vt: fix post-boot keyboard attachment

Description

vt: fix post-boot keyboard attachment

With absolutely no keyboards attached and no kbdmux in kernel, we descend
down this error path. 0 is a valid keyboard index, so leaving
vd->vd_keyboard at 0 when there's no keyboard found is objectively wrong as
later attachment of a keyboard will fail -- it gets index 0, and vt thinks
it's already using that keyboard.

This is decidedly the corniest of corner cases, but it's easy enough to get
correct that we should do so.

Tested in a kernel without atkbdc, atkbd, psm, kbdmux, ukbd, hyperv then
loading ukbd post-boot and attaching a usb keyboard.

Details

Provenance
kevansAuthored on Dec 20 2019, 4:20 PM
Parents
rG2dfc696ef113: VERSATILEPB: Unbreak after r355796
Branches
Unknown
Tags
Unknown

Event Timeline