Bug 1370396

Summary: vnc + qxl not working in relative mouse mode
Product: Red Hat Enterprise Linux 7 Reporter: mxie <mxie>
Component: qemu-kvm-rhevAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: areis, fjin, juzhou, knoel, kraxel, mxie, mzhan, tzheng, virt-maint, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-09 20:33:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description mxie@redhat.com 2016-08-26 07:58:45 UTC
Description of problem:
mouse can't be used in guest with vnc+qxl mode when guest has feature <vmport state='off'/> but has not tablet in xml


Version-Release number of selected component (if applicable):
libvirt-2.0.0-6.el7.x86_64
qemu-kvm-rhev-2.6.0-22.el7.x86_64




How reproducible:
100%

Steps to Reproduce:
Scenario1:

1.1 Prepare a guest which has feature <vmport state='off'/> and tablet <input type='tablet' bus='usb'> in xml
<domain type='kvm' id='20'>
  <name>rhel6.8</name>
  <uuid>dc450321-71c1-42ea-b53b-e31b6efe4f91</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.3.0'>hvm</type>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
........
  <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
   <graphics type='vnc' port='5902' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
.......
</domain>

Result:mouse can be used in guest

Scenario2:

2.1 Prepare a guest which has feature <vmport state='off'/> but has not tablet in guest xml
<domain type='kvm' id='20'>
  <name>rhel6.8</name>
  <uuid>dc450321-71c1-42ea-b53b-e31b6efe4f91</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.3.0'>hvm</type>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
  </features>
......,
 <graphics type='vnc' port='5902' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
.......
</domain>

Result:mouse can not be used in guest


Actual results:
As above description

Expected results:
mouse can be used in guest with vnc+qxl mode when guest has feature <vmport state='off'/> but has not tablet in xml

Additional info:
1.mouse can be used in guest with spice+qxl mode when guest has feature <vmport state='off'/> but has not table in xml
2.mouse can be used in guest with vnc+cirrus mode when guest has feature <vmport state='off'/> but has not table in xml

Comment 2 Gerd Hoffmann 2016-09-05 14:59:01 UTC
  Hi,

> Result:mouse can not be used in guest

Which means what?  Not working at all?  No mouse pointer visible?

Is the spice guest agent installed?

Comment 3 mxie@redhat.com 2016-09-06 02:42:14 UTC
(In reply to Gerd Hoffmann from comment #2)
>   Hi,
> 
> > Result:mouse can not be used in guest
> 
> Which means what?  Not working at all?  No mouse pointer visible?
> 
> Is the spice guest agent installed?

Hi Gerd,

Actually, there are two mouse in the guest, one mouse could be seen but another one which has actual control can't be seen, this bug will be happened when guest is using vnc+qxl mode and has feature <vmport state='off'/> but has not tablet in xml, so there is no service spice-vdagentd running in guest,thanks.

Comment 4 Gerd Hoffmann 2016-09-06 08:26:04 UTC
Hmm, yes, qxl wants move the mouse pointer (on guest request).
vnc doesn't support that (no rfb protocol message).

No easy way out.

No new issue, no regression, certainly not 7.3 material.

Comment 5 Gerd Hoffmann 2017-01-09 15:00:14 UTC
(In reply to Gerd Hoffmann from comment #4)
> Hmm, yes, qxl wants move the mouse pointer (on guest request).
> vnc doesn't support that (no rfb protocol message).
> 
> No easy way out.
> 
> No new issue, no regression, certainly not 7.3 material.

I think we can close this as wontfix (unsupported corner case).  areis?

spice is recommended for qxl anyway, and in absolute mode (i.e. with tablet, which is usually the case) qxl+vnc works fine too.

Comment 6 Ademar Reis 2017-01-09 20:33:12 UTC
(In reply to Gerd Hoffmann from comment #5)
> (In reply to Gerd Hoffmann from comment #4)
> > Hmm, yes, qxl wants move the mouse pointer (on guest request).
> > vnc doesn't support that (no rfb protocol message).
> > 
> > No easy way out.
> > 
> > No new issue, no regression, certainly not 7.3 material.
> 
> I think we can close this as wontfix (unsupported corner case).  areis?
> 
> spice is recommended for qxl anyway, and in absolute mode (i.e. with tablet,
> which is usually the case) qxl+vnc works fine too.

agree.

Comment 7 mxie@redhat.com 2017-01-23 03:17:04 UTC
If the guest is rhel5.11, the mouse can't be used normally no matter graphic mode is spice+qxl or vnc+qxl even if guest doesn't have feature <vmport state='off'/> but have tablet <input type='tablet' bus='usb'> in xml
# virsh dumpxml esx6.0-rhel5.11-x86_64
<domain type='kvm' id='201'>
  <name>esx6.0-rhel5.11-x86_64</name>
  <uuid>6069d0d5-0fc4-461a-94a1-94d93c7a62d1</uuid>
  ....
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.3.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  ....
    <input type='tablet' bus='usb'>
      <alias name='input0'/>
      <address type='usb' bus='0' port='1'/>
    </input>
  ....
</domain>

Packages:
qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64

Comment 8 Gerd Hoffmann 2017-01-23 12:46:36 UTC
(In reply to mxie from comment #7)
> If the guest is rhel5.11, the mouse can't be used normally no matter graphic
> mode is spice+qxl or vnc+qxl even if guest doesn't have feature <vmport
> state='off'/> but have tablet <input type='tablet' bus='usb'> in xml

Most likely a guest configuration issue, on RHEL-5 the tablet is not configured automatically, you have to do it manually, like this:

--- xorg.conf.o	2014-03-04 09:33:51.000000000 +0100
+++ xorg.conf	2014-03-04 09:41:33.000000000 +0100
@@ -4,6 +4,7 @@
 	Identifier     "Default Layout"
 	Screen      0  "Screen0" 0 0
 	InputDevice    "Keyboard0" "CoreKeyboard"
+	InputDevice    "usb-tablet" "CorePointer"
 EndSection
 
 Section "InputDevice"
@@ -14,6 +15,12 @@
 	Option	    "XkbVariant" "nodeadkeys"
 EndSection
 
+Section "InputDevice"
+	Identifier "usb-tablet"
+	Driver "evdev"
+	Option "Device" "/dev/input/event2"
+EndSection
+
 Section "Device"
 	Identifier  "Videocard0"
 	Driver      "qxl"

Might be another event<nr> device depending on guest configuration, you can check /proc/bus/input/devices to see which event device got assigned to the qemu usb tablet.