Hello Paulo, > On April 7, 2015 at 3:42 PM Paulo Ricardo Paz Vital > <paulo.vi...@profitbricks.com> wrote: > > > 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" } } >
Sounds good - I tried that - but all attempts return that the command has not been found. I added the following command line snippet and the results are: [...] -qmp tcp:localhost:4444,server,nowait [...] 172.17.48.45 ~ # telnet 127.0.0.1 4444 {"QMP": {"version": {"qemu": {"micro": 0, "minor": 1, "major": 2}, "package": ""}, "capabilities": []}} { "execute": "query-status" } {"error": {"class": "CommandNotFound", "desc": "The command query-status has not been found"}} { "execute": "info status" } {"error": {"class": "CommandNotFound", "desc": "The command info status has not been found"}} { "execute": "info", "arguments": { "status": "" } } {"error": {"class": "CommandNotFound", "desc": "The command info has not been found"}} { "execute": "query-kvm" } {"error": {"class": "CommandNotFound", "desc": "The command query-kvm has not been found"}} Any ideas what's wrong here? Thanks. Best regards, Erik