]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
virsh: forbid negative vcpu argument to vcpupin
authorJincheng Miao <jmiao@redhat.com>
Thu, 29 May 2014 03:34:40 +0000 (11:34 +0800)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 12 Jun 2014 12:06:21 +0000 (14:06 +0200)
commite43041048073d5ee95c22b9a313f52a18ecec0d8
tree04336212f18ba94587d6ecdb10c38e0dc77db879
parentc62125395bbc494799f8994ce6d3cfbf96b30c72
virsh: forbid negative vcpu argument to vcpupin

The vcpupin command allowed specifying a negative number for the --vcpu
argument. This would the overflow when the underlying virDomainPinVcpu
API was called.

 $ virsh vcpupin r7 -1 0
 error: numerical overflow: input too large: 4294967295

Switch the vCPU variable to a unsigned int and parse it using the
corresponding function.

Also improve the vcpupin test to cover all the defects.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1101059

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
tests/vcpupin
tools/virsh-domain.c