qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Jes.Sorensen@redhat.com, aliguori@us.ibm.com,
	clalance@redhat.com, qemu-devel@nongnu.org, crobinso@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number.
Date: Fri, 14 May 2010 14:34:33 +0100	[thread overview]
Message-ID: <20100514133433.GI9282@redhat.com> (raw)
In-Reply-To: <m3ljbmhgjn.fsf@blackfin.pond.sub.org>

On Fri, May 14, 2010 at 01:24:44PM +0200, Markus Armbruster wrote:
> "Daniel P. Berrange" <berrange@redhat.com> writes:
> 
> > On Fri, May 14, 2010 at 11:42:57AM +0200, Markus Armbruster wrote:
> >> "Daniel P. Berrange" <berrange@redhat.com> writes:
> [...]
> >> > It would also be nice to avoid having to parse the -help output to determine
> >> > ARGV supported too. I wonder if it would be a good idea to just produce a
> >> > well structured equivalent to -help that provides the same data, but in 
> >> > JSON format for sane parsing. That would let peple easily determine the
> >> > supported ARGV as well as version number(s)
> >> 
> >> I'm all for machine-readable self-documentation.  And the place for that
> >> is QMP.  Humble beginnings are already there:
> >> 
> >> { "execute": "query-version", "arguments": { } }
> >> --> {"return": {"qemu": "0.12.50", "package": ""}}
> >> 
> >> { "execute": "query-commands", "arguments": { } }
> >> --> {"return": [{"name": "quit"}, {"name": "eject"}, [...]
> >> 
> >> Any practical problems with use of QMP instead of parsing command line
> >> option output?
> >
> > It is unneccessarily complex for such a simple task, requiring you to 
> > configure & connect to the monitor & do the capabilities negotiaton
> > and then issue the command. 
> >
> > To just query the version requires this ridiculous interaction:
> >
> >   $ qemu -chardev stdio,id=monitor -monitor chardev=monitor,mode=control
> >   {"execute":"qmp_capabilities"}
> >   {"QMP": {"version": {"qemu": "0.12.1", "package": " (qemu-kvm-0.12.1.2)"}, "capabilities": []}}
> >   {"execute":"query-version"}
> >   {"return": {"qemu": "0.12.50", "package": ""}}
> 
> Actually,
> 
> $ qemu -nodefaults -nographic -S -chardev stdio,id=qmp -mon mode=control,chardev=qmp </dev/null
> {"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
> 
> suffices, with the minor wart that you have to SIGINT out.

Only in this particular example. The same pain I illustrate still exists
for other static query actions such as query-device, or a hypothetical 
query-argv for getting supported command line args. I really think we need
to map these into the more concise & easily accessible style:

> > eg, make this work:
> >
> >   $ qemu -query-version
> >   {"qemu": "0.12.50", "package": ""}
> 
> I wouldn't mind.

Regards,
Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

  reply	other threads:[~2010-05-14 13:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13  8:32 [Qemu-devel] [PATCH] Add -version-simple argument to QEMU Jes.Sorensen
2010-05-13  8:32 ` [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number Jes.Sorensen
2010-05-13 13:33   ` Daniel P. Berrange
2010-05-13 13:41     ` Jes Sorensen
2010-05-13 19:30     ` Blue Swirl
2010-05-14  9:42     ` Markus Armbruster
2010-05-14 10:06       ` Daniel P. Berrange
2010-05-14 11:24         ` Markus Armbruster
2010-05-14 13:34           ` Daniel P. Berrange [this message]
2010-05-14 13:48         ` Anthony Liguori
2010-05-14 13:57           ` Daniel P. Berrange
2010-05-14 13:27     ` Anthony Liguori
2010-05-14 13:32       ` Daniel P. Berrange
2010-05-14 14:25       ` Markus Armbruster
2010-05-14 13:21   ` [Qemu-devel] " Anthony Liguori
2010-05-14 13:58     ` Chris Lalancette
2010-05-14 14:06     ` Daniel P. Berrange
2010-05-17  6:54     ` Jes Sorensen

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=20100514133433.GI9282@redhat.com \
    --to=berrange@redhat.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=clalance@redhat.com \
    --cc=crobinso@redhat.com \
    --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).