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 927156 - bandwidth limit for block copy/pull will fail if the value reach to 17592186044415
Summary: bandwidth limit for block copy/pull will fail if the value reach to 175921860...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 927160
TreeView+ depends on / blocked
 
Reported: 2013-03-25 09:01 UTC by yanbing du
Modified: 2014-06-18 00:46 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.0.5-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 927160 (view as bug list)
Environment:
Last Closed: 2014-06-13 11:55:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yanbing du 2013-03-25 09:01:38 UTC
Description of problem:
The limitation of copying bandwidth is 17592186044415, but when set the bandwidth value reach to 17592186044415, it will fail. And it bug affect blockcopy, blockpull and blockjob commands.

In libvirtd.log, it shows that after convert bandwidth MiB to bytes, the speed value is "-1048576".

2013-03-25 07:06:06.959+0000: 18195: debug : qemuMonitorDriveMirror:2890 : mon=0x7fab40000d00, device=drive-virtio-disk0, file=/dev/mapper/VG_test-lv_test1, format=qcow2, bandwidth=17592186044415, flags=0
...

2013-03-25 07:06:06.959+0000: 18195: debug : virJSONValueToString:1102 : result={"execute":"drive-mirror","arguments":{"device":"drive-virtio-disk0","target":"/dev/mapper/VG_test-lv_test1","speed":-1048576,"sync":"full","mode":"absolute-paths","format":"qcow2"},"id":"libvirt-7"}


Version-Release number of selected component (if applicable):
libvirt-1.0.3-1.el7.x86_64 

How reproducible:
100%

Steps to Reproduce:
1. Create a domain:
#virsh create vm1.xml
Domain vm1 created from vm1.xml


2. Do block copy for vda
#  # virsh blockcopy vm1 vda /dev/mapper/VG_test-lv_test1 --wait --verbose --finish --bandwidth 11111111111111111
error: numerical overflow: bandwidth must be less than 17592186044415

# virsh blockcopy vm1 vda /dev/mapper/VG_test-lv_test1 --wait --verbose --finish --bandwidth 17592186044415
error: internal error unable to execute QEMU command 'drive-mirror': Invalid parameter 'speed'

# virsh blockcopy vm1 vda /dev/mapper/VG_test-lv_test1 --wait --verbose --finish --bandwidth 17592186044411
error: internal error unable to execute QEMU command 'drive-mirror': Invalid parameter 'speed'

For blockjob,

# virsh blockjob vm1 vda --bandwidth 175921860444111
error: numerical overflow: bandwidth must be less than 17592186044415

# virsh blockjob vm1 vda --bandwidth 17592186044415
error: internal error Unexpected error

# virsh blockjob vm1 vda --bandwidth 17592186044414
error: internal error Unexpected error

  
Actual results:
bandwidth limit for block copy/pull will fail if the value reach to 17592186044415 

Expected results:
Fix this bug. 

Additional info:

Comment 2 yanbing du 2013-03-26 03:25:32 UTC
BTW, the value check also need improve(decimal, negative number):
# virsh blockcopy vm1 /var/lib/libvirt/images/vm2.img /tmp/tsrt --bandwidth 0.1 --wait --verbose
error: bandwidth must be a number

# virsh blockcopy vm1 /var/lib/libvirt/images/vm2.img /tmp/tsrt --bandwidth -1 --wait --verbose
error: numerical overflow: bandwidth must be less than 17592186044415

Comment 3 Luwen Su 2013-03-26 08:16:32 UTC
I'm not sure if this is properly 

# virsh blockcopy test1 vda /var/lib/libvirt/images/bak9 1 --wait  --bandwidth 
error: option --bandwidth already seen

Comment 4 Eric Blake 2013-03-26 14:04:11 UTC
(In reply to comment #3)
> I'm not sure if this is properly 
> 
> # virsh blockcopy test1 vda /var/lib/libvirt/images/bak9 1 --wait 
> --bandwidth 
> error: option --bandwidth already seen

This particular error is correct.  Virsh assigns arguments in order to the first option that has not yet been seen, so you wrote the equivalent of:

virsh blockcopy --domain=test1 --path=vda --dest=/var/lib/libvirt/images/bak9 --bandwidth=1 --wait --bandwidth

which means you did indeed supply --bandwidth twice.

Comment 5 Peter Krempa 2013-04-03 14:39:07 UTC
Fixed upstream with:

commit 24ca8fae64d6088cb10a424c4bc6a7eb16ddeb26
Author: Peter Krempa <pkrempa>
Date:   Wed Apr 3 10:36:03 2013 +0200

    qemu-blockjob: Fix limit of bandwidth for block jobs to supported value
    
    The JSON generator is able to represent only values less than LLONG_MAX, fix the
    bandwidth limit checks when converting to value to catch overflows before they
    reach the generator.

v1.0.4-26-g24ca8fa

Moving to POST

Comment 6 Huang Wenlong 2013-05-06 08:58:58 UTC
Verify this bug with :
libvirt-1.0.5-1.el7.x86_64

blockcopy

[root@ibm-x3650m3-06 ~]# virsh blockcopy r6 vda /tmp/blk-copy --wait --verbose --finish --bandwidth 17592186044415
error: numerical overflow: bandwidth must be less than 8796093022207

[root@ibm-x3650m3-06 ~]# virsh blockcopy r6 vda /tmp/blk-copy --wait --verbose --finish --bandwidth 8796093022207
Block Copy: [100 %]
Successfully copied
[root@ibm-x3650m3-06 ~]# 

blockjob

# virsh blockjob r6 vda --bandwidth 87960930222071
error: numerical overflow: bandwidth must be less than 8796093022207

[root@ibm-x3650m3-06 ~]# virsh blockjob r6 vda --bandwidth 8796093022207
[root@ibm-x3650m3-06 ~]#

Comment 7 Ludek Smid 2014-06-13 11:55:33 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.