From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 2/4] libxl: vcpuset: Check max_vcpus argument against the maximum number of vCPUs the guest has set. Date: Tue, 3 Feb 2015 10:45:48 -0500 Message-ID: <20150203154547.GG9371@l.oracle.com> References: <1402045657.29759.34.camel@kazak.uk.xensource.com> <1422910069-15760-1-git-send-email-konrad.wilk@oracle.com> <1422910069-15760-3-git-send-email-konrad.wilk@oracle.com> <21712.58639.482256.761520@mariner.uk.xensource.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 1YIfft-0007Rj-4R for xen-devel@lists.xenproject.org; Tue, 03 Feb 2015 15:46:01 +0000 Content-Disposition: inline In-Reply-To: <21712.58639.482256.761520@mariner.uk.xensource.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 Jackson Cc: xen-devel@lists.xenproject.org, wei.liu2@citrix.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org On Tue, Feb 03, 2015 at 03:11:11PM +0000, Ian Jackson wrote: > Konrad Rzeszutek Wilk writes ("[PATCH 2/4] libxl: vcpuset: Check max_vcpus argument against the maximum number of vCPUs the guest has set."): > > The maximum number of VCPUs the guest can have is determined during > > domain creation and is set by 'maxvcpus' parameter (in the guest > > config). Trying to set the amount of vCPUs above said value > > in vcpuset will result in an error - and we can catch it here > > (instead of later in the function) and print a nice warning to the user. > ... > > + rc = libxl_domain_info(ctx, &dominfo, domid); > > + if (rc == ERROR_INVAL) { > > + fprintf(stderr, "Error: Domain %u does not exist.\n", domid); > > + return -rc; > > Do we really return ERROR_INVAL for this ? ... Looks like we do. > > OK then, although we are definitely going to have to change that at > some point. How tiresome. I could add a new type - ERROR_NOTFOUND (of course as a seperate patch) and change all of the libxl_domain_info users to take advantage of that if you would like? > > Thanks, > Ian.