From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47557 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwPAY-0007Wv-6I for qemu-devel@nongnu.org; Sun, 06 Mar 2011 20:23:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwPAW-0000QK-Ri for qemu-devel@nongnu.org; Sun, 06 Mar 2011 20:23:29 -0500 Received: from e3.ny.us.ibm.com ([32.97.182.143]:39777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwPAW-0000QE-PM for qemu-devel@nongnu.org; Sun, 06 Mar 2011 20:23:28 -0500 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e3.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2713JIg029157 for ; Sun, 6 Mar 2011 20:03:19 -0500 Received: from d01relay06.pok.ibm.com (d01relay06.pok.ibm.com [9.56.227.116]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 66D3338C8038 for ; Sun, 6 Mar 2011 20:23:26 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay06.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p271NR6f2666682 for ; Sun, 6 Mar 2011 20:23:27 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p271NQJe021159 for ; Sun, 6 Mar 2011 20:23:26 -0500 From: Anthony Liguori Date: Sun, 6 Mar 2011 19:22:59 -0600 Message-Id: <1299460984-15849-18-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> References: <1299460984-15849-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 17/22] qapi: add QMP quit command List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Adam Litke , Anthony Liguori , Markus Armbruster , Luiz Capitulino This is needed by the test suite. Signed-off-by: Anthony Liguori diff --git a/qmp-schema.json b/qmp-schema.json index b343f5e..0581e67 100644 --- a/qmp-schema.json +++ b/qmp-schema.json @@ -36,3 +36,15 @@ # Since: 0.14.0 ## [ 'query-version', {}, {}, 'VersionInfo' ] + +## +# @quit: +# +# This command will cause the QEMU process to exit gracefully. While every +# attempt is made to send the QMP response before terminating, this is not +# guaranteed. When using this interface, a premature EOF would not be +# unexpected. +# +# Since: 0.14.0 +## +[ 'quit', {}, {}, 'none' ] diff --git a/qmp.c b/qmp.c index 7b626f5..837ac95 100644 --- a/qmp.c +++ b/qmp.c @@ -12,6 +12,7 @@ #include "qemu-common.h" #include "qmp-core.h" #include "qmp.h" +#include "sysemu.h" VersionInfo *qmp_query_version(Error **err) { @@ -29,3 +30,8 @@ VersionInfo *qmp_query_version(Error **err) return info; } +void qmp_quit(Error **err) +{ + no_shutdown = 0; + qemu_system_shutdown_request(); +} -- 1.7.0.4