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

Re: [Xen-devel] [PATCH 08/10] VMX: disable PML in vmx_vcpu_destroy



At 15:25 +0800 on 10 Apr (1428679508), Kai Huang wrote:
> 
> 
> On 04/09/2015 08:04 PM, Tim Deegan wrote:
> > Looking at this and other callers of these enable/disable functions, I
> > think it would be better to make those functions idempotent (i.e.
> > *_{en,dis}able_pml() should just return success if PML is already
> > enabled/disabled).  Then you don't need to check in every caller, and
> > there's no risk of a crash if one caller is missing the check.
> Do you mean something like below?
> 
> bool_t vmx_vcpu_enable_pml(struct vcpu *v)
> {
>      if ( vmx_vcpu_pml_enabled(v) )
>          return success;
>      ......    /* code to enable */
> 
>      return success;
> error:
>      ...
>      return failure;
> }
> 
> This should be also fine. I will do this. But I think 
> vmx_{vcpu|domain}_disable_pml should remain return value of void.

Yes, that sounds fine.

Tim.

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