Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit e9905ee

Browse files
make kernel bindings are mutually exclusive
When the crate is built with --all-features we have a bunch of errors because we are not excluding the 4.14 and 4.20 bindings. Whenever all features is specified now, the 4.20 bindings are going to be used. This change is required for switching to rust-vmm-ci where the tests are run using --all-features flag. Signed-off-by: Andreea Florescu <[email protected]>
1 parent 8f8f2f0 commit e9905ee

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/x86/mod.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44
#[cfg(feature = "fam-wrappers")]
55
mod fam_wrappers;
66

7-
#[cfg(feature = "kvm-v4_14_0")]
7+
// Export 4.14 bindings when the feature kvm-v4_20_0 is not specified.
8+
#[cfg(all(feature = "kvm-v4_14_0", not(feature = "kvm-v4_20_0")))]
89
mod bindings_v4_14_0;
9-
#[cfg(feature = "kvm-v4_20_0")]
10-
mod bindings_v4_20_0;
1110

12-
// Major hack to have a default version in case no feature is specified:
13-
// If no version is specified by using the features, just use the latest one
14-
// which currently is 4.20.
15-
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))]
11+
// Export 4.20 bindings when kvm-v4_20_0 is specified or no kernel version
12+
// related features are specified.
13+
#[cfg(any(
14+
feature = "kvm-v4_20_0",
15+
all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0"))
16+
))]
1617
mod bindings_v4_20_0;
1718

1819
pub mod bindings {
19-
#[cfg(feature = "kvm-v4_14_0")]
20+
#[cfg(all(feature = "kvm-v4_14_0", not(feature = "kvm-v4_20_0")))]
2021
pub use super::bindings_v4_14_0::*;
2122

22-
#[cfg(feature = "kvm-v4_20_0")]
23-
pub use super::bindings_v4_20_0::*;
24-
25-
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))]
23+
#[cfg(any(
24+
feature = "kvm-v4_20_0",
25+
all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0"))
26+
))]
2627
pub use super::bindings_v4_20_0::*;
27-
2828
#[cfg(feature = "fam-wrappers")]
2929
pub use super::fam_wrappers::*;
3030
}

0 commit comments

Comments
 (0)