You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 6, 2024. It is now read-only.
In linux 5.17, kvm_xsave got turned into a FamStruct by adding the
flexible "extra" member to its definition. However, unlike all other
such structs, it does not contain a "length" field. Instead, the length
of the flexible array member has to be determined by querying the
`KVM_CAP_XSAVE2` capability. This requires access to a VM file
descriptor, and thus cannot happen in the `FamStruct::len` trait method.
To work around this, define a wrapper struct that caches the length of a
previous `KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2)` call, and implement
`FamStruct` for this wrapper. Then in kvm-ioctls, we can expose a
function that first query `KVM_CAP_XSAVE2`, then invokes
`KVM_GET_XSAVE2` to retrives the `kvm_xsave` structure, and then combine
them into the below `kvm_xsave2` structure to be managed as a
`FamStruct`.
Signed-off-by: Patrick Roy <[email protected]>
0 commit comments