qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paulo Ricardo Paz Vital <paulo.vital@profitbricks.com>
To: Eric Blake <eblake@redhat.com>
Cc: Erik Rull <erik.rull@rdsoftware.de>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Getting VM state from outside QEMU?
Date: Thu, 09 Apr 2015 09:33:10 +0200	[thread overview]
Message-ID: <1428564790.14213.2.camel@profitbricks.com> (raw)
In-Reply-To: <5525546E.5020109@redhat.com>

Sorry guys only checked the emails this morning :-D

On Wed, 2015-04-08 at 10:16 -0600, Eric Blake wrote:
> On 04/08/2015 10:10 AM, Erik Rull wrote:
> >>
> >> 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": []}}
> 
> You HAVE to use {"execute":"qmp_capabilities"} (possibly with an
> "id":...) as your first command on the monitor, before you can issue any
> other command.  I really wish we could improve the error message:
> 
> > 
> > { "execute": "query-status" }
> > {"error": {"class": "CommandNotFound", "desc": "The command query-status has not
> > been found"}}
> 
> it would be a LOT nicer if we reported 'still in negotiation phase;
> "qmp_capabilities" expected' than a bland "CommandNotFound".  Of course,
> patches are welcome to improve the experience there!

That's an interesting point to see. I'm going to take a look on this and
submit a patch until next week, probably good to 2.4 release.

> 
> Similarly, once you are NOT in capabilities negotiation, any subsequent
> use of "qmp_capabilities" fails.  That's also something where the error
> message could be improved.
> 

-- 
Paulo Ricardo Paz Vital <paulo.vital@profitbricks.com>
ProfitBricks GmbH

  parent reply	other threads:[~2015-04-09  7:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 13:31 [Qemu-devel] Getting VM state from outside QEMU? Erik Rull
2015-04-07 13:42 ` Paulo Ricardo Paz Vital
2015-04-08 16:10   ` Erik Rull
2015-04-08 16:16     ` Eric Blake
2015-04-08 16:21       ` Erik Rull
2015-04-08 16:34         ` Eric Blake
2015-04-09  7:33       ` Paulo Ricardo Paz Vital [this message]
2015-04-07 18:16 ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428564790.14213.2.camel@profitbricks.com \
    --to=paulo.vital@profitbricks.com \
    --cc=eblake@redhat.com \
    --cc=erik.rull@rdsoftware.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).