RFC: vfio interface for platform devices (v2)

Scott Wood
2013-07-03T23:06:22Z

On 07/03/2013 05:53:09 PM, Alex Williamson wrote:
> Seems like it should work.  My only API concern with this model of
> appending structs is that a user needs to know the size of each struct
> even if they don't otherwise care about it in order to step over it.

In that case, it might be better to make the struct grow linearly
rather than with options, and just have a version number on the struct
indicating how far the caller thinks struct has grown.  The kernel
could respond back with a lower version to reflect that it only filled
in the fields it knows about.  Flags could still be used to indicate
which portions of the struct are relevant, but not the physical layout
of the struct.

> In some cases, like the path, the size is variable and the user needs
> to
> look into it.

For things like path, maybe the caller should just pass in a string
buffer that is separate from the struct buffer?

-Scott