From 74d1b6fd9991d1fb7dc19f09b06f7b2277874ece Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 16 Apr 2022 20:25:59 +0000 Subject: deploy: 38cd31ed203999122c500d389de38bb051ce979e --- src/kvm_rs/vm.rs.html | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'src/kvm_rs/vm.rs.html') diff --git a/src/kvm_rs/vm.rs.html b/src/kvm_rs/vm.rs.html index 609a857..4218bfc 100644 --- a/src/kvm_rs/vm.rs.html +++ b/src/kvm_rs/vm.rs.html @@ -1,6 +1,9 @@ -vm.rs - source - -
 1
+vm.rs - source
+    
+    
 1
  2
  3
  4
@@ -69,14 +72,13 @@
 67
 68
 69
-
-//! VM system ioctls.
+
//! VM system ioctls.
 
 use std::fs;
 use std::io;
 use std::os::unix::io::FromRawFd;
 
-use crate::vcpu::Vcpu;
+use crate::vcpu::Vcpu;
 use crate::{ioctl, kvm_sys, KvmRun, PhysAddr, UserMem};
 
 /// Wrapper for VM ioctls.
@@ -92,13 +94,13 @@
 }
 
 impl Vm {
-    pub(crate) fn new(vm: fs::File, vcpu_mmap_size: usize) -> Vm {
+    pub(crate) fn new(vm: fs::File, vcpu_mmap_size: usize) -> Vm {
         Vm { vm, vcpu_mmap_size }
     }
 
     /// Map memory from userspace into the VM as `guest physical` memory starting at address
     /// `phys_addr`.
-    /// The underlying operation is the [`KVM_SET_USER_MEMORY_REGION`][kmv-set-user-memory-region]
+    /// The underlying operation is the [`KVM_SET_USER_MEMORY_REGION`][kvm-set-user-memory-region]
     /// ioctl.
     ///
     /// # Safety
@@ -111,7 +113,7 @@
         &self,
         phys_addr: PhysAddr,
         mem: &UserMem,
-    ) -> io::Result<()> {
+    ) -> io::Result<()> {
         // Create guest physical memory mapping for `slot : 0` at guest `phys_addr`.
         let mut kvm_mem = kvm_sys::kvm_userspace_memory_region::default();
         kvm_mem.userspace_addr = mem.ptr as u64;
@@ -121,7 +123,7 @@
         ioctl(
             &self.vm,
             kvm_sys::KVM_SET_USER_MEMORY_REGION,
-            &kvm_mem as *const _ as u64,
+            &kvm_mem as *const _ as u64,
         )
         .map(|_| ())
     }
@@ -130,7 +132,7 @@
     /// Returns a wrapper [`vcpu::Vcpu`][crate::vcpu::Vcpu] representing the VCPU.
     ///
     /// [kvm-create-vcpu]: https://www.kernel.org/doc/html/latest/virt/kvm/api.html#kvm-create-vcpu
-    pub fn create_vpcu(&self, id: u64) -> io::Result<Vcpu> {
+    pub fn create_vpcu(&self, id: u64) -> io::Result<Vcpu> {
         let vcpu = ioctl(&self.vm, kvm_sys::KVM_CREATE_VCPU, id)
             .map(|fd| unsafe { fs::File::from_raw_fd(fd) })?;
 
@@ -139,5 +141,6 @@
         Ok(Vcpu::new(vcpu, kvm_run))
     }
 }
-
-
\ No newline at end of file +
+
+ \ No newline at end of file -- cgit v1.2.3