diff --git a/Cargo.lock b/Cargo.lock index 9ab15008a..ed1fb4e13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -690,8 +690,8 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "vfio", "vfio-bindings", + "vfio-ioctls", "vm-allocator", "vm-device", "vm-memory", @@ -1345,7 +1345,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] -name = "vfio" +name = "vfio-bindings" +version = "0.2.0" +source = "git+https://github.com/rust-vmm/vfio-bindings#f08cbcbf4041c981441d9c036c49ebad5098ed1c" +dependencies = [ + "vmm-sys-util", +] + +[[package]] +name = "vfio-ioctls" version = "0.0.1" dependencies = [ "arc-swap", @@ -1360,14 +1368,6 @@ dependencies = [ "vmm-sys-util", ] -[[package]] -name = "vfio-bindings" -version = "0.2.0" -source = "git+https://github.com/rust-vmm/vfio-bindings#f08cbcbf4041c981441d9c036c49ebad5098ed1c" -dependencies = [ - "vmm-sys-util", -] - [[package]] name = "vhost" version = "0.1.0" @@ -1547,7 +1547,7 @@ dependencies = [ "signal-hook", "tempfile", "url", - "vfio", + "vfio-ioctls", "vm-allocator", "vm-device", "vm-memory", diff --git a/Cargo.toml b/Cargo.toml index 9ced8b3b6..b4d1e1cd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,7 +63,7 @@ members = [ "vhost_user_backend", "vhost_user_fs", "vhost_user_net", - "vfio", + "vfio-ioctls", "net_util", "acpi_tables", "arch_gen", diff --git a/pci/Cargo.toml b/pci/Cargo.toml index 0b7d39ab8..1ff641f07 100644 --- a/pci/Cargo.toml +++ b/pci/Cargo.toml @@ -10,7 +10,7 @@ byteorder = "1.3.4" devices = { path = "../devices" } kvm-bindings = { git = "https://github.com/cloud-hypervisor/kvm-bindings", branch = "ch" } kvm-ioctls = { git = "https://github.com/cloud-hypervisor/kvm-ioctls", branch = "ch" } -vfio = { path = "../vfio" } +vfio-ioctls = { path = "../vfio-ioctls" } vmm-sys-util = ">=0.3.1" libc = "0.2.71" log = "0.4.8" diff --git a/pci/src/vfio.rs b/pci/src/vfio.rs index f7303901a..96e633728 100644 --- a/pci/src/vfio.rs +++ b/pci/src/vfio.rs @@ -20,8 +20,8 @@ use std::os::unix::io::AsRawFd; use std::ptr::null_mut; use std::sync::Arc; use std::{fmt, io, result}; -use vfio::{VfioDevice, VfioError}; use vfio_bindings::bindings::vfio::*; +use vfio_ioctls::{VfioDevice, VfioError}; use vm_allocator::SystemAllocator; use vm_device::interrupt::{ InterruptIndex, InterruptManager, InterruptSourceGroup, MsiIrqGroupConfig, diff --git a/vfio/Cargo.toml b/vfio-ioctls/Cargo.toml similarity index 96% rename from vfio/Cargo.toml rename to vfio-ioctls/Cargo.toml index 7eea2a7a0..aa503abd2 100644 --- a/vfio/Cargo.toml +++ b/vfio-ioctls/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "vfio" +name = "vfio-ioctls" version = "0.0.1" authors = ["The Cloud Hypervisor Authors"] diff --git a/vfio/src/lib.rs b/vfio-ioctls/src/lib.rs similarity index 100% rename from vfio/src/lib.rs rename to vfio-ioctls/src/lib.rs diff --git a/vfio/src/vfio_device.rs b/vfio-ioctls/src/vfio_device.rs similarity index 100% rename from vfio/src/vfio_device.rs rename to vfio-ioctls/src/vfio_device.rs diff --git a/vfio/src/vfio_ioctls.rs b/vfio-ioctls/src/vfio_ioctls.rs similarity index 100% rename from vfio/src/vfio_ioctls.rs rename to vfio-ioctls/src/vfio_ioctls.rs diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index a0ee7f9f1..26e25f1af 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" [features] default = [] acpi = ["acpi_tables","devices/acpi", "arch/acpi"] -pci_support = ["pci", "vfio", "vm-virtio/pci_support"] +pci_support = ["pci", "vfio-ioctls", "vm-virtio/pci_support"] mmio_support = ["vm-virtio/mmio_support"] cmos = ["devices/cmos"] fwdebug = ["devices/fwdebug"] @@ -34,7 +34,7 @@ serde = {version = ">=1.0.27", features = ["rc"] } serde_derive = ">=1.0.27" serde_json = ">=1.0.9" url = "2.1.1" -vfio = { path = "../vfio", optional = true } +vfio-ioctls = { path = "../vfio-ioctls", optional = true } vm-allocator = { path = "../vm-allocator" } vm-device = { path = "../vm-device" } vm-memory = { version = "0.2.1", features = ["backend-mmap", "backend-atomic"] } diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 3894221fe..b32fb8888 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -55,7 +55,7 @@ use std::result; use std::sync::{Arc, Mutex}; use tempfile::NamedTempFile; #[cfg(feature = "pci_support")] -use vfio::{VfioDevice, VfioDmaMapping}; +use vfio_ioctls::{VfioDevice, VfioDmaMapping}; use vm_allocator::SystemAllocator; use vm_device::interrupt::{ InterruptIndex, InterruptManager, LegacyIrqGroupConfig, MsiIrqGroupConfig, @@ -212,7 +212,7 @@ pub enum DeviceManagerError { /// Cannot create a VFIO device #[cfg(feature = "pci_support")] - VfioCreate(vfio::VfioError), + VfioCreate(vfio_ioctls::VfioError), /// Cannot create a VFIO PCI device #[cfg(feature = "pci_support")] diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 2058ebda3..8259ec5f3 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -20,7 +20,6 @@ extern crate linux_loader; extern crate net_util; extern crate signal_hook; #[cfg(feature = "pci_support")] -extern crate vfio; extern crate vm_allocator; extern crate vm_memory; extern crate vm_virtio;