Re: [RFC 0/5] Making KVM_GET_ONE_REG/KVM_SET_ONE_REG generic.

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

 



On 08/29/2012 11:39 AM, Rusty Russell wrote:
>  
>  
> -4.76 KVM_VCPU_GET_MSR_INDEX_LIST
> +4.76 KVM_VCPU_GET_REG_LIST



>  
> -Capability: basic
> +Capability: KVM_CAP_REG_LIST
>  Architectures: arm

all

>  Type: vcpu ioctl
> -Parameters: struct kvm_msr_list (in/out)
> +Parameters: struct kvm_reg_list (in/out)
>  Returns: 0 on success; -1 on error
>  Errors:
> -  E2BIG:     the msr index list is too big to fit in the array specified by
> -             the user.
> +  E2BIG:     the reg index list is too big to fit in the array specified by
> +             the user (the number required will be written into n).
>  
>  struct kvm_msr_list {
> -	__u32 nmsrs; /* number of msrs in entries */
> -	__u32 indices[0];
> +	__u64 n; /* number of registers in reg[] */
> +	__u64 reg[0];
>  };
>  

People complain that this interface is hard to use.

How about supplying the address of the array (in addition to n) so you
don't have to deal with variable sized arrays, and dropping E2BIG in
favour of always updating n (n changed to something bigger than you had
-> reallocate and rerun)




-- 
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm


[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux