Bug 1038815

Summary: blockJobInfo python API run success but return None
Product: Red Hat Enterprise Linux 6 Reporter: Chris Pelland <cpelland>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.5CC: acathrow, cpelland, cwei, dallan, dyuan, eblake, eharney, gren, gsun, honzhang, jdenemar, jmiao, mzhan, pm-eus, xqueralt
Target Milestone: rcKeywords: Upstream, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-18 09:25:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 999454    
Bug Blocks:    

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