Bug 1328675

Summary: virsh: blockpull: bad error on arg overflow: argument key 'speed' must not be negative
Product: [Community] Virtualization Tools Reporter: Fangge Jin <fjin>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: NEW --- QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: crobinso, dyuan, mzhan, pkrempa, yafu, zpeng
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Fangge Jin 2016-04-20 03:14:49 UTC
Description of problem:
When use 9223372036854775808( the_maximum_of_long_long + 1) for blockjob bandwidth, libvirt reports "argument key 'speed' must not be negative".

Version-Release number of selected component:
libvirt-1.3.3-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
virsh # start rhel7.2-1030
Domain rhel7.2-1030 started

virsh # snapshot-create rhel7.2-1030 --disk-only
Domain snapshot 1461044800 created

virsh # blockpull rhel7.2-1030 /var/lib/libvirt/images/rhel6.6-GUI.1461044800 --bytes 9223372036854775808
error: internal error: argument key 'speed' must not be negative

virsh # blockpull rhel7.2-1030 /var/lib/libvirt/images/rhel6.6-GUI.1461044800 --bytes 9223372036854775807
Block Pull started


Actual results:
When use 9223372036854775808( the maximum of long long + 1) for blockjob bandwidth, libvirt reports "argument key 'speed' must not be negative".

Expected results:
Libvirt reports error like this:
error: numerical overflow: 'speed' must be less than 9223372036854775807


Additional info:
Same issue exists with blockcommit/blockcopy/blockjob