Skip to content

Commit 5563692

Browse files
committed
refactor: load kernel/initrd after create_vmm_and_vcpus()
This is in preparation of guest memory itself only getting set up after the call to create_vmm_and_vcpus(). Signed-off-by: Patrick Roy <[email protected]>
1 parent 2b182c6 commit 5563692

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/vmm/src/builder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,6 @@ pub fn build_microvm_for_boot(
238238
.allocate_guest_memory()
239239
.map_err(StartMicrovmError::GuestMemory)?;
240240

241-
let entry_point = load_kernel(boot_config, &guest_memory)?;
242-
let initrd = load_initrd_from_config(boot_config, &guest_memory)?;
243241
// Clone the command-line so that a failed boot doesn't pollute the original.
244242
#[allow(unused_mut)]
245243
let mut boot_cmdline = boot_config.cmdline.clone();
@@ -258,6 +256,9 @@ pub fn build_microvm_for_boot(
258256
cpu_template.kvm_capabilities.clone(),
259257
)?;
260258

259+
let entry_point = load_kernel(boot_config, vmm.guest_memory())?;
260+
let initrd = load_initrd_from_config(boot_config, vmm.guest_memory())?;
261+
261262
#[cfg(feature = "gdb")]
262263
let (gdb_tx, gdb_rx) = mpsc::channel();
263264
#[cfg(feature = "gdb")]

0 commit comments

Comments
 (0)