From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Luiz Capitulino 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> Subject: [Qemu-devel] [PATCH 2/8] QMP: query-status: Introduce 'status' key List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, jan.kiszka@siemens.com, armbru@redhat.com, stefanha@gmail.com, jdenemar@redhat.com 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 -- 1.7.6.131.g99019