2
2
// SPDX-License-Identifier: Apache-2.0
3
3
/* automatically generated by rust-bindgen */
4
4
5
+ use versionize:: { VersionMap , Versionize , VersionizeResult } ;
6
+ use versionize_derive:: Versionize ;
7
+
5
8
#[ repr( C ) ]
6
9
#[ derive( Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd ) ]
7
10
pub struct __BindgenBitfieldUnit < Storage , Align >
11
14
storage : Storage ,
12
15
align : [ Align ; 0 ] ,
13
16
}
17
+ // Implementing Versionize by hand due to some weird errors when trying to derive (most likely
18
+ // because versionize_derive does not support structs with generics at this point).
19
+ impl < Storage , Align > Versionize for __BindgenBitfieldUnit < Storage , Align >
20
+ where
21
+ Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] > + Versionize ,
22
+ {
23
+ fn serialize < W : std:: io:: Write > (
24
+ & self ,
25
+ writer : & mut W ,
26
+ version_map : & VersionMap ,
27
+ app_version : u16 ,
28
+ ) -> VersionizeResult < ( ) > {
29
+ Versionize :: serialize ( & self . storage , writer, version_map, app_version)
30
+ }
31
+
32
+ fn deserialize < R : std:: io:: Read > (
33
+ reader : & mut R ,
34
+ version_map : & VersionMap ,
35
+ app_version : u16 ,
36
+ ) -> VersionizeResult < Self > {
37
+ let storage = Versionize :: deserialize ( reader, version_map, app_version) ?;
38
+
39
+ Ok ( __BindgenBitfieldUnit { storage, align : [ ] } )
40
+ }
41
+
42
+ fn version ( ) -> u16 {
43
+ 1
44
+ }
45
+ }
14
46
impl < Storage , Align > __BindgenBitfieldUnit < Storage , Align >
15
47
where
16
48
Storage : AsRef < [ u8 ] > + AsMut < [ u8 ] > ,
@@ -120,6 +152,31 @@ impl<T> ::std::clone::Clone for __IncompleteArrayField<T> {
120
152
Self :: new ( )
121
153
}
122
154
}
155
+ impl < T > Versionize for __IncompleteArrayField < T > {
156
+ #[ inline]
157
+ fn serialize < W : std:: io:: Write > (
158
+ & self ,
159
+ _writer : & mut W ,
160
+ _version_map : & VersionMap ,
161
+ _app_version : u16 ,
162
+ ) -> VersionizeResult < ( ) > {
163
+ Ok ( ( ) )
164
+ }
165
+
166
+ #[ inline]
167
+ fn deserialize < R : std:: io:: Read > (
168
+ _reader : & mut R ,
169
+ _version_map : & VersionMap ,
170
+ _app_version : u16 ,
171
+ ) -> VersionizeResult < Self > {
172
+ Ok ( Self :: new ( ) )
173
+ }
174
+
175
+ // Not used.
176
+ fn version ( ) -> u16 {
177
+ 1
178
+ }
179
+ }
123
180
pub const __BITS_PER_LONG: u32 = 64 ;
124
181
pub const __FD_SETSIZE: u32 = 1024 ;
125
182
pub const _IOC_NRBITS: u32 = 8 ;
@@ -733,7 +790,7 @@ fn bindgen_test_layout_kvm_memory_alias() {
733
790
) ;
734
791
}
735
792
#[ repr( C ) ]
736
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
793
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
737
794
pub struct kvm_pic_state {
738
795
pub last_irr : __u8 ,
739
796
pub irr : __u8 ,
@@ -930,7 +987,7 @@ fn bindgen_test_layout_kvm_pic_state() {
930
987
) ;
931
988
}
932
989
#[ repr( C ) ]
933
- #[ derive( Copy , Clone ) ]
990
+ #[ derive( Copy , Clone , Versionize ) ]
934
991
pub struct kvm_ioapic_state {
935
992
pub base_address : __u64 ,
936
993
pub ioregsel : __u32 ,
@@ -940,14 +997,14 @@ pub struct kvm_ioapic_state {
940
997
pub redirtbl : [ kvm_ioapic_state__bindgen_ty_1 ; 24usize ] ,
941
998
}
942
999
#[ repr( C ) ]
943
- #[ derive( Copy , Clone ) ]
1000
+ #[ derive( Copy , Clone , Versionize ) ]
944
1001
pub union kvm_ioapic_state__bindgen_ty_1 {
945
1002
pub bits : __u64 ,
946
1003
pub fields : kvm_ioapic_state__bindgen_ty_1__bindgen_ty_1 ,
947
1004
_bindgen_union_align : u64 ,
948
1005
}
949
1006
#[ repr( C ) ]
950
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
1007
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
951
1008
pub struct kvm_ioapic_state__bindgen_ty_1__bindgen_ty_1 {
952
1009
pub vector : __u8 ,
953
1010
pub _bitfield_1 : __BindgenBitfieldUnit < [ u8 ; 2usize ] , u8 > ,
@@ -1270,7 +1327,7 @@ impl Default for kvm_ioapic_state {
1270
1327
}
1271
1328
}
1272
1329
#[ repr( C ) ]
1273
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
1330
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
1274
1331
pub struct kvm_regs {
1275
1332
pub rax : __u64 ,
1276
1333
pub rbx : __u64 ,
@@ -1485,7 +1542,7 @@ fn bindgen_test_layout_kvm_regs() {
1485
1542
) ;
1486
1543
}
1487
1544
#[ repr( C ) ]
1488
- #[ derive( Copy , Clone ) ]
1545
+ #[ derive( Copy , Clone , Versionize ) ]
1489
1546
pub struct kvm_lapic_state {
1490
1547
pub regs : [ :: std:: os:: raw:: c_char ; 1024usize ] ,
1491
1548
}
@@ -1518,7 +1575,7 @@ impl Default for kvm_lapic_state {
1518
1575
}
1519
1576
}
1520
1577
#[ repr( C ) ]
1521
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
1578
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
1522
1579
pub struct kvm_segment {
1523
1580
pub base : __u64 ,
1524
1581
pub limit : __u32 ,
@@ -1678,7 +1735,7 @@ fn bindgen_test_layout_kvm_segment() {
1678
1735
) ;
1679
1736
}
1680
1737
#[ repr( C ) ]
1681
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
1738
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
1682
1739
pub struct kvm_dtable {
1683
1740
pub base : __u64 ,
1684
1741
pub limit : __u16 ,
@@ -1728,7 +1785,7 @@ fn bindgen_test_layout_kvm_dtable() {
1728
1785
) ;
1729
1786
}
1730
1787
#[ repr( C ) ]
1731
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
1788
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
1732
1789
pub struct kvm_sregs {
1733
1790
pub cs : kvm_segment ,
1734
1791
pub ds : kvm_segment ,
@@ -2081,7 +2138,7 @@ fn bindgen_test_layout_kvm_fpu() {
2081
2138
) ;
2082
2139
}
2083
2140
#[ repr( C ) ]
2084
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
2141
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
2085
2142
pub struct kvm_msr_entry {
2086
2143
pub index : __u32 ,
2087
2144
pub reserved : __u32 ,
@@ -2131,7 +2188,7 @@ fn bindgen_test_layout_kvm_msr_entry() {
2131
2188
) ;
2132
2189
}
2133
2190
#[ repr( C ) ]
2134
- #[ derive( Debug , Default ) ]
2191
+ #[ derive( Debug , Default , Versionize ) ]
2135
2192
pub struct kvm_msrs {
2136
2193
pub nmsrs : __u32 ,
2137
2194
pub pad : __u32 ,
@@ -2353,7 +2410,7 @@ fn bindgen_test_layout_kvm_cpuid() {
2353
2410
) ;
2354
2411
}
2355
2412
#[ repr( C ) ]
2356
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
2413
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
2357
2414
pub struct kvm_cpuid_entry2 {
2358
2415
pub function : __u32 ,
2359
2416
pub index : __u32 ,
@@ -2458,7 +2515,7 @@ fn bindgen_test_layout_kvm_cpuid_entry2() {
2458
2515
) ;
2459
2516
}
2460
2517
#[ repr( C ) ]
2461
- #[ derive( Debug , Default ) ]
2518
+ #[ derive( Debug , Default , Versionize ) ]
2462
2519
pub struct kvm_cpuid2 {
2463
2520
pub nent : __u32 ,
2464
2521
pub padding : __u32 ,
@@ -2508,7 +2565,7 @@ fn bindgen_test_layout_kvm_cpuid2() {
2508
2565
) ;
2509
2566
}
2510
2567
#[ repr( C ) ]
2511
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
2568
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
2512
2569
pub struct kvm_pit_channel_state {
2513
2570
pub count : __u32 ,
2514
2571
pub latched_count : __u16 ,
@@ -2810,7 +2867,7 @@ fn bindgen_test_layout_kvm_pit_state() {
2810
2867
) ;
2811
2868
}
2812
2869
#[ repr( C ) ]
2813
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
2870
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
2814
2871
pub struct kvm_pit_state2 {
2815
2872
pub channels : [ kvm_pit_channel_state ; 3usize ] ,
2816
2873
pub flags : __u32 ,
@@ -2901,7 +2958,7 @@ fn bindgen_test_layout_kvm_reinject_control() {
2901
2958
) ;
2902
2959
}
2903
2960
#[ repr( C ) ]
2904
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
2961
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
2905
2962
pub struct kvm_vcpu_events {
2906
2963
pub exception : kvm_vcpu_events__bindgen_ty_1 ,
2907
2964
pub interrupt : kvm_vcpu_events__bindgen_ty_2 ,
@@ -2914,7 +2971,7 @@ pub struct kvm_vcpu_events {
2914
2971
pub exception_payload : __u64 ,
2915
2972
}
2916
2973
#[ repr( C ) ]
2917
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
2974
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
2918
2975
pub struct kvm_vcpu_events__bindgen_ty_1 {
2919
2976
pub injected : __u8 ,
2920
2977
pub nr : __u8 ,
@@ -2998,7 +3055,7 @@ fn bindgen_test_layout_kvm_vcpu_events__bindgen_ty_1() {
2998
3055
) ;
2999
3056
}
3000
3057
#[ repr( C ) ]
3001
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
3058
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
3002
3059
pub struct kvm_vcpu_events__bindgen_ty_2 {
3003
3060
pub injected : __u8 ,
3004
3061
pub nr : __u8 ,
@@ -3067,7 +3124,7 @@ fn bindgen_test_layout_kvm_vcpu_events__bindgen_ty_2() {
3067
3124
) ;
3068
3125
}
3069
3126
#[ repr( C ) ]
3070
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
3127
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
3071
3128
pub struct kvm_vcpu_events__bindgen_ty_3 {
3072
3129
pub injected : __u8 ,
3073
3130
pub pending : __u8 ,
@@ -3136,7 +3193,7 @@ fn bindgen_test_layout_kvm_vcpu_events__bindgen_ty_3() {
3136
3193
) ;
3137
3194
}
3138
3195
#[ repr( C ) ]
3139
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
3196
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
3140
3197
pub struct kvm_vcpu_events__bindgen_ty_4 {
3141
3198
pub smm : __u8 ,
3142
3199
pub pending : __u8 ,
@@ -3314,7 +3371,7 @@ fn bindgen_test_layout_kvm_vcpu_events() {
3314
3371
) ;
3315
3372
}
3316
3373
#[ repr( C ) ]
3317
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
3374
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
3318
3375
pub struct kvm_debugregs {
3319
3376
pub db : [ __u64 ; 4usize ] ,
3320
3377
pub dr6 : __u64 ,
@@ -3386,7 +3443,7 @@ fn bindgen_test_layout_kvm_debugregs() {
3386
3443
) ;
3387
3444
}
3388
3445
#[ repr( C ) ]
3389
- #[ derive( Copy , Clone ) ]
3446
+ #[ derive( Copy , Clone , Versionize ) ]
3390
3447
pub struct kvm_xsave {
3391
3448
pub region : [ __u32 ; 1024usize ] ,
3392
3449
}
@@ -3419,7 +3476,7 @@ impl Default for kvm_xsave {
3419
3476
}
3420
3477
}
3421
3478
#[ repr( C ) ]
3422
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
3479
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
3423
3480
pub struct kvm_xcr {
3424
3481
pub xcr : __u32 ,
3425
3482
pub reserved : __u32 ,
@@ -3469,7 +3526,7 @@ fn bindgen_test_layout_kvm_xcr() {
3469
3526
) ;
3470
3527
}
3471
3528
#[ repr( C ) ]
3472
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
3529
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
3473
3530
pub struct kvm_xcrs {
3474
3531
pub nr_xcrs : __u32 ,
3475
3532
pub flags : __u32 ,
@@ -4157,14 +4214,14 @@ impl Default for kvm_irq_level {
4157
4214
}
4158
4215
}
4159
4216
#[ repr( C ) ]
4160
- #[ derive( Copy , Clone ) ]
4217
+ #[ derive( Copy , Clone , Versionize ) ]
4161
4218
pub struct kvm_irqchip {
4162
4219
pub chip_id : __u32 ,
4163
4220
pub pad : __u32 ,
4164
4221
pub chip : kvm_irqchip__bindgen_ty_1 ,
4165
4222
}
4166
4223
#[ repr( C ) ]
4167
- #[ derive( Copy , Clone ) ]
4224
+ #[ derive( Copy , Clone , Versionize ) ]
4168
4225
pub union kvm_irqchip__bindgen_ty_1 {
4169
4226
pub dummy : [ :: std:: os:: raw:: c_char ; 512usize ] ,
4170
4227
pub pic : kvm_pic_state ,
@@ -7058,7 +7115,7 @@ fn bindgen_test_layout_kvm_vapic_addr() {
7058
7115
) ;
7059
7116
}
7060
7117
#[ repr( C ) ]
7061
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
7118
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
7062
7119
pub struct kvm_mp_state {
7063
7120
pub mp_state : __u32 ,
7064
7121
}
@@ -9121,7 +9178,7 @@ fn bindgen_test_layout_kvm_irqfd() {
9121
9178
) ;
9122
9179
}
9123
9180
#[ repr( C ) ]
9124
- #[ derive( Debug , Default , Copy , Clone , PartialEq ) ]
9181
+ #[ derive( Debug , Default , Copy , Clone , PartialEq , Versionize ) ]
9125
9182
pub struct kvm_clock_data {
9126
9183
pub clock : __u64 ,
9127
9184
pub flags : __u32 ,
0 commit comments