From mboxrd@z Thu Jan 1 00:00:00 1970 From: Philipp Wehrheim Subject: [PATCH] new monitor func status Date: Mon, 15 Dec 2008 09:36:06 +0100 Message-ID: <494616F6.8010407@gmx.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit To: kvm@vger.kernel.org Return-path: Received: from winker.dv.fh-frankfurt.de ([194.95.81.208]:33842 "EHLO winker.dv.fh-frankfurt.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055AbYLOIh1 (ORCPT ); Mon, 15 Dec 2008 03:37:27 -0500 Received: from [192.168.10.30] by winker.dv.fh-frankfurt.de with esmtp (Exim 4.69) (envelope-from ) id 1LC8xA-0003KH-I3 for kvm@vger.kernel.org; Mon, 15 Dec 2008 09:37:24 +0100 Sender: kvm-owner@vger.kernel.org List-ID: 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) KVM frontends easier. Since the info is available inside kvm why not make it available? Please consider applying. flip -- diff --git a/qemu/monitor.c b/qemu/monitor.c index 3948aae..ee8476b 100644 --- a/qemu/monitor.c +++ b/qemu/monitor.c @@ -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,