Received: from eggs.gnu.org ([2001:4830:134:3::10]:58611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKek-00072E-Vn for qemu-devel@nongnu.org; Wed, 18 Dec 2013 12:11:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtKeX-00046n-IC for qemu-devel@nongnu.org; Wed, 18 Dec 2013 12:11:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6526) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKeX-00046b-8z for qemu-devel@nongnu.org; Wed, 18 Dec 2013 12:11:21 -0500 From: Luiz Capitulino Date: Wed, 18 Dec 2013 12:00:03 -0500 Message-Id: <1387386003-8949-14-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1387386003-8949-1-git-send-email-lcapitulino@redhat.com> References: <1387386003-8949-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PULL 13/13] qemu-monitor: HMP cpu-add wrapper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: qemu-devel@nongnu.org From: "Jason J. Herne" 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 --- hmp-commands.hx | 13 +++++++++++++ hmp.c | 10 ++++++++++ hmp.h | 1 + 3 files changed, 24 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0ace14f..feca084 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1648,6 +1648,19 @@ 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 + + { .name = "info", .args_type = "item:s?", .params = "[subcommand]", diff --git a/hmp.c b/hmp.c index 9f4c9b3..e86c237 100644 --- a/hmp.c +++ b/hmp.c @@ -1583,6 +1583,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 94264d6..a91aed5 100644 --- a/hmp.h +++ b/hmp.h @@ -91,5 +91,6 @@ void hmp_chardev_remove(Monitor *mon, const QDict *qdict); void hmp_qemu_io(Monitor *mon, const QDict *qdict); void hmp_object_add(Monitor *mon, const QDict *qdict); void hmp_object_del(Monitor *mon, const QDict *qdict); +void hmp_cpu_add(Monitor *mon, const QDict *qdict); #endif -- 1.8.1.4