On 5/23/25 11:50 AM, Akihiko Odaki wrote:
> On 2025/05/21 20:33, Paolo Abeni wrote:
>> @@ -235,4 +235,12 @@
>>    */
>>   #define VHOST_VDPA_GET_VRING_SIZE  _IOWR(VHOST_VIRTIO, 0x82,       \
>>                                            struct vhost_vring_state)
>> +
>> +/* Extended features manipulation
>> + */
>> +#ifdef __SIZEOF_INT128__
>> +#define VHOST_GET_FEATURES_EX  _IOR(VHOST_VIRTIO, 0x83, __u128)
>> +#define VHOST_SET_FEATURES_EX  _IOW(VHOST_VIRTIO, 0x83, __u128)
> 
> Suffixing names with _EX is a culture of Windows, and it becomes mess 
> when extending multiple times (e.g., VHOST_GET_FEATURES_EX_EX).
> 
> I sugguest naming them as VHOST_GET_FEATURES2 and VHOST_SET_FEATURES2 or 
> VHOST_GET_FEATURES128 and VHOST_SET_FEATURES128 for clarity.
> 
> include/uapi/asm-generic/ioctl.h says:
>   * Encoding the size of the parameter structure in the ioctl request
>   * is useful for catching programs compiled with old versions
>   * and to avoid overwriting user space outside the user buffer area.
> 
> So perhaps the intended encoding for an extended ioctl is to keep the 
> first and second argument and change only the third parameter. For example:
> 
> #define VHOST_GET_FEATURES128 _IOR(VHOST_VIRTIO, 0x00, __u128)
> #define VHOST_SET_FEATURES128 _IOW(VHOST_VIRTIO, 0x00, __u128)

Thanks, I like that the latter form. I'll do in the next revision.

BTW, the reference to that legacy OS really hurts here :-P

/P


Reply via email to