From patchwork Tue Dec 17 18:31:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Murphy X-Patchwork-Id: 3363841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A3E519F344 for ; Tue, 17 Dec 2013 18:32:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6CB8F203B0 for ; Tue, 17 Dec 2013 18:32:55 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2EDBC201BF for ; Tue, 17 Dec 2013 18:32:54 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VszRH-0006iU-Nu; Tue, 17 Dec 2013 18:32:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VszR9-0006A4-JJ; Tue, 17 Dec 2013 18:32:07 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VszQy-000673-3u for linux-arm-kernel@lists.infradead.org; Tue, 17 Dec 2013 18:31:56 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 17 Dec 2013 18:31:35 +0000 Received: from e104324-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 17 Dec 2013 18:31:34 +0000 From: Robin Murphy To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: [PATCH 1/2] kvmtool: Support unsigned int options Date: Tue, 17 Dec 2013 18:31:13 +0000 Message-Id: <1387305074-29421-2-git-send-email-robin.murphy@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387305074-29421-1-git-send-email-robin.murphy@arm.com> References: <1387305074-29421-1-git-send-email-robin.murphy@arm.com> X-OriginalArrivalTime: 17 Dec 2013 18:31:34.0111 (UTC) FILETIME=[368A36F0:01CEFB56] X-MC-Unique: 113121718313500201 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131217_133156_354137_B2BFAC54 X-CRM114-Status: UNSURE ( 8.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: Robin Murphy , will.deacon@arm.com, kvm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for unsigned int command-line options by implementing the OPT_UINTEGER macro. Signed-off-by: Robin Murphy Acked-by: Will Deacon --- tools/kvm/include/kvm/parse-options.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/kvm/include/kvm/parse-options.h b/tools/kvm/include/kvm/parse-options.h index 09a5fca..b03f151 100644 --- a/tools/kvm/include/kvm/parse-options.h +++ b/tools/kvm/include/kvm/parse-options.h @@ -109,6 +109,15 @@ struct option { .help = (h) \ } +#define OPT_UINTEGER(s, l, v, h) \ +{ \ + .type = OPTION_UINTEGER, \ + .short_name = (s), \ + .long_name = (l), \ + .value = check_vtype(v, unsigned int *), \ + .help = (h) \ +} + #define OPT_U64(s, l, v, h) \ { \ .type = OPTION_U64, \