예제 #1
0
static void vcpu_hotplug(unsigned int cpu)
{
	int err;
	char dir[32], state[32];

	if (!cpu_possible(cpu))
		return;

	sprintf(dir, "cpu/%u", cpu);
	err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
	if (err != 1) {
		printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
		return;
	}

	if (strcmp(state, "online") == 0) {
		enable_hotplug_cpu(cpu);
	} else if (strcmp(state, "offline") == 0) {
		(void)cpu_down(cpu);
		disable_hotplug_cpu(cpu);
	} else {
		printk(KERN_ERR "XENBUS: unknown state(%s) on CPU%d\n",
		       state, cpu);
	}
}
예제 #2
0
static void vcpu_hotplug(unsigned int cpu)
{
	if (cpu >= nr_cpu_ids || !cpu_possible(cpu))
		return;

	switch (vcpu_online(cpu)) {
	case 1:
		enable_hotplug_cpu(cpu);
		break;
	case 0:
		disable_hotplug_cpu(cpu);
		break;
	default:
		break;
	}
}
static void vcpu_hotplug(unsigned int cpu)
{
	if (!cpu_possible(cpu))
		return;

	switch (vcpu_online(cpu)) {
	case 1:
		enable_hotplug_cpu(cpu);
		break;
	case 0:
		(void)cpu_down(cpu);
		disable_hotplug_cpu(cpu);
		break;
	default:
		break;
	}
}