cargo: Update to the latest kvm-ioctls version

We need to rely on the latest kvm-ioctls version to benefit from the
recent addition of unregister_ioevent(), allowing us to detach a
previously registered eventfd to a PIO or MMIO guest address.

Because of this update, we had to modify the current constraint we had
on the vmm-sys-util crate, using ">= 0.1.1" instead of being strictly
tied to "0.2.0".

Once the dependency conflict resolved, this commit took care of fixing
build issues caused by recent modification of kvm-ioctls relying on
EventFd reference instead of RawFd.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2019-10-30 09:38:38 -07:00 committed by Samuel Ortiz
parent c7cabc88b4
commit 587a420429
16 changed files with 31 additions and 29 deletions

15
Cargo.lock generated
View File

@ -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)" = "<none>"
"checksum kvm-ioctls 0.3.0 (git+https://github.com/rust-vmm/kvm-ioctls)" = "<none>"
"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"

View File

@ -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]

View File

@ -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.

View File

@ -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"

View File

@ -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"

View File

@ -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" }

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 {

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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))

View File

@ -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<CpuidPatch>) {
let entries = cpuid.mut_entries_slice();
let entries = cpuid.as_mut_slice();
for entry in entries.iter_mut() {
for patch in patches.iter() {