From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH 3/4] libxl: vcpuset: Remove useless limit on max_vcpus. Date: Mon, 2 Feb 2015 15:47:48 -0500 Message-ID: <1422910069-15760-4-git-send-email-konrad.wilk@oracle.com> References: <1402045657.29759.34.camel@kazak.uk.xensource.com> <1422910069-15760-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: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YINud-0007kW-N1 for xen-devel@lists.xenproject.org; Mon, 02 Feb 2015 20:48:03 +0000 In-Reply-To: <1422910069-15760-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: xen-devel@lists.xenproject.org, Ian.Campbell@citrix.com, ian.jackson@eu.citrix.com, 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 --- 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 d22ba85..9e2d1b2 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -5053,8 +5053,6 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host) " continue\n", host_cpu, max_vcpus); return -ERROR_INVAL; } - /* 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) { -- 1.8.4.2