From patchwork Wed Oct 5 13:22:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 117846 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 D1D99B6F99 for ; Thu, 6 Oct 2011 01:04:24 +1100 (EST) Received: from localhost ([::1]:34152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBS56-0005uE-5O for incoming@patchwork.ozlabs.org; Wed, 05 Oct 2011 10:04:20 -0400 Received: from eggs.gnu.org ([140.186.70.92]:52140) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRRC-0004yh-7M for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBRR4-0002AP-R0 for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:23:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBRR4-0002A0-Br for qemu-devel@nongnu.org; Wed, 05 Oct 2011 09:22:58 -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 p95DMvw7012109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Oct 2011 09:22:57 -0400 Received: from localhost (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p95DMuSB000806; Wed, 5 Oct 2011 09:22:57 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Wed, 5 Oct 2011 10:22:09 -0300 Message-Id: <1317820931-25872-25-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.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: qemu-devel@nongnu.org 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 6e13ef6..2a5230c 100644 --- a/monitor.c +++ b/monitor.c @@ -1212,15 +1212,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); +} +