Bug 678208

Summary: qemu-kvm hangs when installing guest with -spice option
Product: Red Hat Enterprise Linux 6 Reporter: Chao Yang <chayang>
Component: qemu-kvmAssignee: Uri Lublin <uril>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.1CC: alevy, djasa, ehabkost, hdegoede, jlibosva, juzhang, khong, lkocman, michen, mkenneth, mkrcmari, shu, tburke, uril, virt-maint
Target Milestone: rcKeywords: Regression, TestBlocker, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.153.el6 Doc Type: Bug Fix
Doc Text:
Cause: a bug in the locking logic in the spice code in qemu-kvm. Consequence: qemu-kvm hangs when using some versions of the qxl driver in the guest (e.g. xorg-x11-drv-qxl-0.0.12-5). Fix: fix the locking logic in the spice code in qemu-kvm. Result: qemu-kvm doesn't hang anymore when using xorg-x11-drv-qxl-0.0.12-5 in the guest.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 11:23:10 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: 580951, 661713    
Attachments:
Description Flags
qemu-kvm hangs after this screen
none
qemu-kvm hangs and spice gets black screen none

Comment 1 Chao Yang 2011-02-17 06:38:51 UTC
Created attachment 479268 [details]
qemu-kvm hangs after this screen

Comment 2 Chao Yang 2011-02-17 06:40:11 UTC
Created attachment 479269 [details]
qemu-kvm hangs and spice gets black screen

Comment 4 Gerd Hoffmann 2011-02-17 14:17:41 UTC
Strange, there are no spice related changes in 145 -> 146.  There are some mouse changes (both usb and vmmouse) which could have caused this, but I'd expect it affects both vnc and spice then ...

Do you see this with a rhel-6.0 guest too?
How does version 144 behave?
Does qemu respond when you type something in the monitor?
If so, can you try 'info mice'?

thanks

Comment 5 Gerd Hoffmann 2011-02-17 14:41:19 UTC
Hmm, quick attempt to reproduce with 6.0 failed, /me goes fetch 6.1 isos ...

Comment 6 Gerd Hoffmann 2011-02-18 11:20:07 UTC
Ah, 6.1 has qxl guest drivers in the install image whereas 6.0 hasn't.

Seems to be a race and 145 not triggering is probably pure luck ...

