Bug 487025

Summary: Add FDI rule for QEMU USB tablet
Product: [Fedora] Fedora Reporter: Daniel BerrangĂ© <berrange>
Component: halAssignee: Richard Hughes <richard>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: rhughes, richard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-26 13:28:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 487028    

Description Daniel Berrangé 2009-02-23 18:25:47 UTC
Description of problem:
The default mouse for KVM guests is a PS/2 mouse. This causes pain for users because it only works with relative coordinates, which means we are forced to grab the mouse pointer in the VNC client. 

KVM can emulate a USB graphics tablet which works in absolute coordinate mode, and thus gives flawless mouse motion tracking without needing any grab in the client. 

We want to enable the USB tablet by default in Fedora 11, but cannot do this unless Xorg automatically configures it correctly out of the box.

Auto-config currently doesn't work because the HAL FDI policy for x11 drivers does not look for the USB tablet.

In the file

/usr/share/hal/fdi/policy/10osvendor/10-x11-input.fdi

Please add the following rule

    <match key="input.product" contains="QEMU USB Tablet">
       <merge key="input.x11_driver" type="string">evdev</merge>
    </match>

NB, the actual data from /proc/bus/input/devices is

I: Bus=0003 Vendor=0627 Product=0001 Version=0001
N: Name="QEMU 0.9.1 QEMU USB Tablet"
P: Phys=usb-0000:00:01.2-2/input0
S: Sysfs=/devices/pci0000:00/0000:00:01.2/usb1/1-2/1-2:1.0/input/input4
U: Uniq=1
H: Handlers=mouse2 event4 js0 
B: EV=1f
B: KEY=70000 0 0 0 0
B: REL=100
B: ABS=3
B: MSC=10

But I strongly recommend only matching on 'QEMU USB Tablet' because we do not want to break when we update from QEMU 0.9.1 to 0.9.2



Version-Release number of selected component (if applicable):
hal-0.5.12-19.20081219git.fc11.x86_64

How reproducible:


Steps to Reproduce:
1. Install a F11 guest in  KVM and shut it down
2. Run 'virsh edit f11guestdemo'
3. Add  "<input type='tablet' bus='usb'/>" in the <devices> section
4. Run 'virsh start f11guestdemo'
5. Try to the mouse in X in the guest
  
Actual results:
Mouse does not work and lshal output does not show any x11_driver property for the USB tablet

Expected results:
Mouse works and lshal output shows the USB tablet setup with 'input.x11_driver = evdev'

eg

udi = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0_logicaldev_input'
  access_control.file = '/dev/input/event4'  (string)
  access_control.type = 'joystick'  (string)
  info.callouts.add = {'hal-acl-tool --add-device'} (string list)
  info.callouts.remove = {'hal-acl-tool --remove-device'} (string list)
  info.capabilities = {'input', 'input.joystick', 'access_control'} (string list)
  info.category = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0'  (string)
  info.product = 'QEMU 0.9.1 QEMU USB Tablet'  (string)
  info.subsystem = 'input'  (string)
  info.udi = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0_logicaldev_input'  (string)
  input.device = '/dev/input/event4'  (string)
  input.originating_device = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0'  (string)
  input.product = 'QEMU 0.9.1 QEMU USB Tablet'  (string)
  input.x11_driver = 'evdev'  (string)
  linux.device_file = '/dev/input/event4'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:01.2/usb1/1-2/1-2:1.0/input/input4/event4'  (string)



Additional info:

Comment 1 Daniel Berrangé 2009-02-26 12:14:41 UTC
Just tested with the new build including the patch:

hal-0.5.12-21.20090226git.fc11.x86_64

and it correctly sets x11_driver

udi = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0_logicaldev_input'
  access_control.file = '/dev/input/event4'  (string)
  access_control.type = 'mouse'  (string)
  info.callouts.add = {'hal-acl-tool --add-device'} (string list)
  info.callouts.remove = {'hal-acl-tool --remove-device'} (string list)
  info.capabilities = {'input', 'input.mouse', 'access_control'} (string list)
  info.category = 'input'  (string)
  info.parent = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0'  (string)
  info.product = 'QEMU 0.9.1 QEMU USB Tablet'  (string)
  info.subsystem = 'input'  (string)
  info.udi = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0_logicaldev_input'  (string)
  input.device = '/dev/input/event4'  (string)
  input.originating_device = '/org/freedesktop/Hal/devices/usb_device_627_1_1_if0'  (string)
  input.product = 'QEMU 0.9.1 QEMU USB Tablet'  (string)
  input.x11_driver = 'evdev'  (string)
  linux.device_file = '/dev/input/event4'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'input'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:01.2/usb1/1-2/1-2:1.0/input/input4/event4'  (string)



And X configures it

(II) config/hal: Adding input device QEMU 0.9.1 QEMU USB Tablet
(**) QEMU 0.9.1 QEMU USB Tablet: always reports core events
(**) QEMU 0.9.1 QEMU USB Tablet: Device: "/dev/input/event4"
(II) QEMU 0.9.1 QEMU USB Tablet: Found 3 mouse buttons
(II) QEMU 0.9.1 QEMU USB Tablet: Found scroll wheel(s)
(II) QEMU 0.9.1 QEMU USB Tablet: Found x and y absolute axes
(II) QEMU 0.9.1 QEMU USB Tablet: Configuring as mouse
(**) QEMU 0.9.1 QEMU USB Tablet: YAxisMapping: buttons 4 and 5
(**) QEMU 0.9.1 QEMU USB Tablet: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
(II) XINPUT: Adding extended input device "QEMU 0.9.1 QEMU USB Tablet" (type: MOUSE)
(**) QEMU 0.9.1 QEMU USB Tablet: (accel) keeping acceleration scheme 1
(**) QEMU 0.9.1 QEMU USB Tablet: (accel) filter chain progression: 2.00
(**) QEMU 0.9.1 QEMU USB Tablet: (accel) filter stage 0: 20.00 ms
(**) QEMU 0.9.1 QEMU USB Tablet: (accel) set acceleration profile 0


So, working nicely, thanks !

Comment 2 Richard Hughes 2009-02-26 13:28:30 UTC
Excellent, thanks for testing.