File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -235,6 +235,10 @@ pub fn build_microvm_for_boot(
235235 . allocate_guest_memory ( )
236236 . map_err ( StartMicrovmError :: GuestMemory ) ?;
237237
238+ let io_memory = vm_resources
239+ . allocate_io_memory ( )
240+ . map_err ( StartMicrovmError :: GuestMemory ) ?;
241+
238242 // Clone the command-line so that a failed boot doesn't pollute the original.
239243 #[ allow( unused_mut) ]
240244 let mut boot_cmdline = boot_config. cmdline . clone ( ) ;
@@ -258,6 +262,13 @@ pub fn build_microvm_for_boot(
258262 . map_err ( StartMicrovmError :: Internal ) ?;
259263 }
260264
265+ if let Some ( io_memory) = io_memory {
266+ vmm. vm
267+ . register_io_region ( io_memory)
268+ . map_err ( VmmError :: Vm )
269+ . map_err ( StartMicrovmError :: Internal ) ?;
270+ }
271+
261272 let entry_point = load_kernel ( boot_config, vmm. guest_memory ( ) ) ?;
262273 let initrd = load_initrd_from_config ( boot_config, vmm. guest_memory ( ) ) ?;
263274
You can’t perform that action at this time.
0 commit comments