From: Glauber Costa <[EMAIL PROTECTED]> in this patch, cpu_set is introduced to qemu monitor
semantics is : cpu_set x online|offline. it will then tell the acpi backend to signal cpu x. Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> diff --git a/qemu/hw/acpi.c b/qemu/hw/acpi.c index e21ded0..d2e2e3e 100644 --- a/qemu/hw/acpi.c +++ b/qemu/hw/acpi.c @@ -533,3 +533,7 @@ void qemu_system_powerdown(void) } } #endif + +void qemu_system_cpu_hot_add(int cpu, int state) +{ +} diff --git a/qemu/monitor.c b/qemu/monitor.c index e8022c8..09f84a9 100644 --- a/qemu/monitor.c +++ b/qemu/monitor.c @@ -345,6 +345,21 @@ static void do_cpu_set(int index) term_printf("Invalid CPU index\n"); } +static void do_cpu_set_nr(int value, const char *status) +{ + int state; + + if (!strcmp(status, "online")) + state = 1; + else if (!strcmp(status, "offline")) + state = 0; + else { + term_printf("invalid status: %s\n", status); + return; + } + qemu_system_cpu_hot_add(value, state); +} + static void do_info_jit(void) { dump_exec_info(NULL, monitor_fprintf); @@ -1338,6 +1353,7 @@ static term_cmd_t term_cmds[] = { "", "cancel the current VM migration" }, { "migrate_set_speed", "s", do_migrate_set_speed, "value", "set maximum speed (in bytes) for migrations" }, + { "cpu_set", "is", do_cpu_set_nr, "cpu [online|offline]", "change cpu state" }, { NULL, NULL, }, }; diff --git a/qemu/sysemu.h b/qemu/sysemu.h index 1599867..cdbffc0 100644 --- a/qemu/sysemu.h +++ b/qemu/sysemu.h @@ -154,6 +154,9 @@ int extboot_drive; extern int drive_get_index(BlockInterfaceType type, int bus, int unit); extern int drive_get_max_bus(BlockInterfaceType type); +/* acpi */ +void qemu_system_cpu_hot_add(int cpu, int state); + /* vmchannel devices */ #define MAX_VMCHANNEL_DEVICES 4 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ kvm-commits mailing list kvm-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-commits