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

Re: [Xen-devel] [PATCH] x86/msr: Drop {pv, hvm}_max_vcpu_msrs objects



On 24.02.2020 15:22, Andrew Cooper wrote:
> @@ -103,10 +100,7 @@ int init_domain_msr_policy(struct domain *d)
>  
>  int init_vcpu_msr_policy(struct vcpu *v)
>  {
> -    struct domain *d = v->domain;
> -    struct vcpu_msrs *msrs =
> -        xmemdup(is_pv_domain(d) ?  &pv_max_vcpu_msrs
> -                                : &hvm_max_vcpu_msrs);
> +    struct vcpu_msrs *msrs = xzalloc(*msrs);

As said on the other thread, I don't think this visual (even if
not factual) use of an uninitialized variable is not helpful. I
don't see anything wrong with continuing the traditional

    struct vcpu_msrs *msrs = xzalloc(struct vcpu_msrs);

way. It would be a different thing if the variable to be
initialized was passed into the macro, and hence there
wouldn't be any explicit assignment (or initialization)
at the use sites ...

For the suggested alternative form
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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