* [Qemu-devel] [PATCH] linux-user: Add support for -version option
@ 2011-01-20 3:28 Peter Maydell
2011-02-07 15:47 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2011-01-20 3:28 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, patches
Add support to the linux-user qemu for the -version command line
option, bringing it into line with the system emulation qemu.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
linux-user/main.c | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/linux-user/main.c b/linux-user/main.c
index 0d627d6..e651bfd 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2624,14 +2624,21 @@ void cpu_loop (CPUState *env)
}
#endif /* TARGET_ALPHA */
+static void version(void)
+{
+ printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION
+ ", Copyright (c) 2003-2008 Fabrice Bellard\n");
+}
+
static void usage(void)
{
- printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"
- "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n"
+ version();
+ printf("usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n"
"Linux CPU emulator (compiled for %s emulation)\n"
"\n"
"Standard options:\n"
"-h print this help\n"
+ "-version display version information and exit\n"
"-g port wait gdb connection to port\n"
"-L path set the elf interpreter prefix (default=%s)\n"
"-s size set the stack size in bytes (default=%ld)\n"
@@ -2886,8 +2893,10 @@ int main(int argc, char **argv, char **envp)
singlestep = 1;
} else if (!strcmp(r, "strace")) {
do_strace = 1;
- } else
- {
+ } else if (!strcmp(r, "version")) {
+ version();
+ exit(0);
+ } else {
usage();
}
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] linux-user: Add support for -version option
2011-01-20 3:28 [Qemu-devel] [PATCH] linux-user: Add support for -version option Peter Maydell
@ 2011-02-07 15:47 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2011-02-07 15:47 UTC (permalink / raw)
To: qemu-devel; +Cc: Riku Voipio, patches
Ping?
On 20 January 2011 03:28, Peter Maydell <peter.maydell@linaro.org> wrote:
> Add support to the linux-user qemu for the -version command line
> option, bringing it into line with the system emulation qemu.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> linux-user/main.c | 17 +++++++++++++----
> 1 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 0d627d6..e651bfd 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -2624,14 +2624,21 @@ void cpu_loop (CPUState *env)
> }
> #endif /* TARGET_ALPHA */
>
> +static void version(void)
> +{
> + printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION
> + ", Copyright (c) 2003-2008 Fabrice Bellard\n");
> +}
> +
> static void usage(void)
> {
> - printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n"
> - "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n"
> + version();
> + printf("usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n"
> "Linux CPU emulator (compiled for %s emulation)\n"
> "\n"
> "Standard options:\n"
> "-h print this help\n"
> + "-version display version information and exit\n"
> "-g port wait gdb connection to port\n"
> "-L path set the elf interpreter prefix (default=%s)\n"
> "-s size set the stack size in bytes (default=%ld)\n"
> @@ -2886,8 +2893,10 @@ int main(int argc, char **argv, char **envp)
> singlestep = 1;
> } else if (!strcmp(r, "strace")) {
> do_strace = 1;
> - } else
> - {
> + } else if (!strcmp(r, "version")) {
> + version();
> + exit(0);
> + } else {
> usage();
> }
> }
> --
> 1.6.3.3
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-07 15:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 3:28 [Qemu-devel] [PATCH] linux-user: Add support for -version option Peter Maydell
2011-02-07 15:47 ` Peter Maydell
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).