Comment 7 Chao Yang 2011-02-21 09:39:55 UTC
(In reply to comment #4)
> Strange, there are no spice related changes in 145 -> 146.  There are some
> mouse changes (both usb and vmmouse) which could have caused this, but I'd
> expect it affects both vnc and spice then ...
> 
> Do you see this with a rhel-6.0 guest too?

No, tested 5 times, all didn't hit same issue.

> How does version 144 behave?

can reproduce on 144 as well as 145

> Does qemu respond when you type something in the monitor?
No, qemu hangs, can't type a word.

Comment 8 Uri Lublin 2011-02-24 18:23:35 UTC
Is 679127 a duplicate of this one ?

Comment 11 Uri Lublin 2011-03-03 13:36:39 UTC
*** Bug 679127 has been marked as a duplicate of this bug. ***

Comment 12 Marian Krcmarik 2011-03-03 23:12:18 UTC
I believe that problem of hanging qemu-kvm is an issue of qxl driver in version xorg-x11-drv-qxl-0.0.12-5 or a feature of qemu related to the driver (at least the Bug 679127) - (because of surfaces patch?) .
Problem disappears when using different vga driver (vesa) when emulating QXL graphic card and disappears when emulating different graphic card.
Problem appears with vnc when using qxl driver.
I downgraded qxl driver in guest to version xorg-x11-drv-qxl-0.0.12-2.1 and problem disappears. All other related components (qemu-kvm, spice-server) are the latest versions. 

The original problem I am able to reproduce with only installation of RHEL6.1-20110216.n.0-snapshot-20110216 (tried several different) and problem disappears when emulating different graphic cards.

Comment 13 Lubos Kocman 2011-03-08 15:16:25 UTC
Any progress around here? We're really unable to test latest qemu-kvm/qxl and linux guest with this.

Comment 15 Uri Lublin 2011-03-09 12:55:37 UTC
I've prepared a scratch build:
https://brewweb.devel.redhat.com/taskinfo?taskID=3167085
We still need to go over locking scenarios and see if we got them all covered.
And get the patches accepted upstream...
Also note, that sometimes chvt or gnome-system-monitor "hangs", but qemu-kvm still works, which I think suggests a problem in another component (x11 qxl driver?)

Comment 16 Shaolong Hu 2011-03-10 07:26:52 UTC
Reproduced on:
----------------
host:
qemu-kvm-0.12.1.2-2.149.el6.x86_64

guest:
2.6.32-118.el6.i686
xorg-x11-drv-qxl-0.0.12-5.el6.i686

Reproduce Procedure:
----------------------
1. boot guest with:

/usr/libexec/qemu-kvm -M rhel6.1.0 -enable-kvm -m 8G -smp 4 -name RHEL-Server-6.1-32 -uuid `uuidgen` -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -boot order=cd -drive file=./RHEL6.1-32-qcow2,if=none,id=drive-ide-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device ide-drive,drive=drive-ide-disk0,id=ide-disk0 -netdev tap,script=/etc/qemu-ifup,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:7b:a2:fa -usb -device usb-tablet,id=input0 -monitor stdio -balloon none -vga qxl -spice port=5910,disable-ticketing

Actual results:
----------------
After step 1, qemu-kvm hangs.

How reproducible:
------------------
not always

Additional info:
------------------
with -vga qxl -spice, not always; with -vga qxl -vnc, 100%.
Downgrade xorg-x11-drv-qxl to xorg-x11-drv-qxl-0.0.12-2.1.el6.i686, -vga qxl with both -spice and -vnc works.

Comment 17 Chao Yang 2011-03-10 08:26:31 UTC
Here is what I get in monitor on xorg-x11-drv-qxl-0.0.12-5.el6.x86_64:
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
handle_dev_input: oom current 0 pipe 26
red_wait_outgoing_item: blocked
red_wait_outgoing_item: blocked
handle_dev_destroy_surfaces: 
red_wait_outgoing_item: blocked
red_wait_outgoing_item: blocked
handle_dev_destroy_surfaces: 
red_wait_outgoing_item: blocked
red_wait_outgoing_item: blocked
flush_display_commands: update timeout

And I downgraded xorg-x11-drv-qxl, guest also hangs.
# rpm -qa|grep xorg-x11-drv-qxl
xorg-x11-drv-qxl-0.0.12-2.1.el6.x86_64

Comment 18 Chao Yang 2011-03-10 08:39:49 UTC
(In reply to comment #17)
> Here is what I get in monitor on xorg-x11-drv-qxl-0.0.12-5.el6.x86_64:
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> handle_dev_input: oom current 0 pipe 26
> red_wait_outgoing_item: blocked
> red_wait_outgoing_item: blocked
> handle_dev_destroy_surfaces: 
> red_wait_outgoing_item: blocked
> red_wait_outgoing_item: blocked
> handle_dev_destroy_surfaces: 
> red_wait_outgoing_item: blocked
> red_wait_outgoing_item: blocked
> flush_display_commands: update timeout
> 
> And I downgraded xorg-x11-drv-qxl, guest also hangs.
> # rpm -qa|grep xorg-x11-drv-qxl
> xorg-x11-drv-qxl-0.0.12-2.1.el6.x86_64


Ignore Comment #17.

Comment 19 Uri Lublin 2011-03-10 09:49:21 UTC
*** Bug 683730 has been marked as a duplicate of this bug. ***

Comment 20 Lubos Kocman 2011-03-11 11:28:37 UTC
Any progress with this? It's really blocking us from testing RHEL guests

Comment 21 Marian Krcmarik 2011-03-13 15:34:37 UTC
(In reply to comment #15)
> I've prepared a scratch build:
> https://brewweb.devel.redhat.com/taskinfo?taskID=3167085
> We still need to go over locking scenarios and see if we got them all covered.
> And get the patches accepted upstream...
Thank you, works for me so far and no hang has been seen yet.

> Also note, that sometimes chvt or gnome-system-monitor "hangs", but qemu-kvm
> still works, which I think suggests a problem in another component (x11 qxl
> driver?)
I haven't seen this one yet.

Comment 23 Hans de Goede 2011-03-17 11:40:06 UTC
Note we (uri, alon and I) have made some changes (fixes) to the locking
patchset, here is a scratch build containing our latest patchset, which has been posted on qemu-devel:
https://brewweb.devel.redhat.com/taskinfo?taskID=3184103

Comment 24 Alon Levy 2011-03-20 12:17:37 UTC
*** Bug 674055 has been marked as a duplicate of this bug. ***

Comment 25 Dor Laor 2011-03-24 09:51:38 UTC
*** Bug 683388 has been marked as a duplicate of this bug. ***

Comment 30 Eduardo Habkost 2011-05-05 17:22:15 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: a bug in the locking logic in the spice code in qemu-kvm.

Consequence: qemu-kvm hangs when using some versions of the qxl driver in the guest (e.g. xorg-x11-drv-qxl-0.0.12-5).

Fix: fix the locking logic in the spice code in qemu-kvm.

Result: qemu-kvm doesn't hang anymore when using xorg-x11-drv-qxl-0.0.12-5 in the guest.

Comment 31 errata-xmlrpc 2011-05-19 11:23:10 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

Comment 32 errata-xmlrpc 2011-05-19 13:01:39 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

Comment 33 Tore H. Larsen 2011-06-22 07:02:26 UTC
cc. I hit this one. RHEL 6.1 server, vm is Fedora 15.