Bug 1207122

Summary: Wrong speed show from blockjob while set bandwidth to 1 when do blockcopy
Product: Red Hat Enterprise Linux 7 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: dyuan, lhuang, mzhan, rbalakri
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.14-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:26:20 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:

Description Shanzhi Yu 2015-03-30 09:43:22 UTC
Description of problem:

Wrong speed show from blockjob while set bandwidth to 1 when do blockcopy

Version-Release number of selected component (if applicable):

libvirt-1.2.13-1.el7.x86_64

How reproducible:

100%

Steps to Reproduce:
1.Prepare a transient guest
# virsh list --transient
Id Name State
----------------------------------------------------
19 vm running

2. Do blockcopy with bandwidth 1
# virsh blockcopy vm vda /mnt/vm.copy --verbose --wait --bandwidth 1
Block Copy: [100 %]
Now in mirroring phase

3. Check job info

# virsh blockjob vm vda
Block Copy: [100 %] Bandwidth limit: 1 bytes/s (1.000 B/s)

Actual results:

as show above

Expected results:

Bandwidth limit should be like:

Bandwidth limit: 1048576 bytes/s (1.000 MiB/s)

Additional info: 

blockcommit/blockpull with --bandwidth 1 work well, blockjob with --bandwidth 1 also work sell.

Comment 1 Peter Krempa 2015-03-30 18:03:06 UTC
Fixed upstream:

commit 3c6a72d5376732efd8effb4a0a419211c0eb0659
Author: Peter Krempa <pkrempa>
Date:   Mon Mar 30 17:34:13 2015 +0200

    qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase
    
    The block copy API takes the speed in bytes/s rather than MiB/s that was
    the prior approach in virDomainBlockRebase. We correctly converted the
    speed to bytes/s in the old API but we still called the common helper
    virDomainBlockCopyCommon with the unadjusted variable.

v1.2.14-rc1-14-g3c6a72d

Comment 3 Shanzhi Yu 2015-06-15 11:13:36 UTC
Verify this bug with libvirt-1.2.16-1.el7.x86_64

1. prepare transient guest 
# virsh list --transient
 Id    Name                           State
----------------------------------------------------
 11    r7                             running


2. Do block copy with bandwidth equal 1 

# virsh blockcopy r7 vda /var/lib/libvirt/images/r7.copy --verbose --wait 1 
Block Copy: [ 98 %]

3. Open another terminal, check the blockjob info 
# virsh blockjob r7 vda 
Block Copy: [  1 %]    Bandwidth limit: 1048576 bytes/s (1.000 MiB/s)

So, verify this bug

Comment 5 errata-xmlrpc 2015-11-19 06:26:20 UTC
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/RHBA-2015-2202.html