From patchwork Fri Sep 30 20:34:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 117231 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 38C6CB6F7F for ; Sat, 1 Oct 2011 07:59:36 +1000 (EST) Received: from localhost ([::1]:34814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9jpW-0002Ja-2v for incoming@patchwork.ozlabs.org; Fri, 30 Sep 2011 16:37:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9joF-0000B2-UF for qemu-devel@nongnu.org; Fri, 30 Sep 2011 16:35:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9jo5-0008Gg-7E for qemu-devel@nongnu.org; Fri, 30 Sep 2011 16:35:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9jo4-0008GI-NV for qemu-devel@nongnu.org; Fri, 30 Sep 2011 16:35:41 -0400 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 p8UKZafg008929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 Sep 2011 16:35:36 -0400 Received: from localhost (ovpn-113-111.phx2.redhat.com [10.3.113.111]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p8UKZZDn003799; Fri, 30 Sep 2011 16:35:35 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Fri, 30 Sep 2011 17:34:49 -0300 Message-Id: <1317414891-4042-25-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1317414891-4042-1-git-send-email-lcapitulino@redhat.com> References: <1317414891-4042-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 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 24/26] 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 Signed-off-by: Anthony Liguori 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 7695dfc..efcb744 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 e5baea1..e35756b 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(RUN_STATE_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 3810463..cd05034 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..6c46479 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(RUN_STATE_PAUSED); +} +