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 795656 - destroyFlags should raise exception with proper error code
Summary: destroyFlags should raise exception with proper error code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: 6.3
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-21 07:50 UTC by Igor Lvovsky
Modified: 2013-03-01 04:54 UTC (History)
11 users (show)

Fixed In Version: libvirt-0.9.10-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 06:48:51 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 Igor Lvovsky 2012-02-21 07:50:50 UTC
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 18:50:32 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2012-February/msg00940.html

Comment 2 Eric Blake 2012-02-23 16:01:49 UTC
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 16:36:29 UTC
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 16:02:15 UTC
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-03-01 04:14:36 UTC
# 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-03-01 04:20:52 UTC
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 06:48:51 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.