Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e68d57b

Browse files
committedNov 5, 2019
use a 'safe-wrappers' feature to gate the FamStructWrappers
The FamStructWrappers definitions as well as the vmm-sys-util dependency are now gated by an opt-in `safe-wrappers` feature. Signed-off-by: Adrian Catangiu <acatan@amazon.com>
1 parent ef8ecc4 commit e68d57b

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
 

‎Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ keywords = ["kvm"]
99
license = "Apache-2.0"
1010

1111
[features]
12+
default = []
1213
kvm-v4_14_0 = []
1314
kvm-v4_20_0 = []
15+
safe-wrappers = ["vmm-sys-util"]
1416

1517
[dependencies]
16-
vmm-sys-util = ">=0.2.0"
18+
vmm-sys-util = { version = ">=0.2.0", optional = true }

‎src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
#![allow(non_snake_case)]
77

88
#[macro_use]
9-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
9+
#[cfg(all(
10+
feature = "safe-wrappers",
11+
any(target_arch = "x86", target_arch = "x86_64")
12+
))]
1013
extern crate vmm_sys_util;
1114

1215
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]

‎src/x86/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
#[cfg(feature = "safe-wrappers")]
45
mod fam_wrappers;
56

67
#[cfg(feature = "kvm-v4_14_0")]
@@ -24,5 +25,6 @@ pub mod bindings {
2425
#[cfg(all(not(feature = "kvm-v4_14_0"), not(feature = "kvm-v4_20_0")))]
2526
pub use super::bindings_v4_20_0::*;
2627

28+
#[cfg(feature = "safe-wrappers")]
2729
pub use super::fam_wrappers::*;
2830
}

0 commit comments

Comments
 (0)
This repository has been archived.