From: Konrad Rzeszutek Wilk Subject: [PATCH v4 6/7] libxl/vcpuset: Remove useless limit on max_vcpus. Date: Mon, 30 Mar 2015 11:26:46 -0400 Message-ID: <1427729207-9832-7-git-send-email-konrad.wilk@oracle.com> References: <1427729207-9832-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427729207-9832-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.campbell@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org, wei.liu2@citrix.com Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org The check is superflous. If the 'max_vcpus' (argument value) is greater than pCPU and --ignore-host has not been supplied we would print an warning and return and not call this code. If the --ignore-host parameter had been used we would never end up in this condition and enforce 'max_vcpus'. The only time it would be invoked is if max_vcpus < host_cpu in which case it would set max_vcpus to max_vcpus. In short - it is dead code. Signed-off-by: Konrad Rzeszutek Wilk Acked-by: Ian Campbell --- tools/libxl/xl_cmdimpl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 0a104ce..b121d75 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -5244,8 +5244,6 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host) " continue\n", host_cpu, max_vcpus); return 1; } - /* NB: This also limits how many are set in the bitmap */ - max_vcpus = (max_vcpus > host_cpu ? host_cpu : max_vcpus); } rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus); if (rc) { -- 2.1.0