-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make kernel bindings 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]>
- Loading branch information
1 parent
7b1ddde
commit 190dbaa
Showing
3 changed files
with
39 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#[cfg(feature = "kvm-v4_14_0")] | ||
// Export 4.14 bindings when the feature kvm-v4_20_0 is not specified. | ||
#[cfg(all(feature = "kvm-v4_14_0", not(feature = "kvm-v4_20_0")))] | ||
mod bindings_v4_14_0; | ||
#[cfg(feature = "kvm-v4_20_0")] | ||
mod bindings_v4_20_0; | ||
|
||
// Major hack to have a default version in case no feature is specified: | ||
// If no version is specified by using the features, just use the latest one | ||
// which currently is 4.20. | ||
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))] | ||
// Export 4.20 bindings when kvm-v4_20_0 is specified or no kernel version | ||
// related features are specified. | ||
#[cfg(any( | ||
feature = "kvm-v4_20_0", | ||
all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")) | ||
))] | ||
mod bindings_v4_20_0; | ||
|
||
pub mod bindings { | ||
#[cfg(feature = "kvm-v4_14_0")] | ||
#[cfg(all(feature = "kvm-v4_14_0", not(feature = "kvm-v4_20_0")))] | ||
pub use super::bindings_v4_14_0::*; | ||
|
||
#[cfg(feature = "kvm-v4_20_0")] | ||
pub use super::bindings_v4_20_0::*; | ||
|
||
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))] | ||
#[cfg(any( | ||
feature = "kvm-v4_20_0", | ||
all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")) | ||
))] | ||
pub use super::bindings_v4_20_0::*; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#[cfg(feature = "kvm-v4_14_0")] | ||
// Export 4.14 bindings when the feature kvm-v4_20_0 is not specified. | ||
#[cfg(all(feature = "kvm-v4_14_0", not(feature = "kvm-v4_20_0")))] | ||
mod bindings_v4_14_0; | ||
#[cfg(feature = "kvm-v4_20_0")] | ||
mod bindings_v4_20_0; | ||
|
||
// Major hack to have a default version in case no feature is specified: | ||
// If no version is specified by using the features, just use the latest one | ||
// which currently is 4.20. | ||
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))] | ||
// Export 4.20 bindings when kvm-v4_20_0 is specified or no kernel version | ||
// related features are specified. | ||
#[cfg(any( | ||
feature = "kvm-v4_20_0", | ||
all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")) | ||
))] | ||
mod bindings_v4_20_0; | ||
|
||
pub mod bindings { | ||
#[cfg(feature = "kvm-v4_14_0")] | ||
#[cfg(all(feature = "kvm-v4_14_0", not(feature = "kvm-v4_20_0")))] | ||
pub use super::bindings_v4_14_0::*; | ||
|
||
#[cfg(feature = "kvm-v4_20_0")] | ||
pub use super::bindings_v4_20_0::*; | ||
|
||
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))] | ||
#[cfg(any( | ||
feature = "kvm-v4_20_0", | ||
all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")) | ||
))] | ||
pub use super::bindings_v4_20_0::*; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters