@@ -25,7 +25,7 @@ use crate::arch::x86_64::regs::{SetupFpuError, SetupRegistersError, SetupSpecial
2525use crate :: cpu_config:: x86_64:: { CpuConfiguration , cpuid} ;
2626use crate :: logger:: { IncMetric , METRICS } ;
2727use crate :: vstate:: memory:: GuestMemoryMmap ;
28- use crate :: vstate:: vcpu:: { VcpuConfig , VcpuEmulation } ;
28+ use crate :: vstate:: vcpu:: { VcpuConfig , VcpuEmulation , VcpuError } ;
2929use crate :: vstate:: vm:: Vm ;
3030
3131// Tolerance for TSC frequency expected variation.
@@ -145,7 +145,7 @@ pub struct KvmVcpu {
145145 /// KVM vcpu fd.
146146 pub fd : VcpuFd ,
147147 /// Vcpu peripherals, such as buses
148- pub ( super ) peripherals : Peripherals ,
148+ pub peripherals : Peripherals ,
149149 /// The list of MSRs to include in a VM snapshot, in the same order as KVM returned them
150150 /// from KVM_GET_MSR_INDEX_LIST
151151 msrs_to_save : Vec < u32 > ,
@@ -157,7 +157,7 @@ pub struct KvmVcpu {
157157
158158/// Vcpu peripherals
159159#[ derive( Default , Debug ) ]
160- pub ( super ) struct Peripherals {
160+ pub struct Peripherals {
161161 /// Pio bus.
162162 pub pio_bus : Option < crate :: devices:: Bus > ,
163163 /// Mmio bus.
@@ -334,7 +334,7 @@ impl KvmVcpu {
334334 ///
335335 /// # Errors
336336 ///
337- /// When [`kvm_ioctls::VcpuFd::get_tsc_khz`] errrors .
337+ /// When [`kvm_ioctls::VcpuFd::get_tsc_khz`] errors .
338338 pub fn get_tsc_khz ( & self ) -> Result < u32 , GetTscError > {
339339 let res = self . fd . get_tsc_khz ( ) ?;
340340 Ok ( res)
@@ -477,7 +477,7 @@ impl KvmVcpu {
477477 /// # Arguments
478478 ///
479479 /// * `msr_index_iter`: Iterator over MSR indices.
480- /// * `chunk_size`: Lenght of a chunk.
480+ /// * `chunk_size`: Length of a chunk.
481481 ///
482482 /// # Errors
483483 ///
@@ -504,7 +504,7 @@ impl KvmVcpu {
504504 . map_err ( KvmVcpuError :: VcpuGetMsrs ) ?;
505505 // GET_MSRS returns a number of successfully set msrs.
506506 // If number of set msrs is not equal to the length of
507- // `msrs`, then the value retuned by GET_MSRS can act
507+ // `msrs`, then the value returned by GET_MSRS can act
508508 // as an index to the problematic msr.
509509 if nmsrs != chunk_size {
510510 Err ( KvmVcpuError :: VcpuGetMsr ( msrs. as_slice ( ) [ nmsrs] . index ) )
@@ -621,7 +621,7 @@ impl KvmVcpu {
621621 // in the state. If they are different, we need to
622622 // scale the TSC to the freq found in the state.
623623 // We accept values within a tolerance of 250 parts
624- // per million beacuse it is common for TSC frequency
624+ // per million because it is common for TSC frequency
625625 // to differ due to calibration at boot time.
626626 let diff = ( i64:: from ( self . get_tsc_khz ( ) ?) - i64:: from ( state_tsc_freq) ) . abs ( ) ;
627627 // Cannot overflow since u32::MAX * 250 < i64::MAX
@@ -705,7 +705,7 @@ impl Peripherals {
705705 /// Runs the vCPU in KVM context and handles the kvm exit reason.
706706 ///
707707 /// Returns error or enum specifying whether emulation was handled or interrupted.
708- pub fn run_arch_emulation ( & self , exit : VcpuExit ) -> Result < VcpuEmulation , super :: VcpuError > {
708+ pub fn run_arch_emulation ( & self , exit : VcpuExit ) -> Result < VcpuEmulation , VcpuError > {
709709 match exit {
710710 VcpuExit :: IoIn ( addr, data) => {
711711 if let Some ( pio_bus) = & self . pio_bus {
@@ -728,7 +728,7 @@ impl Peripherals {
728728 // TODO: Are we sure we want to finish running a vcpu upon
729729 // receiving a vm exit that is not necessarily an error?
730730 error ! ( "Unexpected exit reason on vcpu run: {:?}" , unexpected_exit) ;
731- Err ( super :: VcpuError :: UnhandledKvmExit ( format ! (
731+ Err ( VcpuError :: UnhandledKvmExit ( format ! (
732732 "{:?}" ,
733733 unexpected_exit
734734 ) ) )
0 commit comments