<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Just a quick thought as I personally
      find the layout of evdev terminally confusing but given evdev
      likes to have lots and lots of events numbers for every device it
      does seem likely that your keyboard / mouse wouldn't be
      event1/event2 as something else would beat them to it. Do you have
      a /dev/input/by-id directory as I do on my debian/arch systems? I
      find it gives readable names that don't change randomly all the
      time and are links to the concisely . They are still confusing
      though.<br>
      <br>
      ls -l /dev/input/by-id/<br>
      total 0<br>
      lrwxrwxrwx 1 root root 9 Apr 10 20:29
      usb-Areson_USB_Device-event-mouse -> ../event3<br>
      lrwxrwxrwx 1 root root 9 Apr 10 20:29
      usb-Areson_USB_Device-if01-event-kbd -> ../event4<br>
      lrwxrwxrwx 1 root root 9 Apr 10 20:29 usb-Areson_USB_Device-mouse
      -> ../mouse0<br>
      lrwxrwxrwx 1 root root 9 Apr 11 00:54
      usb-Logitech_USB_Keyboard-event-if01 -> ../event7<br>
      lrwxrwxrwx 1 root root 9 Apr 11 00:54
      usb-Logitech_USB_Keyboard-event-kbd -> ../event6<br>
      <br>
      In this case event4 is particularly confusing as it is a mouse in
      "media keys," clothing.<br>
      <br>
      To double check type cat /proc/bus/input/devices and look for the
      Handlers lines as these should match the above. It should say
      things like kbd event7 (and it matches) and you can pick up the
      device names/sysfs fields from the structure and prod them further
      to be sure<br>
      <br>
      It's 1:30 am ... so if you get stuck send me a direct mail with<br>
      <br>
      ls -l /dev/input/by-id <br>
      cat /proc/bus/input/devices<br>
      xinput list --long<br>
      <br>
      And I'll tell you precisely about why I don't know what the hell
      is going on. I have done it before ... just seemed a long tim ago.
      It's really not that bad either .. I'm pretty sure it just got
      tidied up recently hence my personal trauma as nothing tht used to
      work does anymore.<br>
      <br>
    </div>
    <blockquote
cite="mid:CAF+RWwQ1tidWr71ciewsZqFkXLNwvv77_h3tFhsracDF6LCusw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Looks like this is a bug with the input-linux.  The
            function "input_linux_complete" tries to detect what kind of
            input device the given evdev device is by testing
            EVIOCGBIT(0, ...).  My keyboard (a Logitech K350) has the
            EV_REL bit set, and so input_linux_complete sees it as a
            mouse.  That explains my problems.<br>
            <br>
          </div>
          I'll see about reporting the bug to QEMU.<br>
        </div>
        <div>
          <div><br>
            <br>
            <br>
            <br>
            <blockquote>
              <div>
                <div>
                  <div>
                    <div>
                      <div>
                        <div>Hello,<br>
                          <br>
                        </div>
                        I installed the qemu-git AUR package on my Arch
                        system, so that I could try the new input-linux
                        patches.  I use virt-manager, so I added this to
                        the XML for the Windows 10 guest using "virsh
                        edit win10":<br>
                        <br>
                         <qemu:commandline><br>
                            <qemu:arg value='-object'/><br>
                            <qemu:arg
                        value='input-linux,id=kbd1,evdev=/dev/input/event1,grab_all=on'/><br>
                            <qemu:arg value='-object'/><br>
                            <qemu:arg
                        value='input-linux,id=mouse1,evdev=/dev/input/event2'/><br>
                          </qemu:commandline><br>
                        <br>
                      </div>
                      I also had to whitelist /dev/input/event1 and
                      /dev/input/event2 in /etc/libvirt/qemu.conf under
                      "cgroup_device_acl" (I also chmod'd
                      /dev/input/event1 and 2 as 777.  Just trying to
                      get things working right now).<br>
                      <br>
                    </div>
                    After doing all that, the machine boots and grabs my
                    mouse.  The mouse works in the guest, but the
                    keyboard does not respond.  The hotkey to toggle
                    control back to the host doesn't work.  The only way
                    I can release the mouse is to shutdown the VM.<br>
                    <br>
                  </div>
                  There are no errors listed in
                  /var/log/libvirt/qemu/win10.log.  I double checked
                  that event1 is the right dev by running evtest.  I see
                  all my keyboard events when I do that.  evtest sees
                  KEY_LEFTCTRL and KEY_RIGHTCTRL, so those keys work. 
                  When I start the VM, evtest stops showing events, so
                  clearly qemu is grabbing the devices.  I've looked
                  over the code in input-linux.c and can't see why it
                  wouldn't at least respond to the hotkey.<br>
                  <br>
                </div>
                I'm not sure how to do further debugging at this point. 
                I don't know the QEMU codebase, so I don't know how to
                add logging to input-linux.c.  Not sure if printing to
                stdout works or where that output would go.  I might try
                adding a few printf statements to see if I can get QEMU
                to tell me if it is at least receiving the keyboard
                events correctly or what's going on.<br>
                <br>
              </div>
              Any help would be appreciated, thank you.<br>
            </blockquote>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
vfio-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:vfio-users@redhat.com">vfio-users@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/vfio-users">https://www.redhat.com/mailman/listinfo/vfio-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>