Bug 1038815 - blockJobInfo python API run success but return None
Summary: blockJobInfo python API run success but return None
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On: 999454
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-05 21:12 UTC by Chris Pelland
Modified: 2013-12-18 09:25 UTC (History)
15 users (show)

Fixed In Version: libvirt-0.10.2-29.el6_5.2
Doc Type: Bug Fix
Doc Text:
Cause: The libvirt python bindings for querying block job status were not distinguishing between an error and no status available. Consequence: Code that was polling for the completion of a block job had to deal with a python exception, and could not distinguish it from an actual error. Fix: The bindings now return an empty dictionary when there is no job and no error in determining that fact. Result: The binding can be used more reliably in managing block jobs.
Clone Of:
Environment:
Last Closed: 2013-12-18 09:25:13 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1856 0 normal SHIPPED_LIVE libvirt bug fix update 2013-12-18 14:24:00 UTC

Description Chris Pelland 2013-12-05 21:12:36 UTC
This bug has been copied from bug #999454 and has been proposed
to be backported to 6.5 z-stream (EUS).

Comment 7 Jincheng Miao 2013-12-12 03:10:29 UTC
In previous version like libvirt-0.10.2-29.el6.1,
Libvirt python API will None, and raise a exception:
# python 
Python 2.6.6 (r266:84292, Sep  4 2013, 07:46:00) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con=libvirt.open(None)
>>> dom=con.lookupByName('r6')
>>> dom.blockJobInfo('hda', 0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 1826, in blockJobInfo
    if ret is None: raise libvirtError ('virDomainGetBlockJobInfo() failed', dom=self)
libvirt.libvirtError: virDomainGetBlockJobInfo() failed

This NoneType return is fixed in libvirt-0.10.2-29.el6_5.2:
# python
Python 2.6.6 (r266:84292, Sep  4 2013, 07:46:00) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con=libvirt.open(None)
>>> dom=con.lookupByName('r6')
>>> dom.blockJobInfo('hda', 0)
{}

So I change the status to VERIFIED.

Comment 9 errata-xmlrpc 2013-12-18 09:25:13 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-2013-1856.html


Note You need to log in before you can comment on or make changes to this bug.