Add an arg to run-microdroid/run-app cmds to provide custom kernel
This arg will be used to compare performance of Microdroid VMs booted
with different kernels.
Bug: 283822676
Test: vm run-microdroid
Change-Id: Ice300dfbd922467a75f2f5d6f3449bd0b02307f7
diff --git a/virtualizationmanager/src/aidl.rs b/virtualizationmanager/src/aidl.rs
index f57cb59..86c8596 100644
--- a/virtualizationmanager/src/aidl.rs
+++ b/virtualizationmanager/src/aidl.rs
@@ -309,10 +309,12 @@
// VirtualMachineAppConfig:
// - controlling CPUs;
// - specifying a config file in the APK;
- // - gdbPort is set, meaning that crosvm will start a gdb server.
+ // - gdbPort is set, meaning that crosvm will start a gdb server;
+ // - using anything other than the default kernel.
!config.taskProfiles.is_empty()
|| matches!(config.payload, Payload::ConfigPath(_))
|| config.gdbPort > 0
+ || config.customKernelImage.as_ref().is_some()
}
};
if is_custom {
@@ -593,6 +595,10 @@
let vm_config_file = File::open(vm_config_path)?;
let mut vm_config = VmConfig::load(&vm_config_file)?.to_parcelable()?;
+ if let Some(file) = config.customKernelImage.as_ref() {
+ vm_config.kernel = Some(ParcelFileDescriptor::new(clone_file(file)?))
+ }
+
if config.memoryMib > 0 {
vm_config.memoryMib = config.memoryMib;
}