From patchwork Wed Oct 5 13:22:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 117843 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 3E094B6F9B for ; Thu, 6 Oct 2011 00:49:05 +1100 (EST) Received: from localhost ([::1]:52410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRqI-0002Tc-Ir for incoming@patchwork.ozlabs.org; Wed, 05 Oct 2011 09:49:02 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52086) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRR8-0004w4-2g for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:23:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBRR6-0002Ax-Hl for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:23:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRR6-0002Aj-87 for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:23:00 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p95DMxlO031004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Oct 2011 09:22:59 -0400 Received: from localhost (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p95DMwkh004558; Wed, 5 Oct 2011 09:22:58 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Wed, 5 Oct 2011 10:22:10 -0300 Message-Id: <1317820931-25872-26-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1317820931-25872-1-git-send-email-lcapitulino@redhat.com> References: <1317820931-25872-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 25/26] 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 Signed-off-by: Anthony Liguori 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 efcb744..24f30bc 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 2a5230c..c226879 100644 --- a/monitor.c +++ b/monitor.c @@ -1930,16 +1930,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 cd05034..02de4b5 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 6c46479..51d9383 100644 --- a/qmp.c +++ b/qmp.c @@ -81,3 +81,7 @@ void qmp_stop(Error **errp) vm_stop(RUN_STATE_PAUSED); } +void qmp_system_reset(Error **errp) +{ + qemu_system_reset_request(); +}