From patchwork Mon Jan 6 22:03:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 307454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 513212C00CF for ; Tue, 7 Jan 2014 09:04:15 +1100 (EST) Received: from localhost ([::1]:37777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0IHM-0008Qe-Qk for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2014 17:04:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0IGf-0008O4-2r for qemu-devel@nongnu.org; Mon, 06 Jan 2014 17:03:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0IGY-0000wV-IX for qemu-devel@nongnu.org; Mon, 06 Jan 2014 17:03:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0IGY-0000wJ-A7 for qemu-devel@nongnu.org; Mon, 06 Jan 2014 17:03:22 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s06M3Kr4020172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jan 2014 17:03:20 -0500 Received: from localhost (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s06M3JaK027133; Mon, 6 Jan 2014 17:03:20 -0500 From: Luiz Capitulino To: anthony@codemonkey.ws Date: Mon, 6 Jan 2014 17:03:03 -0500 Message-Id: <1389045795-18706-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1389045795-18706-1-git-send-email-lcapitulino@redhat.com> References: <1389045795-18706-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 02/14] qemu-monitor: HMP cpu-add wrapper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 ebe8e78..929550d 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1620,6 +1620,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 32ee285..c513f9b 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 54cf71f..f92fc89 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