Skip to contentSkip to conversation

new monitor func status

PATCH Applied Philipp Wehrheim 2 participants 2 messages Dec 16, 2008 – Dec 18, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 new monitor func status

Hey,

attached is a small patch that adds the new info subcommand - status.

The status indicates if the VM is running or paused this info makes life for (stateless) Qemu/KVM frontends easier.
Since the info is just there why not make it available?

Please consider applying.
flip

--

qemu/monitor.c +11 -0
index 3948aae..ee8476b 100644
@@ -1418,6 +1418,15 @@ static void do_inject_nmi(int cpu_index)
 }
 #endif
 
+static void do_info_status(void)
+{
+    if (vm_running)
+       term_printf("VM status: running\n");
+    else
+       term_printf("VM status: paused\n");
+}
+
+
 static void do_balloon(int value)
 {
     ram_addr_t target = value;
@@ -1582,6 +1591,8 @@ static const term_cmd_t info_cmds[] = {
       "", "show capture information" },
     { "snapshots", "", do_info_snapshots,
       "", "show the currently saved VM snapshots" },
+    { "status", "", do_info_status,
+      "", "show the current VM status (running|paused)" },
     { "pcmcia", "", pcmcia_info,
       "", "show guest PCMCIA status" },
     { "mice", "", do_info_mice,
#1 lore raw
Quoted 9 lines · Philipp Wehrheim

Hey,

attached is a small patch that adds the new info subcommand - status.

The status indicates if the VM is running or paused this info makes life for (stateless) Qemu/KVM frontends easier.
Since the info is just there why not make it available?

Please consider applying.

Thanks, applied.

Quoted 41 lines

--

qemu/monitor.c +11 -1
index 3948aae..ee8476b 100644
@@ -1418,6 +1418,15 @@ static void do_inject_nmi(int cpu_index)
 }
 #endif
 
+static void do_info_status(void)
+{
+    if (vm_running)
+       term_printf("VM status: running\n");
+    else
+       term_printf("VM status: paused\n");
+}
+
+
 static void do_balloon(int value)
 {
     ram_addr_t target = value;
@@ -1582,6 +1591,8 @@ static const term_cmd_t info_cmds[] = {
       "", "show capture information" },
     { "snapshots", "", do_info_snapshots,
       "", "show the currently saved VM snapshots" },
+    { "status", "", do_info_status,
+      "", "show the current VM status (running|paused)" },
     { "pcmcia", "", pcmcia_info,
       "", "show guest PCMCIA status" },
     { "mice", "", do_info_mice,
 
--

To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net