File tree Expand file tree Collapse file tree 5 files changed +16
-33
lines changed
Expand file tree Collapse file tree 5 files changed +16
-33
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,6 @@ use crate::{
77 vm:: VmId ,
88} ;
99
10- const VM_ASPACE_BASE : GuestPhysAddr = GuestPhysAddr :: from_usize ( 0 ) ;
11- const VM_ASPACE_SIZE : usize = 0x7fff_ffff_f000 ;
12- const VM_ASPACE_END : GuestPhysAddr =
13- GuestPhysAddr :: from_usize ( VM_ASPACE_BASE . as_usize ( ) + VM_ASPACE_SIZE ) ;
14-
1510pub struct VmMachineInited {
1611 pub id : VmId ,
1712 pub name : String ,
Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ impl VmMachineRunningOps for VmMachineRunning {
1919
2020 fn stop ( self ) -> Self :: Stopping {
2121 Self :: Stopping {
22- vmspace : self . common . vmspace ,
22+ _vmspace : self . common . vmspace ,
2323 }
2424 }
2525}
2626
2727pub struct VmStatusStopping {
28- vmspace : VmAddrSpace ,
28+ _vmspace : VmAddrSpace ,
2929}
3030
3131impl VmMachineStoppingOps for VmStatusStopping { }
Original file line number Diff line number Diff line change @@ -11,11 +11,6 @@ use crate::{
1111 fdt:: FdtBuilder ,
1212} ;
1313
14- const VM_ASPACE_BASE : GuestPhysAddr = GuestPhysAddr :: from_usize ( 0 ) ;
15- const VM_ASPACE_SIZE : usize = 0x7fff_ffff_f000 ;
16- const VM_ASPACE_END : GuestPhysAddr =
17- GuestPhysAddr :: from_usize ( VM_ASPACE_BASE . as_usize ( ) + VM_ASPACE_SIZE ) ;
18-
1914pub struct VmMachineUninit {
2015 config : AxVMConfig ,
2116 pt_levels : usize ,
Original file line number Diff line number Diff line change @@ -364,18 +364,18 @@ impl GuestMemory {
364364 self . layout . size ( )
365365 }
366366
367- pub fn to_vec ( & self ) -> Vec < u8 > {
368- let mut result = vec ! [ ] ;
369- let g = self . aspace . lock ( ) ;
370- let hva = g
371- . translated_byte_buffer ( self . gpa . as_usize ( ) . into ( ) , self . size ( ) )
372- . expect ( "Failed to translate memory region" ) ;
373- for buff in hva {
374- result. extend_from_slice ( buff) ;
375- }
376- result. resize ( self . size ( ) , 0 ) ;
377- result
378- }
367+ // pub fn to_vec(&self) -> Vec<u8> {
368+ // let mut result = vec![];
369+ // let g = self.aspace.lock();
370+ // let hva = g
371+ // .translated_byte_buffer(self.gpa.as_usize().into(), self.size())
372+ // .expect("Failed to translate memory region");
373+ // for buff in hva {
374+ // result.extend_from_slice(buff);
375+ // }
376+ // result.resize(self.size(), 0);
377+ // result
378+ // }
379379}
380380
381381impl Drop for GuestMemory {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ mod running;
1111
1212pub ( crate ) use running:: * ;
1313
14+ #[ allow( unused) ]
1415pub trait VmMachineUninitOps {
1516 type Inited : VmMachineInitedOps ;
1617 fn new ( config : AxVMConfig ) -> Self ;
@@ -29,22 +30,14 @@ pub trait VmMachineInitedOps {
2930 Self : Sized ;
3031}
3132
33+ #[ allow( unused) ]
3234pub trait VmMachineRunningOps {
3335 type Stopping : VmMachineStoppingOps ;
3436 fn stop ( self ) -> Self :: Stopping ;
3537}
3638
3739pub trait VmMachineStoppingOps { }
3840
39- /// A lightweight container that stores the identifier and human readable name
40- /// for a VM instance. Shared between the public [`Vm`] object and the
41- /// background machine thread for logging and observability.
42- #[ derive( Debug , Clone ) ]
43- pub struct VmCommon {
44- pub id : VmId ,
45- pub name : String ,
46- }
47-
4841pub enum VmMachineState {
4942 Uninit ( VmMachineUninit ) ,
5043 Inited ( VmMachineInited ) ,
You can’t perform that action at this time.
0 commit comments