On Fri, Apr 1, 2016 at 12:20 PM, Gerd Hoffmann <kra...@redhat.com> wrote: > On Fr, 2016-04-01 at 11:31 +0200, Ladi Prosek wrote: >> The write path for pass-through devices, commonly used for controlling >> keyboard LEDs via EV_LED, was not implemented. This commit adds the >> necessary plumbing to connect the status virtio queue to the host evdev >> file descriptor. >> >> Signed-off-by: Ladi Prosek <lpro...@redhat.com> >> --- >> Most of the new code has to do with handling EAGAIN/EWOULDBLOCK. I don't >> believe that this will be happening in practise for local evdev devices. > > Agree. > >> Of course, all bets are off if fd is an arbitrary file, > > It can't be, it would fail the evdev ioctls.
Ah! >> with the event stream). So part of me would just do one best-effort >> write and ignore all errors. I'm curious what you think. > > Just do best-effort sounds reasonable to me. Will do, thanks. > The code to handle EGAIN will just bitrot b/c it will never be used (and > I guess it is untested too, or did you manage to provoke EGAIN somehow?) if (rand() & 1) { return EAGAIN; } > cheers, > Gerd >