* Sasha Levin <levinsasha928@xxxxxxxxx> wrote: > From: John Floren <john@xxxxxxxxxxx> > > Add support for PS/2 keyboard system with AUX device (aka mouse). > The device works with vnc, the guest must be started with the > '--vnc' parameter for the device to be initialized. > > Signed-off-by: John Floren <john@xxxxxxxxxxx> > [ turn into patch and clean up code ] > Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx> > --- > tools/kvm/Makefile | 1 + > tools/kvm/hw/pckbd.c | 475 +++++++++++++++++++++++++++++++++++++++++ Since this is a PS2 keyboard and mouse driver please name it i8042.[ch] like the kernel-side does. that will also make it easier to find the guest-side <-> host-side pair of guest-driver/host-driver files :-) > tools/kvm/hw/vesa.c | 3 + > tools/kvm/include/kvm/pckbd.h | 19 ++ > tools/kvm/ioport.c | 4 - > tools/kvm/kvm-run.c | 5 +- > 6 files changed, 502 insertions(+), 5 deletions(-) > create mode 100644 tools/kvm/hw/pckbd.c > create mode 100644 tools/kvm/include/kvm/pckbd.h In general the code looks very clean to me! Found two minor nits: > + ret = state.kq[state.kread++ % QUEUE_SIZE]; > + ret = state.mq[state.mread++ % QUEUE_SIZE]; Please increment the index explicitly, on a separate line - the permanent side-effect to the keyboard state is not obvious at first sight. Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html