Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 999454

Summary: blockJobInfo python API run success but return None
Product: Red Hat Enterprise Linux 6 Reporter: Gunannan Ren <gren>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.5CC: cpelland, cwei, dyuan, eblake, eharney, gsun, honzhang, jdenemar, mzhan, rbalakri, xuzhang
Target Milestone: rcKeywords: Upstream, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.10.2-30.el6 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: 950419 Environment:
Last Closed: 2014-10-14 04:16:49 UTC Type: Bug
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: 912170, 912172, 950419    
Bug Blocks: 999077, 1038815    

Comment 4 Eric Blake 2013-10-10 18:01:02 UTC
The patch in comment 2 still applies.

Comment 13 Xuesong Zhang 2014-04-11 09:04:28 UTC
Verify this bug with the following package:
libvirt-0.10.2-31.el6.x86_64
libvirt-python-0.10.2-31.el6.x86_64

steps:
1. prpare a active block operations
1.1 prepare one qed image file.
# ll /var/lib/libvirt/images/qed.img 
-rw-r--r--. 1 qemu qemu 327680 Apr 11 04:17 /var/lib/libvirt/images/qed.img

1.2. create img backing file
# qemu-img create -f qed -b /var/lib/libvirt/images/qed.img
/var/lib/libvirt/images/qed1.img
Formatting '/var/lib/libvirt/images/qed1.img', fmt=qed size=8388608000
backing_file='/var/lib/libvirt/images/qed.img' cluster_size=0 table_size=0 

1.3. edit domain disk as using the backing file
# virsh edit rhel6.5
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qed' cache='none'/>
      <source file='/var/lib/libvirt/images/qed1.img'/>
      <target dev='vdb' bus='virtio'/>
    </disk>
...

1.4. start domain
# virsh start rhel6.5

1.5 do blockpull with setting bandwidth
# virsh blockpull rhel6.5 vdb --bandwidth 1

2. check the blockjob info via virsh command
# virsh blockjob rhel6.5 vdb;echo $?

0

3. check the blockjob info via API, the result is as expected.
# 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('')
>>> dom = con.lookupByName('rhel6.5')
>>> dom.blockJobInfo('vdb', 0)
{}

So, change the status to verify.

Comment 16 errata-xmlrpc 2014-10-14 04:16:49 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-2014-1374.html