From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55876 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCv0A-0003IZ-Hg for qemu-devel@nongnu.org; Fri, 14 May 2010 09:32:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCv06-0003hQ-Up for qemu-devel@nongnu.org; Fri, 14 May 2010 09:32:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59988) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCv06-0003hL-NO for qemu-devel@nongnu.org; Fri, 14 May 2010 09:32:26 -0400 Date: Fri, 14 May 2010 14:32:23 +0100 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. Message-ID: <20100514133223.GH9282@redhat.com> References: <1273739572-30840-1-git-send-email-Jes.Sorensen@redhat.com> <1273739572-30840-2-git-send-email-Jes.Sorensen@redhat.com> <20100513133322.GI12207@redhat.com> <4BED4FDA.4000007@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BED4FDA.4000007@linux.vnet.ibm.com> Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jes.Sorensen@redhat.com, clalance@redhat.com, qemu-devel@nongnu.org, crobinso@redhat.com 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 > >> > >>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 > >>--- > >> 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 :|