@@ -27,7 +27,7 @@ use snafu::{ResultExt, Snafu};
2727use crate :: arch:: layout:: { PL011_START , PL031_START } ;
2828#[ cfg( target_arch = "x86_64" ) ]
2929use crate :: arch:: layout:: { PORT_COM1 , PORT_FW_CFG_SELECTOR } ;
30- use crate :: board:: { ArchBoard , Board , BoardConfig } ;
30+ use crate :: board:: { Board , BoardConfig } ;
3131#[ cfg( target_arch = "x86_64" ) ]
3232use crate :: device:: fw_cfg:: { FwCfg , FwCfgItemParam } ;
3333#[ cfg( target_arch = "aarch64" ) ]
@@ -37,9 +37,8 @@ use crate::device::pl031::Pl031;
3737#[ cfg( target_arch = "x86_64" ) ]
3838use crate :: device:: serial:: Serial ;
3939use crate :: errors:: { DebugTrace , trace_error} ;
40- use crate :: hv:: { Hypervisor , IoeventFdRegistry , Vm , VmConfig } ;
40+ use crate :: hv:: { Hypervisor , IoeventFdRegistry , Vm } ;
4141use crate :: loader:: Payload ;
42- use crate :: mem:: Memory ;
4342use crate :: pci:: pvpanic:: PvPanic ;
4443use crate :: pci:: { Bdf , Pci } ;
4544#[ cfg( target_os = "linux" ) ]
@@ -117,18 +116,8 @@ impl<H> Machine<H>
117116where
118117 H : Hypervisor ,
119118{
120- pub fn new ( hv : & H , mut config : BoardConfig ) -> Result < Self > {
121- config. config_fixup ( ) ?;
122-
123- let vm_config = VmConfig {
124- coco : config. coco . clone ( ) ,
125- } ;
126- let mut vm = hv. create_vm ( & vm_config) ?;
127- let vm_memory = vm. create_vm_memory ( ) ?;
128- let memory = Memory :: new ( vm_memory) ;
129- let arch = ArchBoard :: new ( hv, & vm, & config) ?;
130-
131- let board = Arc :: new ( Board :: new ( vm, memory, arch, config) ) ;
119+ pub fn new ( hv : & H , config : BoardConfig ) -> Result < Self > {
120+ let board = Arc :: new ( Board :: new ( hv, config) ?) ;
132121
133122 let ( event_tx, event_rx) = mpsc:: channel ( ) ;
134123
0 commit comments