Bug 701912

Summary: mouse doesn't work well when add usedevice tablet option to command line of rhel5.7
Product: Red Hat Enterprise Linux 5 Reporter: FuXiangChun <xfu>
Component: kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7CC: berrange, ehabkost, gcosta, juzhang, michen, mkenneth, virt-maint, xen-maint
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-14 15:22:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description FuXiangChun 2011-05-04 09:21:05 UTC
Description of problem:
start guest rhel5.7 with usedevice tablet option, mouse is not displayed correctly. it will randomly move in guest. if remove it from command line, it will work well. 

Version-Release number of selected component (if applicable):
--host
kvm-83-232.el5

uname -r
2.6.18-259.el5


How reproducible:


Steps to Reproduce:
1./usr/libexec/qemu-kvm -no-hpet -rtc-td-hack -usb -usbdevice tablet -name 57 -smp 2 -m 4G -uuid `uuidgen` -boot c -drive file=/mnt/rhel57.qcow2,if=ide,cache=none,boot=on,format=qcow2,werror=stop -net nic,vlan=1,macaddr=52:54:00:94:a3:8b,model=rtl8139 -net tap,vlan=1,script=/etc/qemu-ifup -notify all -balloon none -monitor stdio -spice ic=on,port=5911,disable-ticketing -qxl 1
2.run system-config-display command and select qxl driver from hardware windows in guest
3. testing mouse
  
Actual results:
mouse can not work well

Expected results:
mouse work well

Additional info:

Comment 1 Daniel Berrangé 2011-05-04 09:34:56 UTC
Did you reconfigure the Xorg server in the guest to correctly use the 'evdev' device for handling the USB tablet ?  RHEL-5 vintage Xorg does *not* automatically configure input devices correctly and thus always requires manual admin configuration. Without  the admin config steps you'll get crazy mouse movement like you describe.

Only RHEL-6 / Fedora 8+  / Windows  are capable of using a USB tablet without manual config steps.

Comment 2 FuXiangChun 2011-05-05 06:29:16 UTC
add below section to xorg.conf configuration. mouse work well. 

Section "InputDevice"
Identifier "Configured Mouse 0"
# Driver "mouse"
Driver "evdev"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "Emulate3Buttons" "true"
EndSection

Comment 3 FuXiangChun 2011-05-05 06:46:07 UTC
windows guest work well. it can auto config mouse driver.

Comment 4 juzhang 2011-05-05 07:02:34 UTC
According to comment1,comment2 and comment3,close this bug as not bug.

Comment 5 FuXiangChun 2011-05-26 01:52:30 UTC
sorry, i am mistake, about Comment2 method, i don't change video card to qxl, if change video card to qxl and start guest --usbdevice tablet option then mouse still randomly move in guest, In order to further investigate this issue i reopen this bug. i tried to used below configuration to reconfigure the Xorg server but still got the same issue. if there is any way to solve it please add comments.

1. xorg.conf
# Xorg configuration created by system-config-display

Section "ServerLayout"
        Identifier     "single head configuration"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Mouse0" "CorePointer"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
EndSection

Section "InputDevice"

#Driver "mouse"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "Mode" "Absolute"
        Option      "SendCoreEvents" "1"
        Option      "Device" "/dev/input/mouse1"
        Option      "Protocal" "ExplorerPS/2"
        Option      "Emulate3Buttons" "true"
EndSection

Section "Device"
        Identifier  "Videocard0"
        Driver      "qxl"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "800x600" "640x480"
        EndSubSection
EndSection

2.xorg.conf
# Xorg configuration created by system-config-display

Section "ServerLayout"
        Identifier     "single head configuration"
        Screen      0  "Screen0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "Mouse0" "CorePointer"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
EndSection

Section "InputDevice"

#Driver "mouse"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "Mode" "Absolute"
        Option      "SendCoreEvents" "1"
        Option      "Device" "/dev/input/mice"
        Option      "Protocal" "ExplorerPS/2"
        Option      "Emulate3Buttons" "true"
EndSection

Section "Device"
        Identifier  "Videocard0"
        Driver      "qxl"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "800x600" "640x480"
        EndSubSection
EndSection

3. can get usb device in guest after guest booted
/sys/devices/pci0000:00/0000:00:01.2/usb1/1-2/1-2:1.0/input:input2/mouse1

Comment 6 Eduardo Habkost 2011-05-30 14:29:39 UTC
Moving to NEW, bugs assigned to virt-maint shouldn't be on ASSIGNED state.

Comment 7 Gerd Hoffmann 2011-06-14 15:22:28 UTC
Tablet config should look like this:

Section "InputDevice"
        Identifier "Tablet"
        Driver "evdev"
        Option "Device" "/dev/input/event2"
        Option "CorePointer" "true"
EndSection

See also:
https://access.redhat.com/kb/docs/DOC-15506?sc_cid=70160000000HjBZAA0