From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v4 2/7] libxl: In libxl_set_vcpuonline check for maximum number of VCPUs against the cpumap. Date: Fri, 3 Apr 2015 11:45:58 -0400 Message-ID: <20150403154558.GA16158@l.oracle.com> References: <1427729207-9832-1-git-send-email-konrad.wilk@oracle.com> <1427729207-9832-3-git-send-email-konrad.wilk@oracle.com> <1427817471.2115.172.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1427817471.2115.172.camel@citrix.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 Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Tue, Mar 31, 2015 at 04:57:51PM +0100, Ian Campbell wrote: > On Mon, 2015-03-30 at 11:26 -0400, Konrad Rzeszutek Wilk wrote: > > There is no sense in trying to online (or offline) CPUs when the size of > > cpumap is greater than the maximum number of VCPUs the guest can go to. > > > > As such fail the operation if the count of CPUs to online is greater > > than what the guest started with. For the offline case we do not > > check (as the bits are unset in the cpumap) and let it go through. > > > > We coalesce some of the underlaying libxl_set_vcpuonline code > > "underlying" Whoa! Just to make sure I understand why I used the incorrect word. I used an verb while I should have used an adjective - which 'underlying' is, right? > > > together to take advantage for the QMP and XenStore ways. > > > > Signed-off-by: Konrad Rzeszutek Wilk > > [v2: constify the libxl_domain and handle libxl_domain_info error] > > --- > > tools/libxl/libxl.c | 70 +++++++++++++++++++++++++++++++---------------------- > > 1 file changed, 41 insertions(+), 29 deletions(-) > > > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > > index 80c7ff6..13a98fd 100644 > > --- a/tools/libxl/libxl.c > > +++ b/tools/libxl/libxl.c > > @@ -5442,28 +5442,34 @@ int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid, > > return 0; > > } > > > > +static int libxl__check_max(libxl__gc *gc, const libxl_dominfo *info, > > The name is so generic (max what?) and the implementation so simple I'd > suggest to just inline the check at the one call site. > > Otherwise looks ok, thanks. > >