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

Re: [Xen-devel] [PATCH v6 2/7] x86: dynamically attach/detach CQM service for a guest



>>> On 20.01.14 at 14:17, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> On 20/01/14 13:13, Jan Beulich wrote:
>>>>> On 05.12.13 at 10:38, Dongxiao Xu <dongxiao.xu@xxxxxxxxx> wrote:
>>> @@ -1223,6 +1224,45 @@ long arch_do_domctl(
>>>      }
>>>      break;
>>>  
>>> +    case XEN_DOMCTL_attach_pqos:
>>> +    {
>>> +        if ( domctl->u.qos_type.flags & XEN_DOMCTL_pqos_cqm )
>>> +        {
>>> +            if ( !system_supports_cqm() )
>>> +                ret = -ENODEV;
>>> +            else if ( d->arch.pqos_cqm_rmid > 0 )
>>> +                ret = -EEXIST;
>>> +            else
>>> +            {
>>> +                ret = alloc_cqm_rmid(d);
>>> +                if ( ret < 0 )
>>> +                    ret = -EUSERS;
>> Why don't you have the function return a sensible error code
>> (which presumably might also end up being other than -EUSERS,
>> e.g. -ENOMEM).
> 
> -EUSERS is correct here.  This failure like this means "all the
> available system rmid's are already being used by other domains".

I didn't mean to say anything to the contrary with _current_ code.
As with any alloc type function, a future change may involve other
than just a RMID allocation, and hence -ENOMEM may become
possible.

Jan


_______________________________________________
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®.