From 39bc444db4c54a6d16d96a7079291837c48b979c Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 13 Jul 2021 16:04:32 +0000 Subject: [PATCH] vmm, vm-device: make use of the kvm feature gate in vfio-ioctls The vfio-ioctls crate now contains a KVM feature gate. Make use of it in Cloud Hypervisor. That crate has two users. For the vmm crate is it straight-forward. For the vm-device crate, we introduce a KVM feature gate as well so that the vmm crate can pass on the configuration. Signed-off-by: Wei Liu --- vm-device/Cargo.toml | 6 +++++- vmm/Cargo.toml | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/vm-device/Cargo.toml b/vm-device/Cargo.toml index 0dc6891f9..d16bb9659 100644 --- a/vm-device/Cargo.toml +++ b/vm-device/Cargo.toml @@ -4,13 +4,17 @@ version = "0.1.0" authors = ["The Cloud Hypervisor Authors"] edition = "2018" +[features] +default = [] +kvm = ["vfio-ioctls/kvm"] + [dependencies] anyhow = "1.0" thiserror = "1.0" serde = {version = ">=1.0.27", features = ["rc"] } serde_derive = ">=1.0.27" serde_json = ">=1.0.9" -vfio-ioctls = { git = "https://github.com/rust-vmm/vfio-ioctls", branch = "master" } +vfio-ioctls = { git = "https://github.com/rust-vmm/vfio-ioctls", branch = "master", default-features = false } vm-memory = { version = "0.5.0", features = ["backend-mmap"] } vmm-sys-util = ">=0.3.1" diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index 25f38450a..a7b1f005b 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -9,7 +9,7 @@ default = [] acpi = ["acpi_tables","devices/acpi", "arch/acpi"] cmos = ["devices/cmos"] fwdebug = ["devices/fwdebug"] -kvm = ["hypervisor/kvm"] +kvm = ["hypervisor/kvm", "vfio-ioctls/kvm", "vm-device/kvm"] mshv = ["hypervisor/mshv"] io_uring = ["virtio-devices/io_uring"] tdx = ["arch/tdx", "hypervisor/tdx"] @@ -44,7 +44,7 @@ thiserror = "1.0" uuid = "0.8" versionize = "0.1.6" versionize_derive = "0.1.4" -vfio-ioctls = { git = "https://github.com/rust-vmm/vfio-ioctls", branch = "master" } +vfio-ioctls = { git = "https://github.com/rust-vmm/vfio-ioctls", branch = "master", default-features = false } virtio-devices = { path = "../virtio-devices" } vm-allocator = { path = "../vm-allocator" } vm-device = { path = "../vm-device" }