On 05/11/2014 11:33, Paolo Bonzini wrote:
> On 30/10/2014 10:36, Christian Borntraeger wrote:
>> struct kvm_msrs contains a pad field. Lets initialize this pad
>> field. A designated initializer seems not appropriate here, as
>> struct kvm_msrs is embedded in the msr_data structure.
>>
>> Signed-off-by: Christian Borntraeger <borntrae...@de.ibm.com>
> 
> What about this:
> 
>     msr_data.info = (struct kvm_msrs) {
>         .nmsrs = n
>     };
> 
> ?  It would also be applicable to other uses of kvm_msrs.

Also, KVM_SET_MSRS has to deal with a reserved field in struct
kvm_msr_entry.  Currently you handle it with a relatively large memset
produced by the designated initializer "= {}" in kvm_put_msrs.  However,
you could set it in kvm_msr_entry_set, and avoid the memset.

Paolo

> Also, you're missing one occurrence in kvm_put_msr_feature_control.


Reply via email to