Bug 999454 - blockJobInfo python API run success but return None
blockJobInfo python API run success but return None
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.5
x86_64 Linux
urgent Severity urgent
: rc
: ---
Assigned To: Eric Blake
Virtualization Bugs
: Upstream, ZStream
Depends On: 912170 912172 950419
Blocks: 999077 1038815
  Show dependency treegraph
 
Reported: 2013-08-21 07:02 EDT by Gunannan Ren
Modified: 2016-04-26 10:01 EDT (History)
11 users (show)

See Also:
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 00:16:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 4 Eric Blake 2013-10-10 14:01:02 EDT
The patch in comment 2 still applies.
Comment 13 Xuesong Zhang 2014-04-11 05:04:28 EDT
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 00:16:49 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/RHBA-2014-1374.html

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