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

Re: [Xen-devel] [PATCH v4 3/4] tools: add tools support for Intel CDP



> Quoting the relevant bits of code for clarity:
>      libxl_psr_cbm_type type = LIBXL_PSR_CBM_TYPE_L3_CBM;
>     ...
>     case 'd':
>         type = LIBXL_PSR_CBM_TYPE_L3_DATA;
>         opt_data = 1;
>         break;
>     case 'c':
>         type = LIBXL_PSR_CBM_TYPE_L3_CODE;
>         opt_code = 1;
>         break;
>      }
>  
>     if (opt_data && opt_code)
>         type = LIBXL_PSR_CBM_TYPE_L3_CBM;
> 
> So the behaviour if -d and -c are given is exactly the same as if neither
> of them were given, i.e. type = LIBXL_PSR_CBM_TYPE_L3_CBM? Is that correct
> and intended?

Yes.

> If so then I think it would be clearer to only set opt_* during option
> parsing and then to figure out the correct LIBXL_PSR_CBM_TYPE_* explicitly
> afterwards, rather than have the code cycle through data->code->cbm.
> 
> Or just outlaw passing both -d and -c together since it is confusing and
> equivalent to passing neither anyway.

Yes, as you said, if user just passes one option -d (or -c), things would
be done during option parsing, there is no need to add the if().

But the key point is that I am not sure how to address outlaw passing both
-d and -c together (is it allowed?). If it is permitted, the behaviour is
the same as passing neither indeed, and the if() is needed to avoid latter
option overwritting former option.

What's your suggestion? Sorry, I am a little confused.
Omit former opiton when both options are given and remove if()?
Or something else?

Thanks for your time.

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