rust-vmm / vmm-sys-util

Helpers and utilities used by multiple rust-vmm components and VMMs
BSD 3-Clause "New" or "Revised" License
78 stars 65 forks source link

Extend the FamStruct implementation to support multiple fields #104

Closed andreeaflorescu closed 3 years ago

andreeaflorescu commented 3 years ago

The FAM struct implementation is minimalist and only works for FAM structs that have 2 fields: the number of entries and the incomplete array type.

FAM structs by their definition just require that the last field in the structure is the incomplete array type, but it does not talk about the number of other fields.

We should extend this implementation to support other scenarios as well. Because of this miss, vfio-ioctls cannot use the FamStructWrapper code and needs to redefine how to work with FAM.