Commit 6f9c5ee782e983f00e81a7cbd98900bdac9b3e6c

Authored by aurel32
1 parent f54825cc

new monitor func status

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.

(Philipp Wehrheim)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6094 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 11 additions and 0 deletions
monitor.c
@@ -1401,6 +1401,15 @@ static void do_inject_nmi(int cpu_index) @@ -1401,6 +1401,15 @@ static void do_inject_nmi(int cpu_index)
1401 } 1401 }
1402 #endif 1402 #endif
1403 1403
  1404 +static void do_info_status(void)
  1405 +{
  1406 + if (vm_running)
  1407 + term_printf("VM status: running\n");
  1408 + else
  1409 + term_printf("VM status: paused\n");
  1410 +}
  1411 +
  1412 +
1404 static void do_balloon(int value) 1413 static void do_balloon(int value)
1405 { 1414 {
1406 ram_addr_t target = value; 1415 ram_addr_t target = value;
@@ -1557,6 +1566,8 @@ static const term_cmd_t info_cmds[] = { @@ -1557,6 +1566,8 @@ static const term_cmd_t info_cmds[] = {
1557 "", "show capture information" }, 1566 "", "show capture information" },
1558 { "snapshots", "", do_info_snapshots, 1567 { "snapshots", "", do_info_snapshots,
1559 "", "show the currently saved VM snapshots" }, 1568 "", "show the currently saved VM snapshots" },
  1569 + { "status", "", do_info_status,
  1570 + "", "show the current VM status (running|paused)" },
1560 { "pcmcia", "", pcmcia_info, 1571 { "pcmcia", "", pcmcia_info,
1561 "", "show guest PCMCIA status" }, 1572 "", "show guest PCMCIA status" },
1562 { "mice", "", do_info_mice, 1573 { "mice", "", do_info_mice,