]> xenbits.xensource.com Git - libvirt.git/commitdiff
vcpupin: add reset option to virsh vcpupin command
authorTaku Izumi <izumi.taku@jp.fujitsu.com>
Fri, 10 Jun 2011 06:39:38 +0000 (15:39 +0900)
committerWen Congyang <wency@cn.fujitsu.com>
Mon, 20 Jun 2011 10:14:54 +0000 (18:14 +0800)
When resetting vcpupin setting, we have to specify all host physical
cpus as a cpulist parameter of virsh vcpupin command. It's a little
tedious.

This patch changes to allow to receive the special keyword 'r' as a cpulist
parameter of virsh vcpupin command when resetting vcpupin setting.

If you set the following:

 # virsh vcpupin VM 0 r

the vcpu0 will be pinned to all physical cpus.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
tools/virsh.c
tools/virsh.pod

index 92faffc02c922278dafc1d54f8b1f311efba312d..e04c9fcae6a7e24ed825e583cf0533272f546c74 100644 (file)
@@ -3062,8 +3062,13 @@ cmdVcpupin(vshControl *ctl, const vshCmd *cmd)
 
     /* Parse cpulist */
     cur = cpulist;
-    if (*cur == 0)
+    if (*cur == 0) {
         goto parse_error;
+    } else if (*cur == 'r') {
+        for (cpu = 0; cpu < maxcpu; cpu++)
+            VIR_USE_CPU(cpumap, cpu);
+        *cur = 0;
+    }
 
     while (*cur != 0) {
 
index b90f37eab7eaa871e2ac19f9fa8b7099396560e3..e7dcd41d82e8fa17abab8b3355bec0dc99d75013 100644 (file)
@@ -836,6 +836,8 @@ Pin domain VCPUs to host physical CPUs. The I<vcpu> number must be provided
 and I<cpulist> is a list of physical CPU numbers. Its syntax is a comma
 separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can
 also be allowed. The '-' denotes the range and the '^' denotes exclusive.
+If you want to reset vcpupin setting, that is, to pin vcpu all physical cpus,
+simply specify 'r' as a cpulist.
 If I<--live> is specified, affect a running guest.
 If I<--config> is specified, affect the next boot of a persistent guest.
 If I<--current> is specified, affect the current guest state.