mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
ca97385da5
commit
0f21781fbe
+8
-5
@@ -70,10 +70,10 @@ pub enum Error {
|
||||
VmFd(io::Error),
|
||||
|
||||
/// Cannot create the KVM instance
|
||||
VmCreate(io::Error),
|
||||
VmCreate(kvm_ioctls::Error),
|
||||
|
||||
/// Cannot set the VM up
|
||||
VmSetup(io::Error),
|
||||
VmSetup(kvm_ioctls::Error),
|
||||
|
||||
/// Cannot open the kernel image
|
||||
KernelFile(io::Error),
|
||||
@@ -129,7 +129,7 @@ pub enum Error {
|
||||
ThreadCleanup,
|
||||
|
||||
/// Failed to create a new KVM instance
|
||||
KvmNew(io::Error),
|
||||
KvmNew(kvm_ioctls::Error),
|
||||
|
||||
/// VM is not created
|
||||
VmNotCreated,
|
||||
@@ -301,7 +301,10 @@ impl Vm {
|
||||
};
|
||||
|
||||
// Safe because the guest regions are guaranteed not to overlap.
|
||||
unsafe { fd.set_user_memory_region(mem_region) }?;
|
||||
unsafe {
|
||||
fd.set_user_memory_region(mem_region)
|
||||
.map_err(|e| io::Error::from_raw_os_error(e.errno()))
|
||||
}?;
|
||||
|
||||
// Mark the pages as mergeable if explicitly asked for.
|
||||
if config.memory.mergeable {
|
||||
@@ -393,7 +396,7 @@ impl Vm {
|
||||
|
||||
// Supported CPUID
|
||||
let mut cpuid = kvm
|
||||
.get_supported_cpuid(MAX_KVM_CPUID_ENTRIES)
|
||||
.get_supported_cpuid(kvm_bindings::KVM_MAX_CPUID_ENTRIES)
|
||||
.map_err(Error::VmSetup)?;
|
||||
|
||||
cpu::CpuidPatch::patch_cpuid(&mut cpuid, cpuid_patches);
|
||||
|
||||
Reference in New Issue
Block a user