cargo: Bump the kvm and vmm-sys-util crates

Since the kvm crates now depend on vmm-sys-util, the bump must be
atomic.
The kvm-bindings and ioctls 0.2.0 and 0.4.0 crates come with a few API
changes, one of them being the use of a kvm_ioctls specific error type.
Porting our code to that type makes for a fairly large diff stat.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2019-11-29 16:36:33 +01:00
committed by Rob Bradford
parent ca97385da5
commit 0f21781fbe
21 changed files with 112 additions and 127 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ pub enum VfioError {
UnsetContainer,
ContainerSetIOMMU,
GroupGetDeviceFD,
KvmSetDeviceAttr(io::Error),
KvmSetDeviceAttr(kvm_ioctls::Error),
VfioDeviceGetInfo,
VfioDeviceGetRegionInfo,
InvalidPath,
@@ -268,7 +268,7 @@ impl VfioGroup {
.map_err(VfioError::KvmSetDeviceAttr)
}
fn kvm_device_del_group(&self) -> std::result::Result<(), io::Error> {
fn kvm_device_del_group(&self) -> std::result::Result<(), kvm_ioctls::Error> {
let group_fd = self.as_raw_fd();
let group_fd_ptr = &group_fd as *const i32;
let dev_attr = kvm_bindings::kvm_device_attr {
+9 -5
View File
@@ -34,10 +34,10 @@ use vmm_sys_util::eventfd::EventFd;
pub enum VfioPciError {
AllocateGsi,
EventFd(io::Error),
IrqFd(io::Error),
IrqFd(kvm_ioctls::Error),
NewVfioPciDevice,
MapRegionGuest(io::Error),
SetGsiRouting(io::Error),
MapRegionGuest(kvm_ioctls::Error),
SetGsiRouting(kvm_ioctls::Error),
}
pub type Result<T> = std::result::Result<T, VfioPciError>;
@@ -1047,7 +1047,9 @@ impl PciDevice for VfioPciDevice {
};
// Safe because the guest regions are guaranteed not to overlap.
unsafe {
self.vm_fd.set_user_memory_region(old_mem_region)?;
self.vm_fd
.set_user_memory_region(old_mem_region)
.map_err(|e| io::Error::from_raw_os_error(e.errno()))?;
}
// Insert new region to KVM
@@ -1060,7 +1062,9 @@ impl PciDevice for VfioPciDevice {
};
// Safe because the guest regions are guaranteed not to overlap.
unsafe {
self.vm_fd.set_user_memory_region(new_mem_region)?;
self.vm_fd
.set_user_memory_region(new_mem_region)
.map_err(|e| io::Error::from_raw_os_error(e.errno()))?;
}
}
}