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 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public 8 * License as published by the Free Software Foundation; 9 * version 2.1 of the License. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with this library; If not, see <http://www.gnu.org/licenses/>. 18 * 19 */ 20 21 #include "xc_private.h" 22 xc_cpu_online(xc_interface * xch,int cpu)23int xc_cpu_online(xc_interface *xch, int cpu) 24 { 25 DECLARE_SYSCTL; 26 int ret; 27 28 sysctl.cmd = XEN_SYSCTL_cpu_hotplug; 29 sysctl.u.cpu_hotplug.cpu = cpu; 30 sysctl.u.cpu_hotplug.op = XEN_SYSCTL_CPU_HOTPLUG_ONLINE; 31 ret = xc_sysctl(xch, &sysctl); 32 33 return ret; 34 } 35 xc_cpu_offline(xc_interface * xch,int cpu)36int xc_cpu_offline(xc_interface *xch, int cpu) 37 { 38 DECLARE_SYSCTL; 39 int ret; 40 41 sysctl.cmd = XEN_SYSCTL_cpu_hotplug; 42 sysctl.u.cpu_hotplug.cpu = cpu; 43 sysctl.u.cpu_hotplug.op = XEN_SYSCTL_CPU_HOTPLUG_OFFLINE; 44 ret = xc_sysctl(xch, &sysctl); 45 46 return ret; 47 } 48 49