Red Hat Bugzilla – Bug 1167883
Report job type in virDomainGetJobInfo
Last modified: 2015-03-05 02:47:44 EST
Description of problem: Due to a bug in patches for bug 1063724, virDomainGetJobInfo always reports type as VIR_DOMAIN_JOB_NONE (0). Version-Release number of selected component (if applicable): libvirt-1.2.8-9.el7 How reproducible: 100% Steps to Reproduce: 1. start a domain and run migration or managed-save on it 2. python >>> import libvirt >>> con = libvirt.open('') >>> dom = con.lookupByName(NAME) >>> dom.jobInfo() Actual results: [0, 198L, 0L, 151453696L, 32804528L, 99704832L, 151453696L, 32804528L, 99704832L, 0L, 0L, 0L] The first item (0) is the job type. Expected results: [2, ...] Additional info: virsh domjobinfo works because it uses virDomainGetJobStats when available which makes it unusable for testing this bug.
Fixed upstream by v1.2.10-205-g64b8491: commit 64b84911cecb82afa7ec08ce206eb1b71f76e04d Author: Wang Rui <moon.wangrui@huawei.com> Date: Tue Nov 25 19:51:45 2014 +0800 qemu: add the missing jobinfo type in qemuDomainGetJobInfo Commit 6fcddfcd refactored job statistics but missed the jobinfo type updated in qemuDomainGetJobInfo. After this patch, we can use virDomainGetJobInfo to get jobinfo type again. Signed-off-by: Wang Rui <moon.wangrui@huawei.com> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Verify it as follows. The result is expected. Move its status to VERIFIED. Run the script in the first terminal [root@localhost /]# cat test.py #!/bin/python import time import libvirt con = libvirt.open('') dom = con.lookupByName('r7') while 1: time.sleep(0.5) jbstr = dom.jobInfo() nullstr = [0, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L] if cmp(jbstr , nullstr) != 0: print dom.jobInfo() break [root@localhost /]# ./test.py Run the following in the second terminal [root@localhost /]# virsh managedsave r7 Domain r7 state saved by libvirt\ Get the job info in the first terminal # ./test.py [2, 166L, 0L, 1208963072L, 0L, 642588672L, 1208963072L, 0L, 642588672L, 0L, 0L, 0L]
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. https://rhn.redhat.com/errata/RHSA-2015-0323.html