From: Jason J. Herne Date: Wed, 11 Dec 2013 18:24:14 +0000 (-0500) Subject: qemu-monitor: HMP cpu-add wrapper X-Git-Tag: v2.0.0-rc0~153^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abf233294bc8a4d2c7d5f428f1408d7bdd0c02e0;p=thirdparty%2Fqemu.git qemu-monitor: HMP cpu-add wrapper Add HMP cpu-add wrapper to allow cpu hot plugging via monitor. Signed-off-by: Jason J. Herne Reviewed-by: Igor Mammedov Signed-off-by: Luiz Capitulino --- diff --git a/hmp-commands.hx b/hmp-commands.hx index ebe8e78bb99..929550d66b9 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1617,6 +1617,19 @@ STEXI Executes a qemu-io command on the given block device. +ETEXI + + { + .name = "cpu-add", + .args_type = "id:i", + .params = "id", + .help = "add cpu", + .mhandler.cmd = hmp_cpu_add, + }, + +STEXI +@item cpu-add @var{id} +Add CPU with id @var{id} ETEXI { diff --git a/hmp.c b/hmp.c index 32ee285a1e2..c513f9b6850 100644 --- a/hmp.c +++ b/hmp.c @@ -1525,6 +1525,16 @@ void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict) hmp_handle_error(mon, &errp); } +void hmp_cpu_add(Monitor *mon, const QDict *qdict) +{ + int cpuid; + Error *err = NULL; + + cpuid = qdict_get_int(qdict, "id"); + qmp_cpu_add(cpuid, &err); + hmp_handle_error(mon, &err); +} + void hmp_chardev_add(Monitor *mon, const QDict *qdict) { const char *args = qdict_get_str(qdict, "args"); diff --git a/hmp.h b/hmp.h index 54cf71fb949..f92fc8922dc 100644 --- a/hmp.h +++ b/hmp.h @@ -89,5 +89,6 @@ void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict); void hmp_chardev_add(Monitor *mon, const QDict *qdict); void hmp_chardev_remove(Monitor *mon, const QDict *qdict); void hmp_qemu_io(Monitor *mon, const QDict *qdict); +void hmp_cpu_add(Monitor *mon, const QDict *qdict); #endif