From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36676 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCuq9-0004NW-CP for qemu-devel@nongnu.org; Fri, 14 May 2010 09:22:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCuq7-0002I1-KJ for qemu-devel@nongnu.org; Fri, 14 May 2010 09:22:09 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:57052) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCuq7-0002Ht-FQ for qemu-devel@nongnu.org; Fri, 14 May 2010 09:22:07 -0400 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e31.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o4EDC5Hd020276 for ; Fri, 14 May 2010 07:12:06 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o4EDLvF3083012 for ; Fri, 14 May 2010 07:21:58 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o4EDLurs013746 for ; Fri, 14 May 2010 07:21:57 -0600 Message-ID: <4BED4E73.2080802@linux.vnet.ibm.com> Date: Fri, 14 May 2010 08:21:55 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1273739572-30840-1-git-send-email-Jes.Sorensen@redhat.com> <1273739572-30840-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1273739572-30840-2-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/1] Add -version-simple argument, printing only version number. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jes.Sorensen@redhat.com Cc: clalance@redhat.com, qemu-devel@nongnu.org, crobinso@redhat.com On 05/13/2010 03:32 AM, Jes.Sorensen@redhat.com wrote: > From: Jes Sorensen > > 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 > --- > 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; >