]> xenbits.xensource.com Git - libvirt.git/commit
virsh: Add a helper to parse cpulist
authorOsier Yang <jyang@redhat.com>
Thu, 28 Mar 2013 11:36:30 +0000 (19:36 +0800)
committerOsier Yang <jyang@redhat.com>
Tue, 2 Apr 2013 04:37:24 +0000 (12:37 +0800)
commit8893df388edbc661603e0d886b27b39a4a7864d0
tree27a23bde63a79fa9797980a0dab1846bfab600fb
parent9a80050e523da636a11d32d507ede11af764b9e0
virsh: Add a helper to parse cpulist

The 'virsh vcpupin' and 'virsh emulatorpin' commands use the same
code to parse the cpulist. This patch abstracts the same code as
a helper. Along with various code style fixes, and error improvement
(only error "Physical CPU %d doesn't exist" if the specified CPU
exceed the range, no "cpulist: Invalid format", see the following
for an example of the error prior to this patch).

% virsh vcpupin 4 0 0-8
error: Physical CPU 4 doesn't exist.
error: cpulist: Invalid format.
tools/virsh-domain.c