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 1028846 - $dom->get_block_job_info get wrong type and end
Summary: $dom->get_block_job_info get wrong type and end
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-11 03:31 UTC by weizhang
Modified: 2014-06-18 00:58 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.1.1-14.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:39:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description weizhang 2013-11-11 03:31:08 UTC
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:

Comment 1 Daniel Berrangé 2013-12-02 16:58:47 UTC
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

Comment 4 Jincheng Miao 2013-12-09 09:23:26 UTC
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.

Comment 5 Ludek Smid 2014-06-13 11:39:19 UTC
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.


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