Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 795656 - destroyFlags should raise exception with proper error code
destroyFlags should raise exception with proper error code
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
high Severity unspecified
: rc
: 6.3
Assigned To: Eric Blake
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-21 02:50 EST by Igor Lvovsky
Modified: 2013-02-28 23:54 EST (History)
11 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-3.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:48:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Igor Lvovsky 2012-02-21 02:50:50 EST
Description of problem:

For now destroyFlags(VIR_DOMAIN_DESTROY_GRACEFUL) raise libvirt.libvirtError
exception when failed.
In this case error code is VIR_ERR_INTERNAL_ERROR and message is "failed to kill qemu process with SIGTERM".

The problem is that  VIR_ERR_INTERNAL_ERROR is too general.
Please consider to change it to something more meaningful


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Eric Blake 2012-02-22 13:50:32 EST
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2012-February/msg00940.html
Comment 2 Eric Blake 2012-02-23 11:01:49 EST
Bare minimum backport in POST:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-February/msg01316.html

However, we have the bigger question of whether we should also be backporting graceful destroy.
Comment 3 Eric Blake 2012-02-24 11:36:29 EST
Upstream has a graceful timeout on destroy, which is the probably primary reason that you would hit this error in the first place.  Should we widen the scope of this bug to also include backporting the VIR_DOMAIN_DESTROY_GRACEFUL flag and implementation?
Comment 4 Dan Kenigsberg 2012-02-26 11:02:15 EST
In my opinion, there is no need to backport VIR_DOMAIN_DESTROY_GRACEFUL to rhel-6.2 unless we receive a clear customer request. RHEV-3.0 has its guest-agent-assisted graceful destruction; if it was not used, the customer probably care less about his data.
Comment 7 Wayne Sun 2012-02-29 23:14:36 EST
# rpm -q libvirt qemu-kvm
libvirt-0.9.10-3.el6.x86_64
qemu-kvm-0.12.1.2-2.225.el6.x86_64

1. prepare a running domain
# virsh list 
 Id    Name                           State
----------------------------------------------------
 2     rhel6u2                        running

2. hung the domain process
# pidof qemu-kvm
25933

# kill -STOP 25933

3. destroy domain with graceful
# virsh destroy rhel6u2 --graceful
error: Failed to destroy domain rhel6u2
error: operation failed: failed to kill qemu process with SIGTERM

In libvirtd.log
2012-03-01 04:06:39.889+0000: 21282: warning : qemuProcessKill:3592 : Timed out waiting after SIGTERM to process 25933
2012-03-01 04:06:39.889+0000: 21282: error : qemuDomainDestroyFlags:1796 : operation failed: failed to kill qemu process with SIGTERM

So this is fixed.
Comment 8 Wayne Sun 2012-02-29 23:20:52 EST
check with python
# python
Python 2.6.6 (r266:84292, Sep 12 2011, 14:03:14) 
[GCC 4.4.5 20110214 (Red Hat 4.4.5-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> conn = libvirt.open(None)
>>> dom = conn.lookupByName("rhel6u2")
>>> dom.destroyFlags(1)
libvir: QEMU error : operation failed: failed to kill qemu process with SIGTERM
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 683, in destroyFlags
    if ret == -1: raise libvirtError ('virDomainDestroyFlags() failed', dom=self)
libvirt.libvirtError: operation failed: failed to kill qemu process with SIGTERM
Comment 10 errata-xmlrpc 2012-06-20 02:48:51 EDT
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.