From patchwork Sat Feb 6 02:00:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8240961 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F1946BEEE5 for ; Sat, 6 Feb 2016 02:03:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18A38202F8 for ; Sat, 6 Feb 2016 02:03:54 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24DD120265 for ; Sat, 6 Feb 2016 02:03:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRsBH-0002uq-KB; Sat, 06 Feb 2016 02:00:59 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aRsBF-0002rt-HW for xen-devel@lists.xenproject.org; Sat, 06 Feb 2016 02:00:57 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id D2/62-21594-8D355B65; Sat, 06 Feb 2016 02:00:56 +0000 X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1454724055!20675570!1 X-Originating-IP: [74.125.82.49] X-SpamReason: No, hits=0.2 required=7.0 tests=RCVD_ILLEGAL_IP X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19479 invoked from network); 6 Feb 2016 02:00:56 -0000 Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by server-4.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 6 Feb 2016 02:00:56 -0000 Received: by mail-wm0-f49.google.com with SMTP id g62so49996210wme.0 for ; Fri, 05 Feb 2016 18:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=WLUve3Blew7a5TeNGkMvvs9LmJUtDL7O1Tjst8N/Dok=; b=fjSo9k6GFDuMP1qdgJ9kNfHllJWid8/ViQ7cYiC4IZCYCYkj13joSqFKjNI8mUTIy0 osfxzpKXne5+IMTuGwOm4sca2xhUcpbXrAoBNSJmmr9oiwN98AWjGprJgq893l5gvPPL OquoG8upx7le6eZVIgu3ZnftCwjxPYy0GGGlGP3xpSTQ9lsH0zcYeA4FcyxeEbcw+rhq qTWNzxPcsoIrYj+nATzhZAuntQka1nwnXxUPafAoeBL5JhPdk375vfe55SwMQZwElLB2 c0lsSUGdjItVNzZCdlP/m8LsP0fydcDceTKEkHIUjkXxDTbD2tavxeSrrqy+zf0OA3JW tnSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=WLUve3Blew7a5TeNGkMvvs9LmJUtDL7O1Tjst8N/Dok=; b=C5Xnp3KPIgUH+9jiv9ZfjONCZATqJ4nOHy9eru6NNxQTEthXh/EziWeMGexK08KmY/ E91NiRvo5a2Gj1P+kt4iNguEh9UY1t81vRuUgwpxo4KwyRocLyOBKkEFCCe8RXKVm3zg MrFruJrlonzLTGLJSy+2dApSpWqvLQPckWSQDk9K7HcydnL8cXIk1SeutJKAf+3dxrL1 eo7KGA71ygBnlqcKqDuSdokF72K9QdgJ9WgJlSErePeq9/IzeBbAKfCCYxJnUNgifJXC 8/EvOyiFrdOQD6m9wr0LlxeA39eP6c9swqdYCDV7Rp/H9Rh2JftKLP5ja5BeN8FNuhSd lnSQ== X-Gm-Message-State: AG10YOSgDkorfLU5CpgKq7g4xNC8DWxwjbCu2M37Etr2S39+YD8hIes8KDEVQni+6O0m9w== X-Received: by 10.28.0.132 with SMTP id 126mr20383237wma.67.1454724055771; Fri, 05 Feb 2016 18:00:55 -0800 (PST) Received: from Solace.station (net-2-35-170-8.cust.vodafonedsl.it. [2.35.170.8]) by smtp.gmail.com with ESMTPSA id gg7sm18265674wjd.10.2016.02.05.18.00.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Feb 2016 18:00:54 -0800 (PST) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Sat, 06 Feb 2016 03:00:52 +0100 Message-ID: <20160206020052.6436.89943.stgit@Solace.station> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , Ian Campbell , George Dunlap Subject: [Xen-devel] [PATCH] xl: use bool type for flags instead of int X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 in schedulers' command handlers. No functional change intended. Signed-off-by: Dario Faggioli Acked-by: George Dunlap --- Cc: Ian Jackson Cc: Ian Campbell Cc: Wei Liu Cc: George Dunlap --- tools/libxl/xl_cmdimpl.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 20704d2..d07ccb2 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -6035,9 +6035,11 @@ int main_sched_credit(int argc, char **argv) { const char *dom = NULL; const char *cpupool = NULL; - int weight = 256, cap = 0, opt_w = 0, opt_c = 0; - int opt_s = 0; - int tslice = 0, opt_t = 0, ratelimit = 0, opt_r = 0; + int weight = 256, cap = 0; + int tslice = 0, ratelimit = 0; + bool opt_w = false, opt_c = false; + bool opt_t = false, opt_r = false; + bool opt_s = false; int opt, rc; static struct option opts[] = { {"domain", 1, 0, 'd'}, @@ -6056,22 +6058,22 @@ int main_sched_credit(int argc, char **argv) break; case 'w': weight = strtol(optarg, NULL, 10); - opt_w = 1; + opt_w = true; break; case 'c': cap = strtol(optarg, NULL, 10); - opt_c = 1; + opt_c = true; break; case 't': tslice = strtol(optarg, NULL, 10); - opt_t = 1; + opt_t = true; break; case 'r': ratelimit = strtol(optarg, NULL, 10); - opt_r = 1; + opt_r = true; break; case 's': - opt_s = 1; + opt_s = true; break; case 'p': cpupool = optarg; @@ -6157,7 +6159,8 @@ int main_sched_credit2(int argc, char **argv) { const char *dom = NULL; const char *cpupool = NULL; - int weight = 256, opt_w = 0; + int weight = 256; + bool opt_w = false; int opt, rc; static struct option opts[] = { {"domain", 1, 0, 'd'}, @@ -6172,7 +6175,7 @@ int main_sched_credit2(int argc, char **argv) break; case 'w': weight = strtol(optarg, NULL, 10); - opt_w = 1; + opt_w = true; break; case 'p': cpupool = optarg; @@ -6246,11 +6249,11 @@ int main_sched_rtds(int argc, char **argv) break; case 'p': period = strtol(optarg, NULL, 10); - opt_p = 1; + opt_p = true; break; case 'b': budget = strtol(optarg, NULL, 10); - opt_b = 1; + opt_b = true; break; case 'c': cpupool = optarg;