@@ -9,6 +9,7 @@ use super::bindings::{
99 kvm_nested_state__bindgen_ty_1, kvm_pit_channel_state, kvm_pit_state2, kvm_regs, kvm_segment,
1010 kvm_sregs, kvm_vcpu_events, kvm_xcr, kvm_xcrs, kvm_xsave,
1111} ;
12+ #[ cfg( feature = "fam-wrappers" ) ]
1213use super :: fam_wrappers:: kvm_xsave2;
1314use super :: nested:: { KvmNestedStateBuffer , kvm_nested_state__data} ;
1415use serde:: { Deserialize , Deserializer , Serialize , Serializer } ;
@@ -33,13 +34,15 @@ serde_impls!(
3334 kvm_msrs,
3435 kvm_cpuid2,
3536 kvm_xsave,
36- kvm_xsave2,
3737 kvm_irqchip,
3838 kvm_irq_routing,
3939 kvm_irq_routing_entry,
4040 KvmNestedStateBuffer
4141) ;
4242
43+ #[ cfg( feature = "fam-wrappers" ) ]
44+ serde_impls ! ( kvm_xsave2) ;
45+
4346// SAFETY: zerocopy's derives explicitly disallow deriving for unions where
4447// the fields have different sizes, due to the smaller fields having padding.
4548// Miri however does not complain about these implementations (e.g. about
@@ -200,6 +203,7 @@ mod tests {
200203 is_serde :: < kvm_vcpu_events > ( ) ;
201204 is_serde :: < kvm_debugregs > ( ) ;
202205 is_serde :: < kvm_xsave > ( ) ;
206+ #[ cfg( feature = "fam-wrappers" ) ]
203207 is_serde :: < kvm_xsave2 > ( ) ;
204208 is_serde :: < kvm_xcr > ( ) ;
205209 is_serde :: < kvm_xcrs > ( ) ;
@@ -235,6 +239,7 @@ mod tests {
235239 is_serde_json :: < kvm_vcpu_events > ( ) ;
236240 is_serde_json :: < kvm_debugregs > ( ) ;
237241 is_serde_json :: < kvm_xsave > ( ) ;
242+ #[ cfg( feature = "fam-wrappers" ) ]
238243 is_serde_json :: < kvm_xsave2 > ( ) ;
239244 is_serde_json :: < kvm_xcr > ( ) ;
240245 is_serde_json :: < kvm_xcrs > ( ) ;
0 commit comments