From patchwork Wed Sep 28 14:44:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 116829 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 2495E1007D1 for ; Thu, 29 Sep 2011 01:45:13 +1000 (EST) Received: from localhost ([::1]:53114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8vPZ-0006e6-E8 for incoming@patchwork.ozlabs.org; Wed, 28 Sep 2011 10:47:01 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8vO4-0003PT-PM for qemu-devel@nongnu.org; Wed, 28 Sep 2011 10:45:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8vO2-00050F-He for qemu-devel@nongnu.org; Wed, 28 Sep 2011 10:45:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8vO2-000505-63 for qemu-devel@nongnu.org; Wed, 28 Sep 2011 10:45:26 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8SEjOTv004347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 28 Sep 2011 10:45:25 -0400 Received: from localhost (ovpn-113-147.phx2.redhat.com [10.3.113.147]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p8SEjNNb029208; Wed, 28 Sep 2011 10:45:24 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 28 Sep 2011 11:44:45 -0300 Message-Id: <1317221085-5825-22-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.67 on 10.5.11.12 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 21/21] qapi: Convert system_powerdown 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 + qapi-schema.json | 14 ++++++++++++++ qmp.c | 5 +++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index b2f5cd1..07b493c 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -492,8 +492,7 @@ ETEXI .args_type = "", .params = "", .help = "send system power down event", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_system_powerdown, + .mhandler.cmd = hmp_system_powerdown, }, STEXI diff --git a/hmp.c b/hmp.c index d8b4de6..13146a4 100644 --- a/hmp.c +++ b/hmp.c @@ -109,3 +109,8 @@ void hmp_system_reset(Monitor *mon, const QDict *qdict) { qmp_system_reset(NULL); } + +void hmp_system_powerdown(Monitor *mon, const QDict *qdict) +{ + qmp_system_powerdown(NULL); +} diff --git a/hmp.h b/hmp.h index a49a6e6..92433cf 100644 --- a/hmp.h +++ b/hmp.h @@ -26,5 +26,6 @@ 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); +void hmp_system_powerdown(Monitor *mon, const QDict *qdict); #endif diff --git a/qapi-schema.json b/qapi-schema.json index e14f2f7..413fcd5 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -257,3 +257,17 @@ # Since: 0.14.0 ## { 'command': 'system_reset' } + +## +# @system_powerdown: +# +# Requests that a guest perform a powerdown operation. +# +# Since: 0.14.0 +# +# Notes: A guest may or may not respond to this command. This command +# returning does not indicate that a guest has accepted the request or +# that it has shut down. Many guests will respond to this command by +# prompting the user in some way. +## +{ 'command': 'system_powerdown' } diff --git a/qmp.c b/qmp.c index 6767640..aa43207 100644 --- a/qmp.c +++ b/qmp.c @@ -85,3 +85,8 @@ void qmp_system_reset(Error **errp) { qemu_system_reset_request(); } + +void qmp_system_powerdown(Error **erp) +{ + qemu_system_powerdown_request(); +}