[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] HMP: info status: Print the VM state
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 8/8] HMP: info status: Print the VM state |
Date: |
Wed, 10 Aug 2011 17:33:28 -0300 |
Today our printf format for the "info status" command is:
VM status: %s
Where the string can be "running", "running (single step mode)" or
"paused".
This commit extends it to:
VM status: %s (%s)
The second string corresponds to the "status" field as returned
by the query-status QMP command and it's only printed if "status"
is not "running" or "paused". Example:
VM status: paused (shutdown)
PS: libvirt uses "info status" when using HMP, but the new format
should not break it.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/monitor.c b/monitor.c
index c9e65fa..c186d6b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2604,6 +2604,7 @@ static int do_inject_nmi(Monitor *mon, const QDict
*qdict, QObject **ret_data)
static void do_info_status_print(Monitor *mon, const QObject *data)
{
QDict *qdict;
+ const char *status;
qdict = qobject_to_qdict(data);
@@ -2617,6 +2618,11 @@ static void do_info_status_print(Monitor *mon, const
QObject *data)
monitor_printf(mon, "paused");
}
+ status = qdict_get_str(qdict, "status");
+ if (strcmp(status, "paused") && strcmp(status, "running")) {
+ monitor_printf(mon, " (%s)", status);
+ }
+
monitor_printf(mon, "\n");
}
--
1.7.6.433.g1421f
- [Qemu-devel] [PATCH 1/8] Move vm_state_notify() prototype from cpus.h to sysemu.h, (continued)
- [Qemu-devel] [PATCH 1/8] Move vm_state_notify() prototype from cpus.h to sysemu.h, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 2/8] Replace the VMSTOP macros with a proper state type, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 4/8] Drop the incoming_expected global variable, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 3/8] RunState: Add additional states, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 5/8] Drop the vm_running global variable, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 7/8] QMP: query-status: Introduce 'status' key, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 6/8] Monitor: Don't allow cont on bad VM state, Luiz Capitulino, 2011/08/10
- [Qemu-devel] [PATCH 8/8] HMP: info status: Print the VM state,
Luiz Capitulino <=
- Re: [Qemu-devel] [PATCH v2 0/8]: Introduce the RunState type, Anthony Liguori, 2011/08/14