From patchwork Thu Feb 4 15:49:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 44524 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 E6B96B7D55 for ; Fri, 5 Feb 2010 02:57:06 +1100 (EST) Received: from localhost ([127.0.0.1]:54298 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd44m-00054y-8v for incoming@patchwork.ozlabs.org; Thu, 04 Feb 2010 10:57:04 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd3y9-0002Hq-Hb for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:13 -0500 Received: from [199.232.76.173] (port=38559 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd3y8-0002H7-KO for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:12 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd3y7-000580-1G for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40813) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd3y6-00057h-AO for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:10 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o14Fo8m2001778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Feb 2010 10:50:08 -0500 Received: from localhost.localdomain (vpn1-5-172.ams2.redhat.com [10.36.5.172]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o14Fnx6K029856; Thu, 4 Feb 2010 10:50:06 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 4 Feb 2010 16:49:59 +0100 Message-Id: <1265298599-4186-5-git-send-email-pbonzini@redhat.com> In-Reply-To: <201002042313.45353.sheng@linux.intel.com> References: <201002042313.45353.sheng@linux.intel.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com, quintela@redhat.com, sheng@linux.intel.com Subject: [Qemu-devel] [PATCH 4/4] vl.c: avoid preprocessor directives in a printf call 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 Similar to the qemu-img.c patch, but I also have to unescape remaining % signs in qemu-options.hx. Signed-off-by: Paolo Bonzini --- qemu-options.hx | 4 ++-- vl.c | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 2fa9ed4..bb2d4fa 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -430,7 +430,7 @@ Also optionally set the top visible process name in Linux. ETEXI DEF("uuid", HAS_ARG, QEMU_OPTION_uuid, - "-uuid %%08x-%%04x-%%04x-%%04x-%%012x\n" + "-uuid %08x-%04x-%04x-%04x-%012x\n" " specify machine UUID\n") STEXI @item -uuid @var{uuid} @@ -773,7 +773,7 @@ ETEXI DEF("smbios", HAS_ARG, QEMU_OPTION_smbios, "-smbios file=binary\n" " load SMBIOS entry from binary file\n" - "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%%d.%%d]\n" + "-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]\n" " specify SMBIOS type 0 fields\n" "-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]\n" " [,uuid=uuid][,sku=str][,family=str]\n" diff --git a/vl.c b/vl.c index 3d2de7b..057046e 100644 --- a/vl.c +++ b/vl.c @@ -4021,11 +4021,7 @@ 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" + const char *options_help = #define DEF(option, opt_arg, opt_enum, opt_help) \ opt_help #define DEFHEADING(text) stringify(text) "\n" @@ -4033,15 +4029,21 @@ static void help(int exitcode) #undef DEF #undef DEFHEADING #undef GEN_DOCS + ; + version(); + printf("usage: %s [options] [disk_image]\n" + "\n" + "'disk_image' is a raw hard image image for IDE hard disk 0\n" "\n" + "%s\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" - , - "qemu"); + "When using -nographic, press 'ctrl-a h' to get some help.\n", + "qemu", + options_help); exit(exitcode); }