diff --git a/Cargo.lock b/Cargo.lock index 01da25c9e..1a5dfee62 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,7 +36,7 @@ dependencies = [ "arch_gen 0.1.0", "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvm-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "kvm-ioctls 0.2.0 (git+https://github.com/rust-vmm/kvm-ioctls)", + "kvm-ioctls 0.3.0 (git+https://github.com/rust-vmm/kvm-ioctls)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "linux-loader 0.1.0 (git+https://github.com/rust-vmm/linux-loader)", "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -227,7 +227,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "epoll 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvm-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "kvm-ioctls 0.2.0 (git+https://github.com/rust-vmm/kvm-ioctls)", + "kvm-ioctls 0.3.0 (git+https://github.com/rust-vmm/kvm-ioctls)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -333,11 +333,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "kvm-ioctls" -version = "0.2.0" -source = "git+https://github.com/rust-vmm/kvm-ioctls#30adb021584845eed4124bc8ef3b2b96cd9e159f" +version = "0.3.0" +source = "git+https://github.com/rust-vmm/kvm-ioctls#681745a7776d60e390bcf62eefd48531a5f8ec47" dependencies = [ "kvm-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "vmm-sys-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -961,7 +962,7 @@ dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "devices 0.1.0", "kvm-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "kvm-ioctls 0.2.0 (git+https://github.com/rust-vmm/kvm-ioctls)", + "kvm-ioctls 0.3.0 (git+https://github.com/rust-vmm/kvm-ioctls)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pci 0.1.0", @@ -1065,7 +1066,7 @@ dependencies = [ "devices 0.1.0", "epoll 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvm-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "kvm-ioctls 0.2.0 (git+https://github.com/rust-vmm/kvm-ioctls)", + "kvm-ioctls 0.3.0 (git+https://github.com/rust-vmm/kvm-ioctls)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", "linux-loader 0.1.0 (git+https://github.com/rust-vmm/linux-loader)", @@ -1181,7 +1182,7 @@ dependencies = [ "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvm-bindings 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c223e8703d2eb76d990c5f58e29c85b0f6f50e24b823babde927948e7c71fc03" -"checksum kvm-ioctls 0.2.0 (git+https://github.com/rust-vmm/kvm-ioctls)" = "" +"checksum kvm-ioctls 0.3.0 (git+https://github.com/rust-vmm/kvm-ioctls)" = "" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" "checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" "checksum libssh2-sys 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "5fcd5a428a31cbbfe059812d74f4b6cd3b9b7426c2bdaec56993c5365da1c328" diff --git a/Cargo.toml b/Cargo.toml index abad49449..83d522d13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ virtio-bindings = "0.1.0" vmm = { path = "vmm" } vm-device = { path = "vm-device" } vm-memory = { git = "https://github.com/rust-vmm/vm-memory" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" vm-virtio = { path = "vm-virtio" } [dev-dependencies] diff --git a/arch/src/x86_64/regs.rs b/arch/src/x86_64/regs.rs index 2ab6c26b4..87a9872ec 100644 --- a/arch/src/x86_64/regs.rs +++ b/arch/src/x86_64/regs.rs @@ -84,7 +84,9 @@ pub fn setup_msrs(vcpu: &VcpuFd) -> Result<()> { msrs.nmsrs = entry_vec.len() as u32; vcpu.set_msrs(msrs) - .map_err(Error::SetModelSpecificRegisters) + .map_err(Error::SetModelSpecificRegisters)?; + + Ok(()) } /// Configure base registers for a given CPU. diff --git a/devices/Cargo.toml b/devices/Cargo.toml index d82ea3b46..7774e1bc0 100644 --- a/devices/Cargo.toml +++ b/devices/Cargo.toml @@ -11,7 +11,7 @@ kvm-ioctls = { git = "https://github.com/rust-vmm/kvm-ioctls", branch = "master" libc = "0.2.60" log = "0.4.8" vm-memory = { git = "https://github.com/rust-vmm/vm-memory" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" [dev-dependencies] tempfile = "3.1.0" diff --git a/net_gen/Cargo.toml b/net_gen/Cargo.toml index 849ea2581..e64b3d47d 100644 --- a/net_gen/Cargo.toml +++ b/net_gen/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" authors = ["The Chromium OS Authors"] [dependencies] -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" diff --git a/net_util/Cargo.toml b/net_util/Cargo.toml index fed394fc3..02b55954f 100644 --- a/net_util/Cargo.toml +++ b/net_util/Cargo.toml @@ -7,7 +7,7 @@ authors = ["The Chromium OS Authors"] libc = "0.2.60" rand = "0.7.0" serde = "1.0.98" -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" net_gen = { path = "../net_gen" } diff --git a/pci/Cargo.toml b/pci/Cargo.toml index ea849f605..ca4806f75 100644 --- a/pci/Cargo.toml +++ b/pci/Cargo.toml @@ -11,4 +11,4 @@ devices = { path = "../devices" } libc = "0.2.60" log = "0.4.8" vm-memory = { git = "https://github.com/rust-vmm/vm-memory" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" diff --git a/qcow/Cargo.toml b/qcow/Cargo.toml index b53cc93e6..b85dde909 100755 --- a/qcow/Cargo.toml +++ b/qcow/Cargo.toml @@ -13,7 +13,7 @@ byteorder = "1.3.2" libc = "0.2.60" log = "0.4.8" remain = "0.1.3" -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" [dev-dependencies] tempfile = "3.1.0" diff --git a/vfio/Cargo.toml b/vfio/Cargo.toml index bc97afa64..e315e910a 100644 --- a/vfio/Cargo.toml +++ b/vfio/Cargo.toml @@ -14,7 +14,7 @@ pci = { path = "../pci" } vfio-bindings = "0.1.0" vm-allocator = { path = "../vm-allocator" } vm-device = { path = "../vm-device" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" [dependencies.vm-memory] git = "https://github.com/rust-vmm/vm-memory" diff --git a/vfio/src/vfio_pci.rs b/vfio/src/vfio_pci.rs index 1122a11fe..b4d413370 100644 --- a/vfio/src/vfio_pci.rs +++ b/vfio/src/vfio_pci.rs @@ -240,7 +240,7 @@ impl InterruptRoute { let irq_fd = EventFd::new(libc::EFD_NONBLOCK).map_err(VfioPciError::EventFd)?; let gsi = allocator.allocate_gsi().ok_or(VfioPciError::AllocateGsi)?; - vm.register_irqfd(irq_fd.as_raw_fd(), gsi) + vm.register_irqfd(&irq_fd, gsi) .map_err(VfioPciError::IrqFd)?; Ok(InterruptRoute { diff --git a/vhost_rs/Cargo.toml b/vhost_rs/Cargo.toml index 77468b57a..9a6a939df 100644 --- a/vhost_rs/Cargo.toml +++ b/vhost_rs/Cargo.toml @@ -15,7 +15,7 @@ vhost-user-slave = [] [dependencies] bitflags = "1.1.0" libc = "0.2.60" -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" [dependencies.vm-memory] git = "https://github.com/rust-vmm/vm-memory" diff --git a/vhost_user_backend/Cargo.toml b/vhost_user_backend/Cargo.toml index d370434aa..59450317b 100644 --- a/vhost_user_backend/Cargo.toml +++ b/vhost_user_backend/Cargo.toml @@ -14,7 +14,7 @@ epoll = "4.1.0" libc = "0.2.65" vm-memory = { git = "https://github.com/rust-vmm/vm-memory" } vm-virtio = { path = "../vm-virtio" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" [dependencies.vhost_rs] path = "../vhost_rs" diff --git a/vm-virtio/Cargo.toml b/vm-virtio/Cargo.toml index 6fa7b67a9..6009b8fce 100644 --- a/vm-virtio/Cargo.toml +++ b/vm-virtio/Cargo.toml @@ -22,7 +22,7 @@ tempfile = "3.1.0" virtio-bindings = { git = "https://github.com/rust-vmm/virtio-bindings", version = "0.1", features = ["virtio-v5_0_0"]} vm-allocator = { path = "../vm-allocator" } vm-device = { path = "../vm-device" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" [dependencies.vhost_rs] path = "../vhost_rs" diff --git a/vmm/Cargo.toml b/vmm/Cargo.toml index 7e928d71a..b83b37863 100644 --- a/vmm/Cargo.toml +++ b/vmm/Cargo.toml @@ -31,7 +31,7 @@ serde_json = ">=1.0.9" vfio = { path = "../vfio", optional = true } vm-allocator = { path = "../vm-allocator" } vm-virtio = { path = "../vm-virtio" } -vmm-sys-util = "0.2.0" +vmm-sys-util = ">=0.1.1" signal-hook = "0.1.10" threadpool = "1.0" diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 1f0324a01..cac505d9d 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -362,8 +362,7 @@ impl DeviceRelocation for AddressManager { if bar_addr == new_base { for (event, addr, _) in virtio_pci_dev.ioeventfds(new_base) { let io_addr = IoEventAddress::Mmio(addr); - self.vm_fd - .register_ioevent(event.as_raw_fd(), &io_addr, NoDatamatch)?; + self.vm_fd.register_ioevent(event, &io_addr, NoDatamatch)?; } } } @@ -442,7 +441,7 @@ impl DeviceManager { let serial_evt = EventFd::new(EFD_NONBLOCK).map_err(DeviceManagerError::EventFd)?; vm_info .vm_fd - .register_irqfd(serial_evt.as_raw_fd(), serial_irq as u32) + .register_irqfd(&serial_evt, serial_irq as u32) .map_err(DeviceManagerError::Irq)?; Box::new(KernelIoapicIrq::new(serial_evt)) @@ -1207,7 +1206,7 @@ impl DeviceManager { for (event, addr, _) in virtio_pci_device.ioeventfds(bar_addr) { let io_addr = IoEventAddress::Mmio(addr); vm_fd - .register_ioevent(event.as_raw_fd(), &io_addr, NoDatamatch) + .register_ioevent(event, &io_addr, NoDatamatch) .map_err(DeviceManagerError::RegisterIoevent)?; } @@ -1264,7 +1263,7 @@ impl DeviceManager { } else { let irqfd = EventFd::new(EFD_NONBLOCK).map_err(DeviceManagerError::EventFd)?; vm_fd - .register_irqfd(irqfd.as_raw_fd(), irq_num) + .register_irqfd(&irqfd, irq_num) .map_err(DeviceManagerError::Irq)?; Box::new(move |_p: InterruptParameters| irqfd.write(1)) as InterruptDelivery @@ -1318,7 +1317,7 @@ impl DeviceManager { mmio_base.0 + u64::from(vm_virtio::transport::NOTIFY_REG_OFFSET), ); vm_fd - .register_ioevent(queue_evt.as_raw_fd(), &io_addr, i as u32) + .register_ioevent(queue_evt, &io_addr, i as u32) .map_err(DeviceManagerError::RegisterIoevent)?; } @@ -1335,7 +1334,7 @@ impl DeviceManager { let irqfd = EventFd::new(EFD_NONBLOCK).map_err(DeviceManagerError::EventFd)?; vm_fd - .register_irqfd(irqfd.as_raw_fd(), irq_num as u32) + .register_irqfd(&irqfd, irq_num as u32) .map_err(DeviceManagerError::Irq)?; Box::new(KernelIoapicIrq::new(irqfd)) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index b8ff57ac1..b0a72538c 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -251,7 +251,7 @@ impl CpuidPatch { reg: CpuidReg, value: u32, ) { - let entries = cpuid.mut_entries_slice(); + let entries = cpuid.as_mut_slice(); for entry in entries.iter_mut() { if entry.function == function && (index == None || index.unwrap() == entry.index) { @@ -274,7 +274,7 @@ impl CpuidPatch { } fn patch_cpuid(cpuid: &mut CpuId, patches: Vec) { - let entries = cpuid.mut_entries_slice(); + let entries = cpuid.as_mut_slice(); for entry in entries.iter_mut() { for patch in patches.iter() {