[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Avoid issue with pp-directive in macro
From: |
Bruce Rogers |
Subject: |
Re: [Qemu-devel] [PATCH] Avoid issue with pp-directive in macro |
Date: |
Mon, 10 Aug 2009 11:30:27 -0600 |
Is this any more palatable then?
Signed-off-by: Bruce Rogers <address@hidden>
---
qemu-img.c | 70 +++++++++++++++++++++++++++++++------------------------------
vl.c | 30 +++++++++++++-------------
2 files changed, 52 insertions(+), 48 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 070fe2e..313b136 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -58,44 +58,46 @@ static void format_print(void *opaque, const char *name)
/* Please keep in synch with qemu-img.texi */
static void help(void)
{
- printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice
Bellard\n"
- "usage: qemu-img command [command options]\n"
- "QEMU disk image utility\n"
- "\n"
- "Command syntax:\n"
+ static const char *msg =
+ "qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice
Bellard\n"
+ "usage: qemu-img command [command options]\n"
+ "QEMU disk image utility\n"
+ "\n"
+ "Command syntax:\n"
#define DEF(option, callback, arg_string) \
- " " arg_string "\n"
+ " " arg_string "\n"
#include "qemu-img-cmds.h"
#undef DEF
#undef GEN_DOCS
- "\n"
- "Command parameters:\n"
- " 'filename' is a disk image filename\n"
- " 'base_image' is the read-only disk image which is used as base
for a copy on\n"
- " write image; the copy on write image only stores the modified
data\n"
- " 'output_base_image' forces the output image to be created as a
copy on write\n"
- " image of the specified base image; 'output_base_image' should
have the same\n"
- " content as the input's base image, however the path, image
format, etc may\n"
- " differ\n"
- " 'fmt' is the disk image format. It is guessed automatically in
most cases\n"
- " 'size' is the disk image size in kilobytes. Optional suffixes\n"
- " 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 *
1024) are\n"
- " supported any 'k' or 'K' is ignored\n"
- " 'output_filename' is the destination disk image filename\n"
- " 'output_fmt' is the destination format\n"
- " 'options' is a comma separated list of format specific options
in a\n"
- " name=value format. Use -o ? for an overview of the options
supported by the\n"
- " used format\n"
- " '-c' indicates that target image must be compressed (qcow format
only)\n"
- " '-h' with or without a command shows this help and lists the
supported formats\n"
- "\n"
- "Parameters to snapshot subcommand:\n"
- " 'snapshot' is the name of the snapshot to create, apply or
delete\n"
- " '-a' applies a snapshot (revert disk to saved state)\n"
- " '-c' creates a snapshot\n"
- " '-d' deletes a snapshot\n"
- " '-l' lists all snapshots in the given image\n"
- );
+ "\n"
+ "Command parameters:\n"
+ " 'filename' is a disk image filename\n"
+ " 'base_image' is the read-only disk image which is used as base for
a copy on\n"
+ " write image; the copy on write image only stores the modified
data\n"
+ " 'output_base_image' forces the output image to be created as a copy
on write\n"
+ " image of the specified base image; 'output_base_image' should
have the same\n"
+ " content as the input's base image, however the path, image
format, etc may\n"
+ " differ\n"
+ " 'fmt' is the disk image format. It is guessed automatically in most
cases\n"
+ " 'size' is the disk image size in kilobytes. Optional suffixes\n"
+ " 'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 *
1024) are\n"
+ " supported any 'k' or 'K' is ignored\n"
+ " 'output_filename' is the destination disk image filename\n"
+ " 'output_fmt' is the destination format\n"
+ " 'options' is a comma separated list of format specific options in
a\n"
+ " name=value format. Use -o ? for an overview of the options
supported by the\n"
+ " used format\n"
+ " '-c' indicates that target image must be compressed (qcow format
only)\n"
+ " '-h' with or without a command shows this help and lists the
supported formats\n"
+ "\n"
+ "Parameters to snapshot subcommand:\n"
+ " 'snapshot' is the name of the snapshot to create, apply or delete\n"
+ " '-a' applies a snapshot (revert disk to saved state)\n"
+ " '-c' creates a snapshot\n"
+ " '-d' deletes a snapshot\n"
+ " '-l' lists all snapshots in the given image\n";
+
+ printf(msg);
printf("\nSupported formats:");
bdrv_iterate_format(format_print, NULL);
printf("\n");
diff --git a/vl.c b/vl.c
index a526cb0..b173274 100644
--- a/vl.c
+++ b/vl.c
@@ -4339,26 +4339,28 @@ static void version(void)
static void help(int exitcode)
{
- version();
- printf("usage: %s [options] [disk_image]\n"
- "\n"
- "'disk_image' is a raw hard image image for IDE hard disk 0\n"
- "\n"
+ static const char *msg =
+ "usage: %s [options] [disk_image]\n"
+ "\n"
+ "'disk_image' is a raw hard image image for IDE hard disk 0\n"
+ "\n"
#define DEF(option, opt_arg, opt_enum, opt_help) \
- opt_help
+ opt_help
#define DEFHEADING(text) stringify(text) "\n"
#include "qemu-options.h"
#undef DEF
#undef DEFHEADING
#undef GEN_DOCS
- "\n"
- "During emulation, the following keys are useful:\n"
- "ctrl-alt-f toggle full screen\n"
- "ctrl-alt-n switch to virtual console 'n'\n"
- "ctrl-alt toggle mouse and keyboard grab\n"
- "\n"
- "When using -nographic, press 'ctrl-a h' to get some help.\n"
- ,
+ "\n"
+ "During emulation, the following keys are useful:\n"
+ "ctrl-alt-f toggle full screen\n"
+ "ctrl-alt-n switch to virtual console 'n'\n"
+ "ctrl-alt toggle mouse and keyboard grab\n"
+ "\n"
+ "When using -nographic, press 'ctrl-a h' to get some help.\n";
+
+ version();
+ printf(msg,
"qemu",
DEFAULT_RAM_SIZE,
#ifndef _WIN32
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH] Avoid issue with pp-directive in macro,
Bruce Rogers <=