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/kvm.rs.html | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'src/kvm_rs/kvm.rs.html') diff --git a/src/kvm_rs/kvm.rs.html b/src/kvm_rs/kvm.rs.html index 7e2fdef..5e4b2f5 100644 --- a/src/kvm_rs/kvm.rs.html +++ b/src/kvm_rs/kvm.rs.html @@ -1,6 +1,9 @@ -kvm.rs - source - -
 1
+kvm.rs - source
+    
+    
 1
  2
  3
  4
@@ -73,15 +76,14 @@
 71
 72
 73
-
-//! KVM system ioctls.
+
//! KVM system ioctls.
 
 use std::fs;
 use std::io;
 use std::os::unix::io::FromRawFd;
 
-use crate::cap::{CapBool, CapInt};
-use crate::vm::Vm;
+use crate::cap::{CapBool, CapInt};
+use crate::vm::Vm;
 use crate::{ioctl, kvm_sys, libcret};
 
 /// Wrapper for `/dev/kvm` ioctls.
@@ -96,7 +98,7 @@
 
 impl Kvm {
     /// Open the `/dev/kvm` device.
-    pub fn new() -> io::Result<Kvm> {
+    pub fn new() -> io::Result<Kvm> {
         let kvm = libcret(unsafe {
             libc::open("/dev/kvm\0".as_ptr().cast(), libc::O_RDWR | libc::O_CLOEXEC)
         })
@@ -110,7 +112,7 @@
         Ok(Kvm { kvm })
     }
 
-    fn get_vpcu_mmap_size(&self) -> io::Result<usize> {
+    fn get_vpcu_mmap_size(&self) -> io::Result<usize> {
         ioctl(&self.kvm, kvm_sys::KVM_GET_VCPU_MMAP_SIZE, 0).map(|size| size as usize)
     }
 
@@ -118,7 +120,7 @@
     /// Returns a wrapper [`vm::Vm`][crate::vm::Vm] representing the VM.
     ///
     /// [kvm-create-vm]: https://www.kernel.org/doc/html/latest/virt/kvm/api.html#kvm-create-vm
-    pub fn create_vm(&self) -> io::Result<Vm> {
+    pub fn create_vm(&self) -> io::Result<Vm> {
         let vm = ioctl(&self.kvm, kvm_sys::KVM_CREATE_VM, 0 /* machine id */)
             .map(|fd| unsafe { fs::File::from_raw_fd(fd) })?;
 
@@ -131,7 +133,7 @@
     /// ioctl.
     ///
     /// [kvm-check-extension]: https://www.kernel.org/doc/html/latest/virt/kvm/api.html#kvm-check-extension
-    pub fn check_extenstion(&self, cap: CapBool) -> bool {
+    pub fn check_extenstion(&self, cap: CapBool) -> bool {
         let ret = ioctl(&self.kvm, kvm_sys::KVM_CHECK_EXTENSION, cap.into());
 
         matches!(ret, Ok(ret) if ret > 0)
@@ -141,11 +143,12 @@
     /// ioctl.
     ///
     /// [kvm-check-extension]: https://www.kernel.org/doc/html/latest/virt/kvm/api.html#kvm-check-extension
-    pub fn check_extenstion_int(&self, cap: CapInt) -> i32 {
+    pub fn check_extenstion_int(&self, cap: CapInt) -> i32 {
         let ret = ioctl(&self.kvm, kvm_sys::KVM_CHECK_EXTENSION, cap.into());
 
         ret.unwrap_or(0)
     }
 }
-
-
\ No newline at end of file +
+
+ \ No newline at end of file -- cgit v1.2.3