* [Qemu-devel] [PATCH] Add -version-simple argument to QEMU @ 2010-05-13 8:32 Jes.Sorensen 2010-05-13 8:32 ` [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number Jes.Sorensen 0 siblings, 1 reply; 18+ messages in thread From: Jes.Sorensen @ 2010-05-13 8:32 UTC (permalink / raw) To: qemu-devel, aliguori, crobinso, clalance; +Cc: Jes Sorensen From: Jes Sorensen <Jes.Sorensen@redhat.com> Hi, I ran into a problem with the version string in QEMU changing, confusing libvirt to not accept the output from qemu -help. Rather than trying to change QEMU or continue to adapt apps when this change, I believe it's a better solution to add a -version-simple argument that just spits out the version number and nothing more. Cheers, Jes Jes Sorensen (1): Add -version-simple argument, printing only version number. qemu-options.hx | 8 ++++++++ vl.c | 9 +++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) ^ permalink raw reply [flat|nested] 18+ messages in thread
* [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-13 8:32 [Qemu-devel] [PATCH] Add -version-simple argument to QEMU Jes.Sorensen @ 2010-05-13 8:32 ` Jes.Sorensen 2010-05-13 13:33 ` Daniel P. Berrange 2010-05-14 13:21 ` [Qemu-devel] " Anthony Liguori 0 siblings, 2 replies; 18+ messages in thread From: Jes.Sorensen @ 2010-05-13 8:32 UTC (permalink / raw) To: qemu-devel, aliguori, crobinso, clalance; +Cc: Jes Sorensen From: Jes Sorensen <Jes.Sorensen@redhat.com> Add -version-simple argument for QEMU, printing just the version number, without any supporting text. This makes it simpler for other apps, such as libvirt, to parse the version string from QEMU independant of how the naming string may change. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> --- qemu-options.hx | 8 ++++++++ vl.c | 9 +++++++++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 12f6b51..e4f3979 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -27,6 +27,14 @@ STEXI Display version information and exit ETEXI +DEF("version-simple", 0, QEMU_OPTION_version_simple, + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) +STEXI +@item -version-simple +@findex -version-simple +Display basic version number information and exit +ETEXI + DEF("M", HAS_ARG, QEMU_OPTION_M, "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) STEXI diff --git a/vl.c b/vl.c index 85bcc84..5adca87 100644 --- a/vl.c +++ b/vl.c @@ -2015,6 +2015,11 @@ static void version(void) printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); } +static void version_simple(void) +{ + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); +} + static void help(int exitcode) { const char *options_help = @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) version(); exit(0); break; + case QEMU_OPTION_version_simple: + version_simple(); + exit(0); + break; case QEMU_OPTION_m: { uint64_t value; char *ptr; -- 1.6.6.1 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 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 ` (3 more replies) 2010-05-14 13:21 ` [Qemu-devel] " Anthony Liguori 1 sibling, 4 replies; 18+ messages in thread From: Daniel P. Berrange @ 2010-05-13 13:33 UTC (permalink / raw) To: Jes.Sorensen; +Cc: aliguori, clalance, qemu-devel, crobinso On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: > From: Jes Sorensen <Jes.Sorensen@redhat.com> > > Add -version-simple argument for QEMU, printing just the version > number, without any supporting text. > > This makes it simpler for other apps, such as libvirt, to parse the > version string from QEMU independant of how the naming string may > change. > > Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> > --- > qemu-options.hx | 8 ++++++++ > vl.c | 9 +++++++++ > 2 files changed, 17 insertions(+), 0 deletions(-) > > diff --git a/qemu-options.hx b/qemu-options.hx > index 12f6b51..e4f3979 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -27,6 +27,14 @@ STEXI > Display version information and exit > ETEXI > > +DEF("version-simple", 0, QEMU_OPTION_version_simple, > + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) > +STEXI > +@item -version-simple > +@findex -version-simple > +Display basic version number information and exit > +ETEXI > + > DEF("M", HAS_ARG, QEMU_OPTION_M, > "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) > STEXI > diff --git a/vl.c b/vl.c > index 85bcc84..5adca87 100644 > --- a/vl.c > +++ b/vl.c > @@ -2015,6 +2015,11 @@ static void version(void) > printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); > } > > +static void version_simple(void) > +{ > + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); > +} > + > static void help(int exitcode) > { > const char *options_help = > @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) > version(); > exit(0); > break; > + case QEMU_OPTION_version_simple: > + version_simple(); > + exit(0); > + break; > case QEMU_OPTION_m: { > uint64_t value; > char *ptr; This omits the KVM version string which is something we also want to see. 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) 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 :| ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-13 13:33 ` Daniel P. Berrange @ 2010-05-13 13:41 ` Jes Sorensen 2010-05-13 19:30 ` Blue Swirl ` (2 subsequent siblings) 3 siblings, 0 replies; 18+ messages in thread From: Jes Sorensen @ 2010-05-13 13:41 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: aliguori, clalance, qemu-devel, crobinso On 05/13/10 15:33, Daniel P. Berrange wrote: > This omits the KVM version string which is something we also want to see. > 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 just made it print the version numbers that were already part of the regular string, but I see no problem adding a KVM version number to the output as well. As for the JSON stuff, then I'll volunteer you to write the patch for it :) To be honest, I have no clue what JSON is! Cheers, Jes ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 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 13:27 ` Anthony Liguori 3 siblings, 0 replies; 18+ messages in thread From: Blue Swirl @ 2010-05-13 19:30 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: Jes.Sorensen, aliguori, clalance, qemu-devel, crobinso On 5/13/10, Daniel P. Berrange <berrange@redhat.com> wrote: > On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: > > From: Jes Sorensen <Jes.Sorensen@redhat.com> > > > > Add -version-simple argument for QEMU, printing just the version > > number, without any supporting text. > > > > This makes it simpler for other apps, such as libvirt, to parse the > > version string from QEMU independant of how the naming string may > > change. > > > > Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> > > --- > > qemu-options.hx | 8 ++++++++ > > vl.c | 9 +++++++++ > > 2 files changed, 17 insertions(+), 0 deletions(-) > > > > diff --git a/qemu-options.hx b/qemu-options.hx > > index 12f6b51..e4f3979 100644 > > --- a/qemu-options.hx > > +++ b/qemu-options.hx > > @@ -27,6 +27,14 @@ STEXI > > Display version information and exit > > ETEXI > > > > +DEF("version-simple", 0, QEMU_OPTION_version_simple, > > + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) > > +STEXI > > +@item -version-simple > > +@findex -version-simple > > +Display basic version number information and exit > > +ETEXI > > + > > DEF("M", HAS_ARG, QEMU_OPTION_M, > > "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) > > STEXI > > diff --git a/vl.c b/vl.c > > index 85bcc84..5adca87 100644 > > --- a/vl.c > > +++ b/vl.c > > @@ -2015,6 +2015,11 @@ static void version(void) > > printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); > > } > > > > +static void version_simple(void) > > +{ > > + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); > > +} > > + > > static void help(int exitcode) > > { > > const char *options_help = > > @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) > > version(); > > exit(0); > > break; > > + case QEMU_OPTION_version_simple: > > + version_simple(); > > + exit(0); > > + break; > > case QEMU_OPTION_m: { > > uint64_t value; > > char *ptr; > > > This omits the KVM version string which is something we also want to see. > 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) Perhaps QMP could be used to dump the same information, something equivalent to monitor command 'info argv'. Otherwise, I'd suggest to use a name with 'machine' or 'json' in it, like -QEMU-machine-protocol-info-argv, or -get-json-info-argv. Still, -version-simple may be useful for shell scripting etc. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 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 13:27 ` Anthony Liguori 3 siblings, 1 reply; 18+ messages in thread From: Markus Armbruster @ 2010-05-14 9:42 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: Jes.Sorensen, aliguori, clalance, qemu-devel, crobinso "Daniel P. Berrange" <berrange@redhat.com> writes: > On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: >> From: Jes Sorensen <Jes.Sorensen@redhat.com> >> >> Add -version-simple argument for QEMU, printing just the version >> number, without any supporting text. >> >> This makes it simpler for other apps, such as libvirt, to parse the >> version string from QEMU independant of how the naming string may >> change. >> >> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> >> --- >> qemu-options.hx | 8 ++++++++ >> vl.c | 9 +++++++++ >> 2 files changed, 17 insertions(+), 0 deletions(-) >> >> diff --git a/qemu-options.hx b/qemu-options.hx >> index 12f6b51..e4f3979 100644 >> --- a/qemu-options.hx >> +++ b/qemu-options.hx >> @@ -27,6 +27,14 @@ STEXI >> Display version information and exit >> ETEXI >> >> +DEF("version-simple", 0, QEMU_OPTION_version_simple, >> + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) >> +STEXI >> +@item -version-simple >> +@findex -version-simple >> +Display basic version number information and exit >> +ETEXI >> + >> DEF("M", HAS_ARG, QEMU_OPTION_M, >> "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) >> STEXI >> diff --git a/vl.c b/vl.c >> index 85bcc84..5adca87 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -2015,6 +2015,11 @@ static void version(void) >> printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); >> } >> >> +static void version_simple(void) >> +{ >> + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); >> +} >> + >> static void help(int exitcode) >> { >> const char *options_help = >> @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) >> version(); >> exit(0); >> break; >> + case QEMU_OPTION_version_simple: >> + version_simple(); >> + exit(0); >> + break; >> case QEMU_OPTION_m: { >> uint64_t value; >> char *ptr; > > This omits the KVM version string which is something we also want to see. > 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? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 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:48 ` Anthony Liguori 0 siblings, 2 replies; 18+ messages in thread From: Daniel P. Berrange @ 2010-05-14 10:06 UTC (permalink / raw) To: Markus Armbruster; +Cc: Jes.Sorensen, aliguori, clalance, qemu-devel, crobinso On Fri, May 14, 2010 at 11:42:57AM +0200, Markus Armbruster wrote: > "Daniel P. Berrange" <berrange@redhat.com> writes: > > > On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: > >> From: Jes Sorensen <Jes.Sorensen@redhat.com> > >> > >> Add -version-simple argument for QEMU, printing just the version > >> number, without any supporting text. > >> > >> This makes it simpler for other apps, such as libvirt, to parse the > >> version string from QEMU independant of how the naming string may > >> change. > >> > >> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> > >> --- > >> qemu-options.hx | 8 ++++++++ > >> vl.c | 9 +++++++++ > >> 2 files changed, 17 insertions(+), 0 deletions(-) > >> > >> diff --git a/qemu-options.hx b/qemu-options.hx > >> index 12f6b51..e4f3979 100644 > >> --- a/qemu-options.hx > >> +++ b/qemu-options.hx > >> @@ -27,6 +27,14 @@ STEXI > >> Display version information and exit > >> ETEXI > >> > >> +DEF("version-simple", 0, QEMU_OPTION_version_simple, > >> + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) > >> +STEXI > >> +@item -version-simple > >> +@findex -version-simple > >> +Display basic version number information and exit > >> +ETEXI > >> + > >> DEF("M", HAS_ARG, QEMU_OPTION_M, > >> "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) > >> STEXI > >> diff --git a/vl.c b/vl.c > >> index 85bcc84..5adca87 100644 > >> --- a/vl.c > >> +++ b/vl.c > >> @@ -2015,6 +2015,11 @@ static void version(void) > >> printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); > >> } > >> > >> +static void version_simple(void) > >> +{ > >> + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); > >> +} > >> + > >> static void help(int exitcode) > >> { > >> const char *options_help = > >> @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) > >> version(); > >> exit(0); > >> break; > >> + case QEMU_OPTION_version_simple: > >> + version_simple(); > >> + exit(0); > >> + break; > >> case QEMU_OPTION_m: { > >> uint64_t value; > >> char *ptr; > > > > This omits the KVM version string which is something we also want to see. > > 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": ""}} I'm suggesting we just allow some simple syntactic sugar on the command line for the handful of QMP commands that are just returning static info about the binary, that are not affected by VM state. eg, make this work: $ qemu -query-version {"qemu": "0.12.50", "package": ""} 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 :| ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-14 10:06 ` Daniel P. Berrange @ 2010-05-14 11:24 ` Markus Armbruster 2010-05-14 13:34 ` Daniel P. Berrange 2010-05-14 13:48 ` Anthony Liguori 1 sibling, 1 reply; 18+ messages in thread From: Markus Armbruster @ 2010-05-14 11:24 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: Jes.Sorensen, aliguori, clalance, qemu-devel, crobinso "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. > I'm suggesting we just allow some simple syntactic sugar on the command > line for the handful of QMP commands that are just returning static info > about the binary, that are not affected by VM state. > > eg, make this work: > > $ qemu -query-version > {"qemu": "0.12.50", "package": ""} I wouldn't mind. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-14 11:24 ` Markus Armbruster @ 2010-05-14 13:34 ` Daniel P. Berrange 0 siblings, 0 replies; 18+ messages in thread From: Daniel P. Berrange @ 2010-05-14 13:34 UTC (permalink / raw) To: Markus Armbruster; +Cc: Jes.Sorensen, aliguori, clalance, qemu-devel, crobinso 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 :| ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-14 10:06 ` Daniel P. Berrange 2010-05-14 11:24 ` Markus Armbruster @ 2010-05-14 13:48 ` Anthony Liguori 2010-05-14 13:57 ` Daniel P. Berrange 1 sibling, 1 reply; 18+ messages in thread From: Anthony Liguori @ 2010-05-14 13:48 UTC (permalink / raw) To: Daniel P. Berrange Cc: Anthony Liguori, Jes.Sorensen, Markus Armbruster, qemu-devel, clalance, crobinso On 05/14/2010 05:06 AM, Daniel P. Berrange wrote: > On Fri, May 14, 2010 at 11:42:57AM +0200, Markus Armbruster wrote: > >> "Daniel P. Berrange"<berrange@redhat.com> writes: >> >> >>> On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: >>> >>>> From: Jes Sorensen<Jes.Sorensen@redhat.com> >>>> >>>> Add -version-simple argument for QEMU, printing just the version >>>> number, without any supporting text. >>>> >>>> This makes it simpler for other apps, such as libvirt, to parse the >>>> version string from QEMU independant of how the naming string may >>>> change. >>>> >>>> Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com> >>>> --- >>>> qemu-options.hx | 8 ++++++++ >>>> vl.c | 9 +++++++++ >>>> 2 files changed, 17 insertions(+), 0 deletions(-) >>>> >>>> diff --git a/qemu-options.hx b/qemu-options.hx >>>> index 12f6b51..e4f3979 100644 >>>> --- a/qemu-options.hx >>>> +++ b/qemu-options.hx >>>> @@ -27,6 +27,14 @@ STEXI >>>> Display version information and exit >>>> ETEXI >>>> >>>> +DEF("version-simple", 0, QEMU_OPTION_version_simple, >>>> + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) >>>> +STEXI >>>> +@item -version-simple >>>> +@findex -version-simple >>>> +Display basic version number information and exit >>>> +ETEXI >>>> + >>>> DEF("M", HAS_ARG, QEMU_OPTION_M, >>>> "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) >>>> STEXI >>>> diff --git a/vl.c b/vl.c >>>> index 85bcc84..5adca87 100644 >>>> --- a/vl.c >>>> +++ b/vl.c >>>> @@ -2015,6 +2015,11 @@ static void version(void) >>>> printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); >>>> } >>>> >>>> +static void version_simple(void) >>>> +{ >>>> + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); >>>> +} >>>> + >>>> static void help(int exitcode) >>>> { >>>> const char *options_help = >>>> @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) >>>> version(); >>>> exit(0); >>>> break; >>>> + case QEMU_OPTION_version_simple: >>>> + version_simple(); >>>> + exit(0); >>>> + break; >>>> case QEMU_OPTION_m: { >>>> uint64_t value; >>>> char *ptr; >>>> >>> This omits the KVM version string which is something we also want to see. >>> 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": ""}} > > > I'm suggesting we just allow some simple syntactic sugar on the command > line for the handful of QMP commands that are just returning static info > about the binary, that are not affected by VM state. > > eg, make this work: > > $ qemu -query-version > {"qemu": "0.12.50", "package": ""} > No need for package. Vendors can use vendor extensions to add whatever info they want. But we should avoid an encoded string, it would be better as: {"major": 0, "minor": 12, "release": 50} And then it could be: {"major": 0, "minor": 12, "release": 50, "__org.linux-kvm.release": 1, "__com.redhat.RHEL6.release": 13} We could also just pretty print it: major: 0 minor: 12 release: 50 __org.linux-kvm.release: 1 __com.redhat.RHEL6.release: 13 Regards, Anthony Liguori > Daniel > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-14 13:48 ` Anthony Liguori @ 2010-05-14 13:57 ` Daniel P. Berrange 0 siblings, 0 replies; 18+ messages in thread From: Daniel P. Berrange @ 2010-05-14 13:57 UTC (permalink / raw) To: Anthony Liguori Cc: Anthony Liguori, Jes.Sorensen, Markus Armbruster, qemu-devel, clalance, crobinso On Fri, May 14, 2010 at 08:48:58AM -0500, Anthony Liguori wrote: > On 05/14/2010 05:06 AM, Daniel P. Berrange wrote: > >On Fri, May 14, 2010 at 11:42:57AM +0200, Markus Armbruster wrote: > > > >>"Daniel P. Berrange"<berrange@redhat.com> writes: > >> > >> > >>>On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: > >>> > >>>>From: Jes Sorensen<Jes.Sorensen@redhat.com> > >>>> > >>>>Add -version-simple argument for QEMU, printing just the version > >>>>number, without any supporting text. > >>>> > >>>>This makes it simpler for other apps, such as libvirt, to parse the > >>>>version string from QEMU independant of how the naming string may > >>>>change. > >>>> > >>>>Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com> > >>>>--- > >>>> qemu-options.hx | 8 ++++++++ > >>>> vl.c | 9 +++++++++ > >>>> 2 files changed, 17 insertions(+), 0 deletions(-) > >>>> > >>>>diff --git a/qemu-options.hx b/qemu-options.hx > >>>>index 12f6b51..e4f3979 100644 > >>>>--- a/qemu-options.hx > >>>>+++ b/qemu-options.hx > >>>>@@ -27,6 +27,14 @@ STEXI > >>>> Display version information and exit > >>>> ETEXI > >>>> > >>>>+DEF("version-simple", 0, QEMU_OPTION_version_simple, > >>>>+ "-version-simple display version information and exit\n", > >>>>QEMU_ARCH_ALL) > >>>>+STEXI > >>>>+@item -version-simple > >>>>+@findex -version-simple > >>>>+Display basic version number information and exit > >>>>+ETEXI > >>>>+ > >>>> DEF("M", HAS_ARG, QEMU_OPTION_M, > >>>> "-M machine select emulated machine (-M ? for list)\n", > >>>> QEMU_ARCH_ALL) > >>>> STEXI > >>>>diff --git a/vl.c b/vl.c > >>>>index 85bcc84..5adca87 100644 > >>>>--- a/vl.c > >>>>+++ b/vl.c > >>>>@@ -2015,6 +2015,11 @@ static void version(void) > >>>> printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", > >>>> Copyright (c) 2003-2008 Fabrice Bellard\n"); > >>>> } > >>>> > >>>>+static void version_simple(void) > >>>>+{ > >>>>+ printf(QEMU_VERSION QEMU_PKGVERSION "\n"); > >>>>+} > >>>>+ > >>>> static void help(int exitcode) > >>>> { > >>>> const char *options_help = > >>>>@@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) > >>>> version(); > >>>> exit(0); > >>>> break; > >>>>+ case QEMU_OPTION_version_simple: > >>>>+ version_simple(); > >>>>+ exit(0); > >>>>+ break; > >>>> case QEMU_OPTION_m: { > >>>> uint64_t value; > >>>> char *ptr; > >>>> > >>>This omits the KVM version string which is something we also want to see. > >>>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": ""}} > > > > > >I'm suggesting we just allow some simple syntactic sugar on the command > >line for the handful of QMP commands that are just returning static info > >about the binary, that are not affected by VM state. > > > >eg, make this work: > > > > $ qemu -query-version > > {"qemu": "0.12.50", "package": ""} > > > > No need for package. Vendors can use vendor extensions to add whatever > info they want. Yeah I don't know what 'package' is doing - its jsut what 'query-version' currently prints in QMP > But we should avoid an encoded string, it would be better as: > > {"major": 0, "minor": 12, "release": 50} > > And then it could be: > > {"major": 0, "minor": 12, "release": 50, "__org.linux-kvm.release": 1, > "__com.redhat.RHEL6.release": 13} > > We could also just pretty print it: > > major: 0 > minor: 12 > release: 50 > __org.linux-kvm.release: 1 > __com.redhat.RHEL6.release: 13 Pretty printing re-introduces the problem of reliable parsing. I think we should allow for a JSON format output since apps already need to have a good parser for that - no point writing another parser. Perhaps allow for the arg to take a format value, '-query-version [pretty|json]' 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 :| ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-13 13:33 ` Daniel P. Berrange ` (2 preceding siblings ...) 2010-05-14 9:42 ` Markus Armbruster @ 2010-05-14 13:27 ` Anthony Liguori 2010-05-14 13:32 ` Daniel P. Berrange 2010-05-14 14:25 ` Markus Armbruster 3 siblings, 2 replies; 18+ messages in thread From: Anthony Liguori @ 2010-05-14 13:27 UTC (permalink / raw) To: Daniel P. Berrange; +Cc: Jes.Sorensen, clalance, qemu-devel, crobinso On 05/13/2010 08:33 AM, Daniel P. Berrange wrote: > On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: > >> From: Jes Sorensen<Jes.Sorensen@redhat.com> >> >> Add -version-simple argument for QEMU, printing just the version >> number, without any supporting text. >> >> This makes it simpler for other apps, such as libvirt, to parse the >> version string from QEMU independant of how the naming string may >> change. >> >> Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com> >> --- >> qemu-options.hx | 8 ++++++++ >> vl.c | 9 +++++++++ >> 2 files changed, 17 insertions(+), 0 deletions(-) >> >> diff --git a/qemu-options.hx b/qemu-options.hx >> index 12f6b51..e4f3979 100644 >> --- a/qemu-options.hx >> +++ b/qemu-options.hx >> @@ -27,6 +27,14 @@ STEXI >> Display version information and exit >> ETEXI >> >> +DEF("version-simple", 0, QEMU_OPTION_version_simple, >> + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) >> +STEXI >> +@item -version-simple >> +@findex -version-simple >> +Display basic version number information and exit >> +ETEXI >> + >> DEF("M", HAS_ARG, QEMU_OPTION_M, >> "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) >> STEXI >> diff --git a/vl.c b/vl.c >> index 85bcc84..5adca87 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -2015,6 +2015,11 @@ static void version(void) >> printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); >> } >> >> +static void version_simple(void) >> +{ >> + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); >> +} >> + >> static void help(int exitcode) >> { >> const char *options_help = >> @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) >> version(); >> exit(0); >> break; >> + case QEMU_OPTION_version_simple: >> + version_simple(); >> + exit(0); >> + break; >> case QEMU_OPTION_m: { >> uint64_t value; >> char *ptr; >> > This omits the KVM version string which is something we also want to see. > 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) > Can we do this all via the monitor? IOW, can libvirt invoke qemu blindly and strictly interact with the monitor? Regards, Anthony Liguori > Regards, > Daniel > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-14 13:27 ` Anthony Liguori @ 2010-05-14 13:32 ` Daniel P. Berrange 2010-05-14 14:25 ` Markus Armbruster 1 sibling, 0 replies; 18+ messages in thread From: Daniel P. Berrange @ 2010-05-14 13:32 UTC (permalink / raw) To: Anthony Liguori; +Cc: Jes.Sorensen, clalance, qemu-devel, crobinso On Fri, May 14, 2010 at 08:27:54AM -0500, Anthony Liguori wrote: > On 05/13/2010 08:33 AM, Daniel P. Berrange wrote: > >On Thu, May 13, 2010 at 10:32:52AM +0200, Jes.Sorensen@redhat.com wrote: > > > >>From: Jes Sorensen<Jes.Sorensen@redhat.com> > >> > >>Add -version-simple argument for QEMU, printing just the version > >>number, without any supporting text. > >> > >>This makes it simpler for other apps, such as libvirt, to parse the > >>version string from QEMU independant of how the naming string may > >>change. > >> > >>Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com> > >>--- > >> qemu-options.hx | 8 ++++++++ > >> vl.c | 9 +++++++++ > >> 2 files changed, 17 insertions(+), 0 deletions(-) > >> > >>diff --git a/qemu-options.hx b/qemu-options.hx > >>index 12f6b51..e4f3979 100644 > >>--- a/qemu-options.hx > >>+++ b/qemu-options.hx > >>@@ -27,6 +27,14 @@ STEXI > >> Display version information and exit > >> ETEXI > >> > >>+DEF("version-simple", 0, QEMU_OPTION_version_simple, > >>+ "-version-simple display version information and exit\n", > >>QEMU_ARCH_ALL) > >>+STEXI > >>+@item -version-simple > >>+@findex -version-simple > >>+Display basic version number information and exit > >>+ETEXI > >>+ > >> DEF("M", HAS_ARG, QEMU_OPTION_M, > >> "-M machine select emulated machine (-M ? for list)\n", > >> QEMU_ARCH_ALL) > >> STEXI > >>diff --git a/vl.c b/vl.c > >>index 85bcc84..5adca87 100644 > >>--- a/vl.c > >>+++ b/vl.c > >>@@ -2015,6 +2015,11 @@ static void version(void) > >> printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", > >> Copyright (c) 2003-2008 Fabrice Bellard\n"); > >> } > >> > >>+static void version_simple(void) > >>+{ > >>+ printf(QEMU_VERSION QEMU_PKGVERSION "\n"); > >>+} > >>+ > >> static void help(int exitcode) > >> { > >> const char *options_help = > >>@@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) > >> version(); > >> exit(0); > >> break; > >>+ case QEMU_OPTION_version_simple: > >>+ version_simple(); > >>+ exit(0); > >>+ break; > >> case QEMU_OPTION_m: { > >> uint64_t value; > >> char *ptr; > >> > >This omits the KVM version string which is something we also want to see. > >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) > > > > Can we do this all via the monitor? IOW, can libvirt invoke qemu > blindly and strictly interact with the monitor? See my other message in this thread... 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 :| ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. 2010-05-14 13:27 ` Anthony Liguori 2010-05-14 13:32 ` Daniel P. Berrange @ 2010-05-14 14:25 ` Markus Armbruster 1 sibling, 0 replies; 18+ messages in thread From: Markus Armbruster @ 2010-05-14 14:25 UTC (permalink / raw) To: Anthony Liguori; +Cc: Jes.Sorensen, clalance, qemu-devel, crobinso Anthony Liguori <aliguori@linux.vnet.ibm.com> writes: > Can we do this all via the monitor? IOW, can libvirt invoke qemu > blindly and strictly interact with the monitor? I think that's exactly where should be heading longer term. It's not a practical immediate solution, e.g. because device_add can't cold-plug, yet. ^ permalink raw reply [flat|nested] 18+ messages in thread
* [Qemu-devel] Re: [PATCH 1/1] Add -version-simple argument, printing only version number. 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-14 13:21 ` Anthony Liguori 2010-05-14 13:58 ` Chris Lalancette ` (2 more replies) 1 sibling, 3 replies; 18+ messages in thread From: Anthony Liguori @ 2010-05-14 13:21 UTC (permalink / raw) To: Jes.Sorensen; +Cc: clalance, qemu-devel, crobinso On 05/13/2010 03:32 AM, Jes.Sorensen@redhat.com wrote: > From: Jes Sorensen<Jes.Sorensen@redhat.com> > > Add -version-simple argument for QEMU, printing just the version > number, without any supporting text. > I'm not a huge fan of the name. But what information are we trying to convey? Just major/minor number or would qemu-kvm also throw some info in there? Do version numbers even matter because 0.13 from qemu.git is going to be a hell of a lot different from 0.13 in RHEL6.x. What are the consumers of this information actually doing with it? Regards, Anthony Liguori > This makes it simpler for other apps, such as libvirt, to parse the > version string from QEMU independant of how the naming string may > change. > > Signed-off-by: Jes Sorensen<Jes.Sorensen@redhat.com> > --- > qemu-options.hx | 8 ++++++++ > vl.c | 9 +++++++++ > 2 files changed, 17 insertions(+), 0 deletions(-) > > diff --git a/qemu-options.hx b/qemu-options.hx > index 12f6b51..e4f3979 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -27,6 +27,14 @@ STEXI > Display version information and exit > ETEXI > > +DEF("version-simple", 0, QEMU_OPTION_version_simple, > + "-version-simple display version information and exit\n", QEMU_ARCH_ALL) > +STEXI > +@item -version-simple > +@findex -version-simple > +Display basic version number information and exit > +ETEXI > + > DEF("M", HAS_ARG, QEMU_OPTION_M, > "-M machine select emulated machine (-M ? for list)\n", QEMU_ARCH_ALL) > STEXI > diff --git a/vl.c b/vl.c > index 85bcc84..5adca87 100644 > --- a/vl.c > +++ b/vl.c > @@ -2015,6 +2015,11 @@ static void version(void) > printf("QEMU emulator version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"); > } > > +static void version_simple(void) > +{ > + printf(QEMU_VERSION QEMU_PKGVERSION "\n"); > +} > + > static void help(int exitcode) > { > const char *options_help = > @@ -2960,6 +2965,10 @@ int main(int argc, char **argv, char **envp) > version(); > exit(0); > break; > + case QEMU_OPTION_version_simple: > + version_simple(); > + exit(0); > + break; > case QEMU_OPTION_m: { > uint64_t value; > char *ptr; > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 1/1] Add -version-simple argument, printing only version number. 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 2 siblings, 0 replies; 18+ messages in thread From: Chris Lalancette @ 2010-05-14 13:58 UTC (permalink / raw) To: Anthony Liguori; +Cc: Jes.Sorensen, qemu-devel, crobinso On 05/14/2010 09:21 AM, Anthony Liguori wrote: > On 05/13/2010 03:32 AM, Jes.Sorensen@redhat.com wrote: >> From: Jes Sorensen<Jes.Sorensen@redhat.com> >> >> Add -version-simple argument for QEMU, printing just the version >> number, without any supporting text. >> > > I'm not a huge fan of the name. > > But what information are we trying to convey? Just major/minor number > or would qemu-kvm also throw some info in there? > > Do version numbers even matter because 0.13 from qemu.git is going to be > a hell of a lot different from 0.13 in RHEL6.x. > > What are the consumers of this information actually doing with it? At the moment libvirt uses it mostly to determine what features are present in a particular version of Qemu that is on the machine. So for instrance, for 0.13 we turn on the JSON flag so we know to use the QMP monitor instead of the text monitor. There are many other examples as well. Now, I agree that this isn't the best way to do it; much better would be a way for libvirt to query the capabilities of Qemu directly and not rely on versions (not the least because of the problem you point out above). But up until now we haven't had a better way to do it. -- Chris Lalancette ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 1/1] Add -version-simple argument, printing only version number. 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 2 siblings, 0 replies; 18+ messages in thread From: Daniel P. Berrange @ 2010-05-14 14:06 UTC (permalink / raw) To: Anthony Liguori; +Cc: Jes.Sorensen, clalance, qemu-devel, crobinso On Fri, May 14, 2010 at 08:21:55AM -0500, Anthony Liguori wrote: > On 05/13/2010 03:32 AM, Jes.Sorensen@redhat.com wrote: > >From: Jes Sorensen<Jes.Sorensen@redhat.com> > > > >Add -version-simple argument for QEMU, printing just the version > >number, without any supporting text. > > > > I'm not a huge fan of the name. > > But what information are we trying to convey? Just major/minor number > or would qemu-kvm also throw some info in there? > > Do version numbers even matter because 0.13 from qemu.git is going to be > a hell of a lot different from 0.13 in RHEL6.x. Version numbers are the last resort. We'll try all other avenues for detecting a feature, before turning to a version number, precisely because of the variance you mention here. When we do toggle something based on a version though, we'll be conservative basing decision off upstream QEMU 0.13 functionality, ignoring what extra bits a distro might have backported (or even disabled). 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 :| ^ permalink raw reply [flat|nested] 18+ messages in thread
* [Qemu-devel] Re: [PATCH 1/1] Add -version-simple argument, printing only version number. 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 2 siblings, 0 replies; 18+ messages in thread From: Jes Sorensen @ 2010-05-17 6:54 UTC (permalink / raw) To: Anthony Liguori; +Cc: clalance, qemu-devel, crobinso On 05/14/10 15:21, Anthony Liguori wrote: > On 05/13/2010 03:32 AM, Jes.Sorensen@redhat.com wrote: >> From: Jes Sorensen<Jes.Sorensen@redhat.com> >> >> Add -version-simple argument for QEMU, printing just the version >> number, without any supporting text. > > I'm not a huge fan of the name. It was the lesser evil I could come up with since -version was already taken, but I am open to alternatives. > But what information are we trying to convey? Just major/minor number > or would qemu-kvm also throw some info in there? > > Do version numbers even matter because 0.13 from qemu.git is going to be > a hell of a lot different from 0.13 in RHEL6.x. > > What are the consumers of this information actually doing with it? I think this has already been discussed, I was off on Friday so I'll leave it to the other thread. Cheers, Jes ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2010-05-17 6:57 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
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).