Move initial boot-timer timestamp
The initial timestamp passed to the boot-timer to calculate
uVM boot time was taken after creating guest memory, loading the
kernel, and loading the initrd, which should be included
when calculating boot time.
@@ -305,6 +305,10 @@ pub fn build_microvm_for_boot(
seccomp_filters: &BpfThreadMap,
) -> std::result::Result<Arc<Mutex<Vmm>>, StartMicrovmError> {
use self::StartMicrovmError::*;
+
+ // Timestamp for measuring microVM boot duration.
+ let request_ts = TimestampUs::default();
+
let boot_config = vm_resources.boot_source().ok_or(MissingKernelConfig)?;
let track_dirty_pages = vm_resources.track_dirty_pages();
@@ -322,9 +326,6 @@ pub fn build_microvm_for_boot(
#[allow(unused_mut)]
let mut boot_cmdline = boot_config.cmdline.clone();
- // Timestamp for measuring microVM boot duration.
- let request_ts = TimestampUs::default();
-
let (mut vmm, mut vcpus) = create_vmm_and_vcpus(
instance_info,
event_manager,
