From: Ian Campbell Subject: Re: [PATCH v1 2/2] libxl: vcpu-set - allow to decrease vcpu count on overcommitted guests (v2) Date: Fri, 6 Jun 2014 10:07:37 +0100 Message-ID: <1402045657.29759.34.camel@kazak.uk.xensource.com> References: <1401888813-30987-1-git-send-email-konrad.wilk@oracle.com> <1401888813-30987-3-git-send-email-konrad.wilk@oracle.com> <1401966177.29759.10.camel@kazak.uk.xensource.com> <20140605174409.GC2546@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wsq7i-0001Ol-HL for xen-devel@lists.xenproject.org; Fri, 06 Jun 2014 09:07:42 +0000 In-Reply-To: <20140605174409.GC2546@localhost.localdomain> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2014-06-05 at 13:44 -0400, Konrad Rzeszutek Wilk wrote: > > > - /* NB: This also limits how many are set in the bitmap */ > > > - max_vcpus = (max_vcpus > host_cpu ? host_cpu : max_vcpus); > > > > Where did this go? > > No need for it actually. As we already do the action if 'max_vcpus > > host_cpu' - which is that we return. So in essence that code will set max_vcpus > to max_vcpus. What about if dominfo.vcpu_online > max_vcpus? iN that case the max_vcpus > host_cpu check doesn't occur. You could be in this state if someone had previously forced overcommit I think. > > > > > > } > > > if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) { > > > fprintf(stderr, "libxl_cpu_bitmap_alloc failed\n"); > > > >