From patchwork Thu May 13 08:32:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 52472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CA5C6B7E22 for ; Thu, 13 May 2010 21:35:49 +1000 (EST) Received: from localhost ([127.0.0.1]:40530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCWhc-0008NC-7a for incoming@patchwork.ozlabs.org; Thu, 13 May 2010 07:35:44 -0400 Received: from [140.186.70.92] (port=56878 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCWZl-0006dX-A4 for qemu-devel@nongnu.org; Thu, 13 May 2010 07:27:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCTqw-000463-9X for qemu-devel@nongnu.org; Thu, 13 May 2010 04:33:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38017) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCTqw-00045s-2M for qemu-devel@nongnu.org; Thu, 13 May 2010 04:33:10 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4D8X9PB015893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 May 2010 04:33:09 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4D8X4tT006298; Thu, 13 May 2010 04:33:07 -0400 From: Jes.Sorensen@redhat.com To: qemu-devel@nongnu.org, aliguori@us.ibm.com, crobinso@redhat.com, clalance@redhat.com Date: Thu, 13 May 2010 10:32:52 +0200 Message-Id: <1273739572-30840-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1273739572-30840-1-git-send-email-Jes.Sorensen@redhat.com> References: <1273739572-30840-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Jes Sorensen Subject: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;