Hide Forgot
Description of problem: $dom->get_block_job_info can not get correct value for type and end Version-Release number of selected component (if applicable): perl-Sys-Virt-1.1.1-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.cat test.pl #!/usr/bin/perl use warnings; use strict; use Sys::Virt; my $uri = "qemu:///system"; my $domname = "tck"; my $con = Sys::Virt->new(address => $uri, readonly => 0); my $dom = $con->get_domain_by_name($domname); my $jobinfo; my $pathmain = "/var/cache/libvirt-tck/storage-fs/tck/tck-main"; $jobinfo = $dom->get_block_job_info($pathmain, 0); while(my ($k, $v) = each %{$jobinfo}) { print "$k => $v\n"; } 2. Start a guest with xml <domain type="kvm"> <name>tck</name> <memory>65536</memory> <currentMemory>65536</currentMemory> <os> <type>hvm</type> <kernel>/var/cache/libvirt-tck/os-x86_64-hvm/vmlinuz</kernel> <initrd>/var/cache/libvirt-tck/os-x86_64-hvm/initrd</initrd> </os> <features> <acpi /> <apic /> </features> <devices> <disk type="file"> <source file="/var/cache/libvirt-tck/os-x86_64-hvm/disk.img" /> <target dev="vda" /> </disk> <disk type="file"> <driver name="qemu" type="qcow2" /> <source file="/var/cache/libvirt-tck/storage-fs/tck/tck-main" /> <target dev="vdb" /> </disk> <console type="pty" /> </devices> </domain> 3. run #perl test.pl Actual results: cur => 0 bandwidth => 16302096 type => 18577664 end => 16746808 Expected results: "type" and "end" should be 0 when no block job, and not sure if bandwidth is right because it is different from rhel6 test result Additional info:
This is a libvirt bug - it isn't zero'ing out the fields of the block job info struct https://www.redhat.com/archives/libvir-list/2013-December/msg00101.html
In libvirt-1.1.1-13.el7.x86_64, the get_block_job_info will output random numbers, even if there is no block job performed: # while true; do perl test.pl; sleep 1;done cur => 0 bandwidth => 30175248 type => 31177832 end => 30738240 cur => 0 bandwidth => 21766160 type => 22768744 end => 22329152 cur => 0 bandwidth => 26107920 type => 27110504 end => 26670912 cur => 0 bandwidth => 10289168 type => 11291752 end => 10852160 And this bug is fixed in libvirt-1.1.1-14.el7. The job info will show the right number when block copy occurs, like: cur => 0 bandwidth => 0 type => 0 end => 0 cur => 9346875392 bandwidth => 0 type => 2 end => 10737418240 cur => 9438035968 bandwidth => 0 type => 2 end => 10737418240 cur => 9591455744 bandwidth => 0 type => 2 end => 10737418240 So I will set this bug as VERIFIED.
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.