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

Re: [Xen-devel] [PATCH v17 12/13] x86/hvm: Remove redundant save functions



>>> On 22.08.18 at 16:02, <aisaila@xxxxxxxxxxxxxxx> wrote:
 @@ -148,6 +145,9 @@ int hvm_save_one(struct domain *d, unsigned int typecode, 
unsigned int instance,
>           !hvm_sr_handlers[typecode].save )
>          return -EINVAL;
>  
> +    if ( hvm_sr_handlers[typecode].kind == HVMSR_PER_VCPU &&
> +        instance >= d->max_vcpus )

Indentation.

You're checking instance only for per-vcpu records, but ...

> @@ -155,7 +155,7 @@ int hvm_save_one(struct domain *d, unsigned int typecode, 
> unsigned int instance,
>      if ( !ctxt.data )
>          return -ENOMEM;
>  
> -    if ( (rv = hvm_sr_handlers[typecode].save(d, &ctxt)) != 0 )
> +    if ( (rv = hvm_sr_handlers[typecode].save(d->vcpu[instance], &ctxt)) != 
> 0 )

... you _again_ use it as array index unconditionally. Please
don't submit new versions without taking care of review
comments given for earlier ones.

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