Bug 771016

Summary: virsh destroy a guest . guest status will hang with in shutdown
Product: Red Hat Enterprise Linux 6 Reporter: Huang Wenlong <whuang>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.3CC: acathrow, cwei, dallan, dyuan, mzhan, rwu, tzheng, yupzhang
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.4-23.el6_2.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:40:52 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 Huang Wenlong 2011-12-31 07:10:29 UTC
Description of problem:
virsh destroy a guest  . guest status will hang with  in shutdown 
restart libvirtd will work around this 

libvirt-0.9.4-23.el6_2.1.x86_64  is fine so it is regression .


Version-Release number of selected component (if applicable):
libvirt-0.9.4-23.el6_2.2.x86_64
qemu-kvm-0.12.1.2-2.209.el6_2.2.x86_64


How reproducible:
100%

Steps to Reproduce:
1. #virsh start q2
Domain q2 started

2. #virsh destroy q2
Domain q2 destroyed
3.#virsh list --all
  - q2                   in shutdown


Actual results:
hang

Expected results:
no hang ,status should be shut off

Additional info:

Comment 4 Daniel Veillard 2012-01-04 05:13:10 UTC
This was a side effect of the patch for 

  https://bugzilla.redhat.com/show_bug.cgi?id=770959

which was included in libvirt-0.9.4-23.el6_2.2 . The problem was reported
and fixed upstream.

libvirt-0.9.4-23.el6_2.3 is built and should include the fix:

commit 97652044af5f2c70e2bfbddbd59eb047bf0a82fa
Author: Jiri Denemark <jdenemar>
Date:   Wed Dec 7 12:52:59 2011 +0100

    qemu: Ignore shutdown event from destroyed domain
    
    During virDomainDestroy, QEMU may emit SHUTDOWN event as a response to
    SIGTERM and since domain object is still locked, the event is processed
    after the domain is destroyed. We need to ignore this event in such case
    to avoid changing domain state from shutoff to shutdown.

Daniel

Comment 6 tingting zheng 2012-01-04 08:11:26 UTC
Reproduced the bug with:
libvirt-0.9.4-23.el6_2.2.x86_64
qemu-kvm-0.12.1.2-2.209.el6_2.2.x86_64

# virsh start rhel6
Domain rhel6 started

# virsh list 
 Id Name                 State
----------------------------------
  1 rhel6                running

# virsh destroy rhel6
Domain rhel6 destroyed

# virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                in shutdown


When I updated libvirt to libvirt-0.9.4-23.el6_2.3.x86_64,it is fine:

# virsh start rhel6
Domain rhel6 started

# virsh list 
 Id Name                 State
----------------------------------
  1 rhel6                running

# virsh destroy rhel6
Domain rhel6 destroyed

# virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off

Comment 8 yuping zhang 2012-01-06 10:42:53 UTC
Verified this issue with:
libvirt-0.9.4-23.el6_2.4.x86_64
libvirt-client-0.9.4-23.el6_2.4.x86_64
libvirt-python-0.9.4-23.el6_2.4.x86_64

# virsh start test
Domain test started

# virsh list --all
 Id Name                 State
----------------------------------
  2 test                 running

# virsh destroy test
Domain test destroyed
# virsh list --all
 Id Name                 State
----------------------------------
  - test                 shut off

So change the status to VERIFIED.

Comment 11 dyuan 2012-02-15 07:53:58 UTC
Verified PASS with libvirt-0.9.10-1.el6.
pkg: 
qemu-kvm-0.12.1.2-2.225.el6
kernel-2.6.32-232.el6

# virsh start rhel6
Domain test started

# virsh list --all
 Id Name                 State
----------------------------------
  7 rhel6                running

# virsh destroy test
Domain test destroyed

# virsh list --all
 Id Name                 State
----------------------------------
  - rhel6                shut off

Comment 14 errata-xmlrpc 2012-06-20 06:40:52 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