diff --git a/.buildkite/custom-tests.json b/.buildkite/custom-tests.json index 6f581a4c..6f5415eb 100644 --- a/.buildkite/custom-tests.json +++ b/.buildkite/custom-tests.json @@ -1,61 +1,9 @@ { "tests": [ - { - "test_name": "build-gnu-mmap", - "command": "cargo build --release --features=xen", - "platform": ["x86_64", "aarch64"] - }, - { - "test_name": "build-gnu-mmap-no-xen", - "command": "cargo build --release --features=backend-mmap", - "platform": ["x86_64", "aarch64"] - }, - { - "test_name": "build-musl-mmap", - "command": "cargo build --release --features=xen --target {target_platform}-unknown-linux-musl", - "platform": ["x86_64", "aarch64"] - }, - { - "test_name": "build-musl-mmap-no-xen", - "command": "cargo build --release --features=backend-mmap --target {target_platform}-unknown-linux-musl", - "platform": ["x86_64", "aarch64"] - }, { "test_name": "miri", "command": "RUST_BACKTRACE=1 MIRIFLAGS='-Zmiri-disable-isolation -Zmiri-backtrace=full' cargo +nightly miri test --features backend-mmap,backend-bitmap", "platform": ["x86_64", "aarch64"] - }, - { - "test_name": "unittests-gnu-no-xen", - "command": "cargo test --features 'backend-bitmap backend-mmap backend-atomic' --workspace", - "platform": [ - "x86_64", - "aarch64" - ] - }, - { - "test_name": "unittests-musl-no-xen", - "command": "cargo test --features 'backend-bitmap backend-mmap backend-atomic' --workspace --target {target_platform}-unknown-linux-musl", - "platform": [ - "x86_64", - "aarch64" - ] - }, - { - "test_name": "clippy-no-xen", - "command": "cargo clippy --workspace --bins --examples --benches --features 'backend-bitmap backend-mmap backend-atomic' --all-targets -- -D warnings -D clippy::undocumented_unsafe_blocks", - "platform": [ - "x86_64", - "aarch64" - ] - }, - { - "test_name": "check-warnings-no-xen", - "command": "RUSTFLAGS=\"-D warnings\" cargo check --all-targets --features 'backend-bitmap backend-mmap backend-atomic' --workspace", - "platform": [ - "x86_64", - "aarch64" - ] } ] } diff --git a/Cargo.toml b/Cargo.toml index ace634a6..f26ed37c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,3 +47,6 @@ codegen-units = 1 [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.cargo-all-features] +skip_optional_dependencies = true \ No newline at end of file diff --git a/benches/mmap/mod.rs b/benches/mmap/mod.rs index f5f67335..4fdb8001 100644 --- a/benches/mmap/mod.rs +++ b/benches/mmap/mod.rs @@ -7,8 +7,11 @@ extern crate criterion; extern crate vm_memory; +#[cfg(feature = "rawfd")] use std::fs::{File, OpenOptions}; use std::mem::size_of; + +#[cfg(feature = "rawfd")] use std::path::Path; use core::hint::black_box; @@ -84,7 +87,10 @@ pub fn benchmark_for_mmap(c: &mut Criterion) { let mut image = make_image(ACCESS_SIZE); let buf = &mut [0u8; ACCESS_SIZE]; + + #[cfg(feature = "rawfd")] let mut file = File::open(Path::new("/dev/zero")).expect("Could not open /dev/zero"); + #[cfg(feature = "rawfd")] let mut file_to_write = OpenOptions::new() .write(true) .open("/dev/null") @@ -110,6 +116,7 @@ pub fn benchmark_for_mmap(c: &mut Criterion) { }) }); + #[cfg(feature = "rawfd")] c.bench_function(format!("read_from_file_{:#0X}", offset).as_str(), |b| { b.iter(|| { black_box(&memory) @@ -159,6 +166,7 @@ pub fn benchmark_for_mmap(c: &mut Criterion) { }) }); + #[cfg(feature = "rawfd")] c.bench_function(format!("write_to_file_{:#0X}", offset).as_str(), |b| { b.iter(|| { black_box(&memory) diff --git a/rust-vmm-ci b/rust-vmm-ci index c0f5d4c3..58dab8b1 160000 --- a/rust-vmm-ci +++ b/rust-vmm-ci @@ -1 +1 @@ -Subproject commit c0f5d4c3f58094c90ea12200f513b21e457983bd +Subproject commit 58dab8b1433c15e507edef64970a428c719ceda0 diff --git a/src/mmap/mod.rs b/src/mmap/mod.rs index 1ba59f54..286ded60 100644 --- a/src/mmap/mod.rs +++ b/src/mmap/mod.rs @@ -171,7 +171,7 @@ impl GuestMemoryRegionBytes for GuestRegionMmap {} /// virtual address space of the calling process. pub type GuestMemoryMmap = GuestRegionCollection>; -/// Errors that can happen during [`GuestMemoryMap::from_ranges`] and related functions. +/// Errors that can happen during [`GuestMemoryMmap::from_ranges`] and related functions. #[derive(Debug, thiserror::Error)] pub enum FromRangesError { /// Error during construction of [`GuestMemoryMmap`]