| Summary: | Guest will use ps2 input device instead of virtio one after save/restore or migration. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Fangge Jin <fjin> | ||||
| Component: | qemu-kvm-rhev | Assignee: | Dr. David Alan Gilbert <dgilbert> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 7.3 | CC: | amit.shah, chayang, fjin, hhuang, huding, jdenemar, juzhang, kraxel, mzhan, qizhu, quintela, virt-bugs, virt-maint, weliao, xfu, yafu | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: |
We don't need to add anything explicitly for this bug since it was cured prior to the release (and wasn't in the previous version); however, we should add a note somewhere about how to use virtio-input. In particular say not to use virtio-input together with usb-tablet or usb-mouse.
Cause:
Consequence:
Fix:
Result:
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2016-06-28 19:12:15 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: | |||||
| Attachments: |
|
||||||
Gerd, can you take a look? can you switch back to the virtio mouse via "mouse_set" monitor command? (In reply to Gerd Hoffmann from comment #6) > can you switch back to the virtio mouse via "mouse_set" monitor command? Hi, Gerd I retest use command, find can't switch back to the virtio mouse via "mouse_set". and no matter do or not do migration, just can switch from virtio to ps/2, can't switch ps/2 to virtio mouse. Can you provide the libvirt xml please; I couldn't reproduce it using a simple test here. Dave Also, I think you might have an error in your original report - you did the 'query-mice' command on the rhel7.2 domain not the fedora23 domain you describe the rest of the problems with; please include the output of query-mice on the same domain as the bug. I test this BZ again, it can be reproduced on build qemu-kvm-rhev-2.5.0-2.el7.x86_64 (though the result is slightly different), and CAN NOT be reproduced on build qemu-kvm-rhev-2.6.0-9.el7.x86_64. Steps are as below:
Test on build rhev-2.5.0-2.el7.x86_64:
1)# virsh start rhel7
2)# virsh qemu-monitor-command rhel7 --pretty '{"execute": "query-mice"}'
{
"return": [
{
"index": 2,
"name": "QEMU PS/2 Mouse",
"current": false,
"absolute": false
},
{
"index": 3,
"name": "QEMU Virtio Mouse",
"current": true,
"absolute": false
}
],
"id": "libvirt-13"
}
3)# virsh managedsave rhel7
# virsh start rhel7
4)# virsh qemu-monitor-command rhel7 --pretty '{"execute": "query-mice"}'
{
"return": [
{
"index": 3,
"name": "QEMU Virtio Mouse",
"current": false,
"absolute": false
},
{
"index": 2,
"name": "QEMU PS/2 Mouse",
"current": false,
"absolute": false
},
{
"index": 4,
"name": "vmmouse",
"current": true, ===> here is the current mouse
"absolute": false
}
],
"id": "libvirt-13"
}
Test on build rhev-2.6.0-9.el7.x86_64:
1)# virsh start rhel7
2)# virsh qemu-monitor-command rhel7 --pretty '{"execute": "query-mice"}'
{
"return": [
{
"index": 2,
"name": "QEMU PS/2 Mouse",
"current": false,
"absolute": false
},
{
"index": 3,
"name": "QEMU Virtio Mouse",
"current": true,
"absolute": false
}
],
"id": "libvirt-13"
}
3)# virsh managedsave rhel7
# virsh start rhel7
4)# virsh qemu-monitor-command rhel7 --pretty '{"execute": "query-mice"}'
{
"return": [
{
"index": 2,
"name": "QEMU PS/2 Mouse",
"current": false,
"absolute": false
},
{
"index": 4,
"name": "vmmouse",
"current": false,
"absolute": false
},
{
"index": 3,
"name": "QEMU Virtio Mouse",
"current": true, ===> here is the current mouse
"absolute": false
}
],
"id": "libvirt-13"
}
Created attachment 1172558 [details]
domain xml
Thanks! Yes, I can recreate this behaviour on 2.5.0 *and* 2.3.0 from 7.2 but not the current 2.6.0; I'm going to keep on looking at it, because I want to understand whether it was really fixed or we just got lucky. Some notes on pulling different versions apart:
Thanks; there are some interesting differences using a 7.2 guest and there's definitely
something weird happening with migration but it does seem to be better in the 2.6.0/7.3 build;
the following are all with a 7.2 guest:
2.6.0-9
(at X login) we have:
[root@virtlab413 ~]# virsh qemu-monitor-command input-rhel7 --hmp --cmd "info mice"
Mouse #2: QEMU PS/2 Mouse
* Mouse #3: QEMU Virtio Mouse
but then after a managedsave:
[root@virtlab413 ~]# virsh qemu-monitor-command input-rhel7 --hmp --cmd "info mice"
Mouse #2: QEMU PS/2 Mouse
Mouse #4: vmmouse <<<<<<<
* Mouse #3: QEMU Virtio Mouse
so after migration on 2.6.0, vmmouse has woken up even though there is no guest change,
but at least it's not the default.
Without X running, this doesn't happen; I guess that suggests that whatever logic
the vmmouse code decides to use to register post_load is broken.
Both 2.5.0 and 2.3.0 (rhel packages) have different behaviour:
X
Mouse #2: QEMU PS/2 Mouse
* Mouse #3: QEMU Virtio Mouse
Resume:
[root@virtlab413 x86_64]# virsh qemu-monitor-command input-rhel7 --hmp --cmd "info mice"
Mouse #3: QEMU Virtio Mouse
Mouse #2: QEMU PS/2 Mouse
* Mouse #5: vmmouse (absolute) <<<! Note gained this and now default?!
So that's probably bad; I wonder if that can explain some other weird behaviours with mice
breaking after migration.
Without X:
Mouse #2: QEMU PS/2 Mouse
* Mouse #3: QEMU Virtio Mouse
after restore:
Mouse #3: QEMU Virtio Mouse
* Mouse #2: QEMU PS/2 Mouse <!!!! Note swap!!!
So again we have a change in what is active.
So I think we have 1 problem and 2 ex-problems:
a) (all under X) vmmouse appears post migrate even if it wasn't previously
b) (2.5.0 and earlier under X) vmmouse appears and is made current
c) (2.5.0 and earlier no X) PS/2 gets selected as current mouse instead of virtio
Dave
(c) is the easy case to explain; it's fixed by 2d738374 which adds the live migration support to virtio-input. So now we know why it works in 2.6 but not 2.5. Still need to dig to see the logic vmmouse uses to see when it appears after migrate (a & possibly b). Also there's another case: d) (all no X) mouse_set to the PS/2 to select it explicitly; migrate and this is forgotten and we're back on virtio. Probably less important. Dave Some more debug, (d) and (a) are both real bugs, but since vmmouse never seems to get selected in any useful state where usb/virtio are also present I don't think (a) matters. I also don't think (d) matters because as far as I can tell libvirt doesn't use mouse-set so probably nothing uses it, especially downstream. Some more notes: a) I tried vmmouse+USB tablet - usb tablet always gets selected (it's setup to always be selected when it's read); so at least it's consistent. b) I tried virtio mouse+USB tablet - virtio always seems to win; I'm not really sure why, but it stays that way across migration. So I think we're OK for all real uses; it might be preferable to migrate the current selected device though to cover (d) and to do something so that vmmouse doesn't pop up after migration. So closing as current release; it's fixed in 2.6.0 by 2d738374. |
Description of problem: Guest will use ps2 input device instead of virtio one after save/restore or migration. Version-Release number of selected component: libvirt-1.3.2-1.el7.x86_64 qemu-kvm-rhev-2.5.0-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Prepare a guest with virtio input pci device: ... <input type='mouse' bus='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </input> <graphics type='vnc' port='-1' autoport='yes' listen='::'/> ... 2. Start the guest, after guest fully boots up, query mice device: # virsh qemu-monitor-command rhel7.2 --pretty '{"execute": "query-mice"}' { "return": [ { "index": 2, "name": "QEMU PS/2 Mouse", "current": false, "absolute": false }, { "index": 3, "name": "QEMU Virtio Mouse", "current": true, "absolute": false } ], "id": "libvirt-14" } 3. In guest, check virtio mouse input event # cat /proc/bus/input/devices ... I: Bus=0011 Vendor=0002 Product=0013 Version=5868 N: Name="VirtualPS/2 VMware VMMouse" P: Phys=isa0060/serio1/input1 S: Sysfs=/devices/platform/i8042/serio1/input/input4 U: Uniq= H: Handlers=event2 B: PROP=0 B: EV=b B: KEY=70000 0 0 0 0 B: ABS=3 I: Bus=0006 Vendor=0627 Product=0002 Version=0001 N: Name="QEMU Virtio Mouse" P: Phys=virtio3/input0 S: Sysfs=/devices/pci0000:00/0000:00:08.0/virtio3/input/input5 U: Uniq= H: Handlers=mouse1 event4 B: PROP=0 B: EV=7 B: KEY=30000 70000 0 0 0 0 B: REL=3 There are two mice in guest, they corresponds to event2 and event4 respectively 4. Listen to event2 and event4: In terminal one: # cat /dev/input/event2 In terminal two: # cat /dev/input/event4 5. Open guest graphic, move mouse onto it and click 6. Check output of terminal one and terminal two In terminal one, nothing output In terminal two, there are characters output: ���V����V����Vb�����Vb��������Vb����V����V����V����V����V����V����V����V����V����V����V����V����V����V����V����V���V���V���Vu���Vu���Vu���V�������Vӄ������Vw�� �������Vw� ���Vw����V9���Vs� �������Vs���VF���Vs����V�e ���V�����������V����V�e���V�����Vӄ ���V�����������V�� ���V�� ���V+ �������V+ 7. Do managedsave: # virsh managedsave 42 Domain 42 state saved by libvirt 8. Restore guest: # virsh start fedora23 Domain fedora23 started Query device mice again: # virsh qemu-monitor-command rhel7.2 --pretty '{"execute": "query-mice"}' { "return": [ { "index": 3, "name": "QEMU Virtio Mouse", "current": false, "absolute": false }, { "index": 2, "name": "QEMU PS/2 Mouse", "current": true, "absolute": false } ], "id": "libvirt-13" } 9.Open guest graphic, move mouse onto it and click 10. Check output of terminal one and terminal two In terminal one, there are characters output: Y��V,P FY��V,P �PY��V,P Y��V �Y��V In terminal two, nothing output 11. In guest, check virtio_input module: # lsmod|grep virtio virtio_input 16384 0 ... 12. Check the qemu cmd line, it's correct, so I think it's a qemu bug: -device virtio-mouse-pci,id=input0,bus=pci.0,addr=0x8 13. This issue also happens with live migration Actual results: As the output in step 10 shown, guest use ps2 mouse after save/restore or migration. Expected results: Guest still uses virtio input pci device after save/restore or migration.