Bug 950419
| Summary: | blockJobInfo python API run success but return None | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Wayne Sun <gsun> | |
| Component: | libvirt | Assignee: | Gunannan Ren <gren> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> | |
| Severity: | medium | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 7.0 | CC: | acathrow, cwei, dallan, dyuan, gren, honzhang, mzhan | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | x86_64 | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | libvirt-1.1.1-1.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | 912172 | |||
| : | 999077 999454 (view as bug list) | Environment: | ||
| Last Closed: | 2014-06-13 09:41:00 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 | |||
| Bug Blocks: | 999077, 999454 | |||
|
Description
Wayne Sun
2013-04-10 08:36:34 UTC
commit 0f9e67bfad96c4a2e69769d8a5908ee145a86766
Author: Guannan Ren <gren>
Date: Fri May 17 14:30:10 2013 +0800
python: return dictionary without value in case of no blockjob
Currently, when there is no blockjob, dom.blockJobInfo('vda')
still reports error because it doesn't distinguish return value 0 from -1.
libvirt.libvirtError: virDomainGetBlockJobInfo() failed
virDomainGetBlockJobInfo() API return value:
-1 in case of failure, 0 when nothing found, 1 found.
And use PyDict_SetItemString instead of PyDict_SetItem when key is
of string type. PyDict_SetItemString increments key/value reference
count, so call Py_DECREF() for value. For key, we don't need to
do this, because PyDict_SetItemString will handle it internally.
Verify it as follows.The result is expected.Move its status to VERIFIED.
Version
libvirt-1.1.1-1.el7.x86_64
libvirt-python-1.1.1-1.el7.x86_64
# virsh blockjob kvm-rhel7.0-x86_64-qcow2-virtio vda;echo $?
0
# python
Python 2.7.5 (default, May 28 2013, 19:05:42)
[GCC 4.8.0 20130510 (Red Hat 4.8.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import libvirt
>>> con = libvirt.open('')
>>> dom = con.lookupByName('kvm-rhel7.0-x86_64-qcow2-virtio')
>>> dom.blockJobInfo('vda')
{}
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |