Bug 737010

Summary: libvirtd crash when executing "virsh snapshot-create-as" command sometimes
Product: Red Hat Enterprise Linux 6 Reporter: Gunannan Ren <gren>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.2CC: acathrow, dallan, dyuan, eblake, mzhan, nzhang, rwu, veillard, whuang, yupzhang
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.4-12.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:28:48 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: 733762    
Bug Blocks: 743047    
Attachments:
Description Flags
libvirtd.log when the libvirtd crashed
none
libvirtd.log when the libvirtd crashed on snapshot-delete none

Description Gunannan Ren 2011-09-09 11:02:22 UTC
Description of problem:
When running "virsh snapshot-create-as" to create snapshot for a domain
it occasionally reports error like:

# virsh snapshot-create-as virtlab_test snap1
error: Cannot find 'p&' in path: No such file or directory

sometimes error like:
# virsh snapshot-create-as virtlab_test snap2
error: End of file while reading data: Input/output error

and libvirtd is crashed.


Version-Release number of selected component (if applicable):
libvirt-0.9.4-11.el6.x86_64
libvirt-client-0.9.4-11.el6.x86_64
qemu-kvm-0.12.1.2-2.183.el6.x86_64
qemu-kvm-tools-0.12.1.2-2.183.el6.x86_64
qemu-img-0.12.1.2-2.183.el6.x86_64

How reproducible:

%90

Steps to Reproduce:
1. virsh snapshot-create-as <domain> <snapshotname>
2. virsh snapshot-revert <domain> <snapshotname>
3.
  
Actual results:

errors occur and libvirtd crash.

Expected results:

creating and reverting snapshot success.

Additional info:

Comment 3 Gunannan Ren 2011-09-10 16:10:42 UTC
I proposed a fix for the bug
https://www.redhat.com/archives/libvir-list/2011-September/msg00436.html

Comment 5 dyuan 2011-09-13 07:23:12 UTC
Created attachment 522864 [details]
libvirtd.log when the libvirtd crashed

100% reproduced this bug with libvirt-0.9.4-11.el6.

# virsh snapshot-list rhel6q2
 Name                 Creation Time             State
------------------------------------------------------------
 
# for name in s1 s2 s3 s4; do virsh snapshot-create-as rhel6q2 $name; done
Domain snapshot s1 created
error: Cannot find 'P&' in path: No such file or directory

error: Failed to reconnect to the hypervisor
error: no valid connection
error: End of file while reading data: Input/output error

error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

Comment 6 dyuan 2011-09-13 07:28:10 UTC
Created attachment 522865 [details]
libvirtd.log when the libvirtd crashed on snapshot-delete

The similar issue for snapshot-delete.

# virsh snapshot-list rhel6q2
 Name                 Creation Time             State
------------------------------------------------------------
 s1                   2011-09-13 15:12:21 +0800 shutoff
 s2                   2011-09-13 15:17:48 +0800 shutoff
 s3                   2011-09-13 15:18:08 +0800 shutoff
 s4                   2011-09-13 15:18:18 +0800 shutoff

[root@RHEL62-0719 home]# for name in s1 s2 s3 s4; do virsh snapshot-delete rhel6q2 $name; done
Domain snapshot s1 deleted

error: Failed to delete snapshot s2
error: End of file while reading data: Input/output error

error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

error: Failed to reconnect to the hypervisor
error: no valid connection
error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Connection refused

Comment 8 Eric Blake 2011-09-13 12:47:30 UTC
Guannan's proposed patch at https://www.redhat.com/archives/libvir-list/2011-September/msg00437.html does indeed look like it will fix the root cause of this issue, and that it is indeed an unintentional regression in one of my snapshot patches.  I'll take care of pushing it through the process today.

Comment 12 Nan Zhang 2011-09-22 06:00:19 UTC
Test with libvirt-0.9.4-12.el6.x86_64, libvirtd don't crash anymore. move this to VERIFIED.

# for name in s1 s2 s3 s4; do virsh snapshot-create-as foo $name; done
Domain snapshot s1 created
Domain snapshot s2 created
Domain snapshot s3 created
Domain snapshot s4 created

# virsh snapshot-list foo
 Name                 Creation Time             State
------------------------------------------------------------
 s1                   2010-02-08 19:25:28 -0500 shutoff
 s2                   2010-02-08 19:25:34 -0500 shutoff
 s3                   2010-02-08 19:25:39 -0500 shutoff
 s4                   2010-02-08 19:25:45 -0500 shutoff

Comment 13 errata-xmlrpc 2011-12-06 11:28:48 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/RHBA-2011-1513.html