Bug 769251

Summary: blockresize lack of "free lock" after given wrong parameter
Product: Red Hat Enterprise Linux 6 Reporter: weizhang <weizhan>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.3CC: acathrow, ajia, dallan, dyuan, eblake, jyang, mzhan, rwu, veillard, yupzhang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.9-1.el6 Doc Type: Bug Fix
Doc Text:
No documentation needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:39:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description weizhang 2011-12-20 11:24:37 UTC
Description of problem:
When give wrong path for virsh command "blockresize", the domain lock can not be free

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.211.el6.x86_64
kernel-2.6.32-223.el6.x86_64
libvirt-0.9.8-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest with raw disk
2. # virsh blockresize kvm-rhel6u2-x86_64-new sda 2221225
error: Failed to resize block device 'sda'
error: invalid argument: invalid path: sda

3. # virsh destroy kvm-rhel6u2-x86_64-new
error: Failed to destroy domain kvm-rhel6u2-x86_64-new
error: Timed out during operation: cannot acquire state change lock

4. # virsh start kvm-rhel6u2-x86_64-new
error: Failed to start domain kvm-rhel6u2-x86_64-new
error: Timed out during operation: cannot acquire state change lock
  
Actual results:
domain lock does not be freed when given wrong parameter on blockresize

Expected results:
blockresize can free domain lock when given wrong parameter

Additional info:

Comment 3 Osier Yang 2011-12-21 02:23:17 UTC
patch comitted, move to POST.

Comment 4 Daniel Veillard 2012-01-09 09:38:06 UTC
Upstream commit 33eca17f6ae163014aac6fee75175b16ef2e54f2

Daniel

Comment 6 Min Zhan 2012-01-10 07:54:43 UTC
Reproduce this bug with libvirt-0.9.8-1.el6.x86_64.

Verified this bug with libvirt-0.9.9-1.el6:

# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.213.el6.x86_64
# uname -a
Linux intel-w3520-12-1.englab.nay.redhat.com 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

Steps:
1. disk target is not sda, check guest can destroy and start successfully although parameter is wrong.

# virsh list --all
 Id Name                 State
----------------------------------
  4 rhel62               running

# virsh dumpxml rhel62
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel62.img'/>
      <target dev='hda' bus='ide'/>
...

# virsh blockresize rhel62 sda 2221225
error: Failed to resize block device 'sda'
error: invalid argument: invalid path: sda

# virsh destroy rhel62
Domain rhel62 destroyed

# virsh start rhel62
Domain rhel62 started


2. disk target is sda and check the command can take effect.

# virsh dumpxml rhel62
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/rhel62.img'/>
      <target dev='sda' bus='ide'/>
...

# virsh blockresize rhel62 sda 2221225
Block device 'sda' is resized

# virsh destroy rhel62
Domain rhel62 destroyed

# virsh start rhel62
Domain rhel62 started

Comment 7 Osier Yang 2012-05-04 07:23:38 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:
No documentation needed

Comment 9 errata-xmlrpc 2012-06-20 06:39: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