From patchwork Tue Jul 5 18:17: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: 103371 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 08DC1B6F6C for ; Wed, 6 Jul 2011 05:18:17 +1000 (EST) Received: from localhost ([::1]:51488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeB8P-0007TY-D2 for incoming@patchwork.ozlabs.org; Tue, 05 Jul 2011 15:18:13 -0400 Received: from eggs.gnu.org ([140.186.70.92]:33752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeACQ-00008c-Cp for qemu-devel@nongnu.org; Tue, 05 Jul 2011 14:18:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeACO-00027s-Fe for qemu-devel@nongnu.org; Tue, 05 Jul 2011 14:18:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeACN-00027Z-O3 for qemu-devel@nongnu.org; Tue, 05 Jul 2011 14:18:16 -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 p65IIBZC016775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 5 Jul 2011 14:18:11 -0400 Received: from localhost (ovpn-113-99.phx2.redhat.com [10.3.113.99]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p65IIAKi011532; Tue, 5 Jul 2011 14:18:10 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Tue, 5 Jul 2011 15:17:45 -0300 Message-Id: <1309889871-6267-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1309889871-6267-1-git-send-email-lcapitulino@redhat.com> References: <1309889871-6267-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: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, jan.kiszka@siemens.com, armbru@redhat.com, stefanha@gmail.com, jdenemar@redhat.com Subject: [Qemu-devel] [PATCH 2/8] QMP: query-status: Introduce 'status' key 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 This new key reports the current VM status to clients. Please, check the documentation being added in this commit for more details. Signed-off-by: Luiz Capitulino --- monitor.c | 3 +-- qmp-commands.hx | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/monitor.c b/monitor.c index 1cb3191..00ebc8b 100644 --- a/monitor.c +++ b/monitor.c @@ -2584,8 +2584,7 @@ static void do_info_status_print(Monitor *mon, const QObject *data) static void do_info_status(Monitor *mon, QObject **ret_data) { - *ret_data = qobject_from_jsonf("{ 'running': %i, 'singlestep': %i }", - vm_running, singlestep); + *ret_data = qobject_from_jsonf("{ 'running': %i, 'singlestep': %i, 'status': %s }", vm_running, singlestep, vm_status_get_name()); } static qemu_acl *find_acl(Monitor *mon, const char *name) diff --git a/qmp-commands.hx b/qmp-commands.hx index 92c5c3a..6b8eb0a 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -1486,11 +1486,26 @@ Return a json-object with the following information: - "running": true if the VM is running, or false if it is paused (json-bool) - "singlestep": true if the VM is in single step mode, false otherwise (json-bool) +- "status": one of the following values (json-string) + "debug" - QEMU is running on a debugger + "inmigrate" - guest is paused waiting for an incoming migration + "postmigrate" - guest is paused following a successful 'migrate' + "internal-error" - An internal error that prevents further guest + execution has occurred + "load-state-error" - guest is paused following a failed 'loadvm' + "io-error" - the last IOP has failed and the device is configured + to pause on I/O errors + "watchdog-error" - the watchdog action is configured to pause and + "paused" - guest has been paused via the 'stop' command + "prelaunch" - QEMU was started with -S and guest has not started + "running" - guest is actively running + "shutdown" - guest is shut down (and -no-shutdown is in use) + has been triggered Example: -> { "execute": "query-status" } -<- { "return": { "running": true, "singlestep": false } } +<- { "return": { "running": true, "singlestep": false, "status": "running" } } EQMP