Bug 1207122 - Wrong speed show from blockjob while set bandwidth to 1 when do blockcopy
Summary: Wrong speed show from blockjob while set bandwidth to 1 when do blockcopy
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2015-03-30 09:43 UTC by Shanzhi Yu
Modified: 2015-11-19 06:26 UTC (History)
4 users (show)

Fixed In Version: libvirt-1.2.14-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-11-19 06:26:20 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

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):


How reproducible:


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@redhat.com>
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.


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.


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