From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfTlr-0003x4-U7 for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:42:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfTln-00043N-Vo for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:42:27 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:34402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfTln-000431-Q4 for qemu-devel@nongnu.org; Tue, 07 Apr 2015 09:42:23 -0400 Received: by widjs5 with SMTP id js5so11060769wid.1 for ; Tue, 07 Apr 2015 06:42:22 -0700 (PDT) Message-ID: <1428414139.25243.1.camel@profitbricks.com> From: Paulo Ricardo Paz Vital Date: Tue, 07 Apr 2015 15:42:19 +0200 In-Reply-To: <1746798507.1094444.1428413473548.JavaMail.open-xchange@oxbaltgw09.schlund.de> References: <1746798507.1094444.1428413473548.JavaMail.open-xchange@oxbaltgw09.schlund.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Getting VM state from outside QEMU? Reply-To: paulo.vital@profitbricks.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Erik Rull Cc: "qemu-devel@nongnu.org" On Tue, 2015-04-07 at 15:31 +0200, Erik Rull wrote: > Hi all, > > I need a pretty simple way to get the current state of the VM running in QEMU - > I only need the VM state (e.g. running, paused,...). Since my environment does > not have any perl, python or other high level scripting capabilities, a simple > way e.g. via a shell script would be nice. QEMU is running daemonized, so > interacting with the qemu console is not possible. > Are there any usable entries in /proc, /dev or /sys that could be used? > Hello Erik, My suggestion is to create a script that sends the QMP command "query-status" an then parse the result. The syntax and output is: -> { "execute": "query-status" } <- { "return": { "running": true, "singlestep": false, "status": "running" } } > Thanks. > > Best regards, > > Erik > -- Paulo Ricardo Paz Vital ProfitBricks GmbH