From patchwork Wed Sep 28 14:44:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 116828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E6181007D1 for ; Thu, 29 Sep 2011 01:42:13 +1000 (EST) Received: from localhost ([::1]:56590 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8wGw-0001TU-IH for incoming@patchwork.ozlabs.org; Wed, 28 Sep 2011 11:42:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8vOE-0003fw-Ol for qemu-devel@nongnu.org; Wed, 28 Sep 2011 10:45:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8vO1-000501-OJ for qemu-devel@nongnu.org; Wed, 28 Sep 2011 10:45:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8vO1-0004zr-Cj for qemu-devel@nongnu.org; Wed, 28 Sep 2011 10:45:25 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8SEjNLb015879 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Sep 2011 10:45:23 -0400 Received: from localhost (ovpn-113-147.phx2.redhat.com [10.3.113.147]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8SEjMf7012733; Wed, 28 Sep 2011 10:45:22 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 28 Sep 2011 11:44:44 -0300 Message-Id: <1317221085-5825-21-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1317221085-5825-1-git-send-email-lcapitulino@redhat.com> References: <1317221085-5825-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, aliguori@us.ibm.com, mdroth@linux.vnet.ibm.com, armbru@redhat.com Subject: [Qemu-devel] [PATCH 20/21] qapi: Convert system_reset 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 The original conversion was done by Anthony Liguori. This commit is just a rebase. Signed-off-by: Luiz Capitulino --- hmp-commands.hx | 3 +-- hmp.c | 5 +++++ hmp.h | 1 + monitor.c | 10 ---------- qapi-schema.json | 9 +++++++++ qmp-commands.hx | 5 +---- qmp.c | 4 ++++ 7 files changed, 21 insertions(+), 16 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 3ad1ce7..b2f5cd1 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -477,8 +477,7 @@ ETEXI .args_type = "", .params = "", .help = "reset the system", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_system_reset, + .mhandler.cmd = hmp_system_reset, }, STEXI diff --git a/hmp.c b/hmp.c index 871f858..d8b4de6 100644 --- a/hmp.c +++ b/hmp.c @@ -104,3 +104,8 @@ void hmp_stop(Monitor *mon, const QDict *qdict) { qmp_stop(NULL); } + +void hmp_system_reset(Monitor *mon, const QDict *qdict) +{ + qmp_system_reset(NULL); +} diff --git a/hmp.h b/hmp.h index cb21cce..a49a6e6 100644 --- a/hmp.h +++ b/hmp.h @@ -25,5 +25,6 @@ void hmp_info_uuid(Monitor *mon); void hmp_info_chardev(Monitor *mon); void hmp_quit(Monitor *mon, const QDict *qdict); void hmp_stop(Monitor *mon, const QDict *qdict); +void hmp_system_reset(Monitor *mon, const QDict *qdict); #endif diff --git a/monitor.c b/monitor.c index b4a58b1..de6a865 100644 --- a/monitor.c +++ b/monitor.c @@ -1929,16 +1929,6 @@ static void do_boot_set(Monitor *mon, const QDict *qdict) } /** - * do_system_reset(): Issue a machine reset - */ -static int do_system_reset(Monitor *mon, const QDict *qdict, - QObject **ret_data) -{ - qemu_system_reset_request(); - return 0; -} - -/** * do_system_powerdown(): Issue a machine powerdown */ static int do_system_powerdown(Monitor *mon, const QDict *qdict, diff --git a/qapi-schema.json b/qapi-schema.json index 830a508..e14f2f7 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -248,3 +248,12 @@ # state ## { 'command': 'stop' } + +## +# @system_reset: +# +# Performs a hard reset of a guest. +# +# Since: 0.14.0 +## +{ 'command': 'system_reset' } diff --git a/qmp-commands.hx b/qmp-commands.hx index 2ccddee..ea96191 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -223,10 +223,7 @@ EQMP { .name = "system_reset", .args_type = "", - .params = "", - .help = "reset the system", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_system_reset, + .mhandler.cmd_new = qmp_marshal_input_system_reset, }, SQMP diff --git a/qmp.c b/qmp.c index e17c8b2..6767640 100644 --- a/qmp.c +++ b/qmp.c @@ -81,3 +81,7 @@ void qmp_stop(Error **errp) vm_stop(RSTATE_PAUSED); } +void qmp_system_reset(Error **errp) +{ + qemu_system_reset_request(); +}