From patchwork Wed Sep 28 14:44:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 116824 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 530691007D1 for ; Thu, 29 Sep 2011 01:32:13 +1000 (EST) Received: from localhost ([::1]:45099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8w7C-0004uF-Hj for incoming@patchwork.ozlabs.org; Wed, 28 Sep 2011 11:32:06 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8w76-0004tV-Jt for qemu-devel@nongnu.org; Wed, 28 Sep 2011 11:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8w70-0006Gu-TR for qemu-devel@nongnu.org; Wed, 28 Sep 2011 11:32:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8w70-0006Gp-Gs for qemu-devel@nongnu.org; Wed, 28 Sep 2011 11:31:54 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8SFVqqh005684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Sep 2011 11:31:53 -0400 Received: from localhost (ovpn-113-147.phx2.redhat.com [10.3.113.147]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8SEjKVQ027652; Wed, 28 Sep 2011 10:45:21 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 28 Sep 2011 11:44:43 -0300 Message-Id: <1317221085-5825-20-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.25 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 19/21] qapi: Convert stop 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 | 9 --------- qapi-schema.json | 12 ++++++++++++ qmp-commands.hx | 5 +---- qmp.c | 5 +++++ 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 2163e6f..3ad1ce7 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -290,8 +290,7 @@ ETEXI .args_type = "", .params = "", .help = "stop emulation", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_stop, + .mhandler.cmd = hmp_stop, }, STEXI diff --git a/hmp.c b/hmp.c index 1f7000a..871f858 100644 --- a/hmp.c +++ b/hmp.c @@ -99,3 +99,8 @@ void hmp_quit(Monitor *mon, const QDict *qdict) monitor_suspend(mon); qmp_quit(NULL); } + +void hmp_stop(Monitor *mon, const QDict *qdict) +{ + qmp_stop(NULL); +} diff --git a/hmp.h b/hmp.h index a3dfafd..cb21cce 100644 --- a/hmp.h +++ b/hmp.h @@ -24,5 +24,6 @@ void hmp_info_status(Monitor *mon); 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); #endif diff --git a/monitor.c b/monitor.c index 42c754a..b4a58b1 100644 --- a/monitor.c +++ b/monitor.c @@ -1211,15 +1211,6 @@ static void do_singlestep(Monitor *mon, const QDict *qdict) } } -/** - * do_stop(): Stop VM execution - */ -static int do_stop(Monitor *mon, const QDict *qdict, QObject **ret_data) -{ - vm_stop(RSTATE_PAUSED); - return 0; -} - static void encrypted_bdrv_it(void *opaque, BlockDriverState *bs); struct bdrv_iterate_context { diff --git a/qapi-schema.json b/qapi-schema.json index d6a60d2..830a508 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -236,3 +236,15 @@ # Since: 0.14.0 ## { 'command': 'quit' } + +## +# @stop: +# +# Stop all guest VCPU execution. +# +# Since: 0.14.0 +# +# Notes: This function will succeed even if the guest is already in the stopped +# state +## +{ 'command': 'stop' } diff --git a/qmp-commands.hx b/qmp-commands.hx index 151a5fa..2ccddee 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -178,10 +178,7 @@ EQMP { .name = "stop", .args_type = "", - .params = "", - .help = "stop emulation", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_stop, + .mhandler.cmd_new = qmp_marshal_input_stop, }, SQMP diff --git a/qmp.c b/qmp.c index 1d380b6..e17c8b2 100644 --- a/qmp.c +++ b/qmp.c @@ -76,3 +76,8 @@ void qmp_quit(Error **err) qemu_system_shutdown_request(); } +void qmp_stop(Error **errp) +{ + vm_stop(RSTATE_PAUSED); +} +