From: Will Deacon Subject: [PATCH 4/5] kvm tools: support unsigned int options Date: Mon, 6 Jan 2014 17:38:36 +0000 Message-ID: <1389029917-23773-5-git-send-email-will.deacon@arm.com> References: <1389029917-23773-1-git-send-email-will.deacon@arm.com> Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Robin Murphy , Robin Murphy , Will Deacon To: penberg@kernel.org Return-path: Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]:34053 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755282AbaAFRi5 (ORCPT ); Mon, 6 Jan 2014 12:38:57 -0500 In-Reply-To: <1389029917-23773-1-git-send-email-will.deacon@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: From: Robin Murphy Add support for unsigned int command-line options by implementing the OPT_UINTEGER macro. Acked-by: Will Deacon Signed-off-by: Robin Murphy Signed-off-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 09a5fca71117..b03f151240d0 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, \ -- 1.8.2.2