[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/4] libxl: vcpuset: Check max_vcpus argument against the maximum number of vCPUs the guest has set.



On Tue, 2015-02-03 at 10:45 -0500, Konrad Rzeszutek Wilk wrote:
> 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?

Sounds good (subject to anyone who wants to bikeshed the name). In
general we would like to move away from the catchall errors like
ERROR_INVAL (or, worse, ERROR_FAIL) towards more specific errors.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.