From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 2/7] libxl: In libxl_set_vcpuonline check for maximum number of VCPUs against the cpumap. Date: Tue, 31 Mar 2015 16:57:51 +0100 Message-ID: <1427817471.2115.172.camel@citrix.com> References: <1427729207-9832-1-git-send-email-konrad.wilk@oracle.com> <1427729207-9832-3-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-3-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: Konrad Rzeszutek Wilk Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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" > 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.