From: Jes.Sorensen@redhat.com
To: qemu-devel@nongnu.org, aliguori@us.ibm.com, crobinso@redhat.com,
clalance@redhat.com
Cc: Jes Sorensen <Jes.Sorensen@redhat.com>
Subject: [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number.
Date: Thu, 13 May 2010 10:32:52 +0200 [thread overview]
Message-ID: <1273739572-30840-2-git-send-email-Jes.Sorensen@redhat.com> (raw)
In-Reply-To: <1273739572-30840-1-git-send-email-Jes.Sorensen@redhat.com>
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
next prev parent reply other threads:[~2010-05-13 11:27 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 ` Jes.Sorensen [this message]
2010-05-13 13:33 ` [Qemu-devel] [PATCH 1/1] Add -version-simple argument, printing only version number 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
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=1273739572-30840-2-git-send-email-Jes.Sorensen@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=aliguori@us.ibm.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).