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: 3363801 Return-Path: X-Original-To: patchwork-kvm@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 DE0689F344 for ; Tue, 17 Dec 2013 18:32:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 466A6201C0 for ; Tue, 17 Dec 2013 18:32:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 661FE202B4 for ; Tue, 17 Dec 2013 18:31:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932397Ab3LQSbk (ORCPT ); Tue, 17 Dec 2013 13:31:40 -0500 Received: from service87.mimecast.com ([91.220.42.44]:38362 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932388Ab3LQSbg (ORCPT ); Tue, 17 Dec 2013 13:31:36 -0500 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 Cc: kvm@vger.kernel.org, will.deacon@arm.com, Robin Murphy 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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, \