RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 770919 - Sometimes virsh command screenshot may hang
Summary: Sometimes virsh command screenshot may hang
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-30 08:30 UTC by weizhang
Modified: 2012-06-20 06:40 UTC (History)
7 users (show)

Fixed In Version: libvirt-0.9.10-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 06:40:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description weizhang 2011-12-30 08:30:32 UTC
Description of problem:
Sometimes virsh command screenshot may hang

Version-Release number of selected component (if applicable):
kernel-2.6.32-223.el6.x86_64
libvirt-0.9.9-0rc1.el6.x86_64
qemu-kvm-0.12.1.2-2.213.el6.x86_64

How reproducible:
sometimes

Steps to Reproduce:
1. Prepare a running guest
2. # for i in {1..100}; do virsh screenshot guest; sleep 1; done
3.
  
Actual results:
It may hang after several loops

Expected results:
Command executed without hang

Additional info:

Comment 2 weizhang 2011-12-30 08:46:54 UTC
When I set log_level=1 on libvirtd.conf and then restart libvirtd, it will not hang any more on loop execution

Comment 3 Michal Privoznik 2012-01-10 16:31:32 UTC
Patch sent upstream:

https://www.redhat.com/archives/libvir-list/2012-January/msg00343.html

NB, this is not restricted to screenshot only, but any API using streams could have hit this issue. But yeah, all other stream using APIs do take longer time to finish, so screenshot is perfect for verification and testing.

Comment 6 Michal Privoznik 2012-01-12 11:11:09 UTC
Moving to POST:

commit 833b901cb711a9db148b4fe39e658411f82f3467
Author:     Michal Privoznik <mprivozn>
AuthorDate: Tue Jan 10 16:57:30 2012 +0100
Commit:     Michal Privoznik <mprivozn>
CommitDate: Thu Jan 12 12:02:40 2012 +0100

    stream: Check for stream EOF
    
    If client stream does not have any data to sink and neither received
    EOF, a dummy packet is sent to the daemon signalising client is ready to
    sink some data. However, after we added event loop to client a race may
    occur:
    
    Thread 1 calls virNetClientStreamRecvPacket and since no data are cached
    nor stream has EOF, it decides to send dummy packet to server which will
    sent some data in turn. However, during this decision and actual message
    exchange with server -
    
    Thread 2 receives last stream data from server. Therefore an EOF is set
    on stream and if there is a call waiting (which is not yet) it is woken
    up. However, Thread 1 haven't sent anything so far, so there is no call
    to be woken up. So this thread sent dummy packet to daemon, which
    ignores that as no stream is associated with such packet and therefore
    no reply will ever come.
    
    This race causes client to hang indefinitely.


v0.9.9-30-g833b901

Comment 9 hongming 2012-02-15 08:14:30 UTC
Reproduce the bug using libvirt-0.9.9-1.el6.x86_64



Verify it using libvirt-0.9.10-1.el6.x86_64

Steps
1. Prepare a running guest
2. # for i in {1..100}; do virsh screenshot guest; sleep 1; done

Results
Command executed without hang

Comment 11 errata-xmlrpc 2012-06-20 06:40:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0748.html


Note You need to log in before you can comment on or make changes to this bug.