debuggers.hg

view tools/libxc/xc_cpu_hotplug.c @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents df6f9fe48f11
children 3ffdb094c2c0
line source
1 /******************************************************************************
2 * xc_cpu_hotplug.c - Libxc API for Xen Physical CPU hotplug Management
3 *
4 * Copyright (c) 2008, Shan Haitao <haitao.shan@intel.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 *
24 */
26 #include "xc_private.h"
28 int xc_cpu_online(int xc_handle, int cpu)
29 {
30 DECLARE_SYSCTL;
31 int ret;
33 sysctl.cmd = XEN_SYSCTL_cpu_hotplug;
34 sysctl.u.cpu_hotplug.cpu = cpu;
35 sysctl.u.cpu_hotplug.op = XEN_SYSCTL_CPU_HOTPLUG_ONLINE;
36 ret = xc_sysctl(xc_handle, &sysctl);
38 return ret;
39 }
41 int xc_cpu_offline(int xc_handle, int cpu)
42 {
43 DECLARE_SYSCTL;
44 int ret;
46 sysctl.cmd = XEN_SYSCTL_cpu_hotplug;
47 sysctl.u.cpu_hotplug.cpu = cpu;
48 sysctl.u.cpu_hotplug.op = XEN_SYSCTL_CPU_HOTPLUG_OFFLINE;
49 ret = xc_sysctl(xc_handle, &sysctl);
51 return ret;
52 }