Revert "Add --enable-earlycon option to vm tool"
This reverts commit ec68eaf6e8ba07cf400cdc33501cdd1a85dfe665.
Reason for revert: Droidmonitor created revert due to b/363003807.
Change-Id: I412b0a1a25eb19371c64bce9e489d4eed2ae7b07
diff --git a/android/virtmgr/src/aidl.rs b/android/virtmgr/src/aidl.rs
index 5355c19..7a357f3 100644
--- a/android/virtmgr/src/aidl.rs
+++ b/android/virtmgr/src/aidl.rs
@@ -989,10 +989,6 @@
vm_config.devices.clone_from(&custom_config.devices);
vm_config.networkSupported = custom_config.networkSupported;
-
- for param in custom_config.extraKernelCmdlineParams.iter() {
- append_kernel_param(param, &mut vm_config);
- }
}
if config.memoryMib > 0 {
@@ -1545,17 +1541,6 @@
Ok(())
}
-fn check_no_extra_kernel_cmdline_params(config: &VirtualMachineConfig) -> binder::Result<()> {
- let VirtualMachineConfig::AppConfig(config) = config else { return Ok(()) };
- if let Some(custom_config) = &config.customConfig {
- if !custom_config.extraKernelCmdlineParams.is_empty() {
- return Err(anyhow!("debuggable_vms_improvements feature is disabled"))
- .or_binder_exception(ExceptionCode::UNSUPPORTED_OPERATION);
- }
- }
- Ok(())
-}
-
fn check_protected_vm_is_supported() -> binder::Result<()> {
let is_pvm_supported =
hypervisor_props::is_protected_vm_supported().or_service_specific_exception(-1)?;
@@ -1577,9 +1562,6 @@
if !cfg!(multi_tenant) {
check_no_extra_apks(config)?;
}
- if !cfg!(debuggable_vms_improvements) {
- check_no_extra_kernel_cmdline_params(config)?;
- }
Ok(())
}
diff --git a/android/virtualizationservice/aidl/android/system/virtualizationservice/VirtualMachineAppConfig.aidl b/android/virtualizationservice/aidl/android/system/virtualizationservice/VirtualMachineAppConfig.aidl
index 9123742..ee39d75 100644
--- a/android/virtualizationservice/aidl/android/system/virtualizationservice/VirtualMachineAppConfig.aidl
+++ b/android/virtualizationservice/aidl/android/system/virtualizationservice/VirtualMachineAppConfig.aidl
@@ -127,9 +127,6 @@
/** Whether the VM should have network feature. */
boolean networkSupported;
-
- /** Additional parameters to pass to the VM's kernel cmdline. */
- String[] extraKernelCmdlineParams;
}
/** Configuration parameters guarded by android.permission.USE_CUSTOM_VIRTUAL_MACHINE */
diff --git a/android/vm/src/main.rs b/android/vm/src/main.rs
index 205b0f6..3c0887c 100644
--- a/android/vm/src/main.rs
+++ b/android/vm/src/main.rs
@@ -109,11 +109,6 @@
/// Note: this is only supported on Android kernels android14-5.15 and higher.
#[arg(long)]
gdb: Option<NonZeroU16>,
-
- /// Whether to enable earlycon. Only supported for debuggable Linux-based VMs.
- #[cfg(debuggable_vms_improvements)]
- #[arg(long)]
- enable_earlycon: bool,
}
#[derive(Args, Default)]
@@ -177,18 +172,6 @@
}
}
-impl DebugConfig {
- #[cfg(debuggable_vms_improvements)]
- fn enable_earlycon(&self) -> bool {
- self.enable_earlycon
- }
-
- #[cfg(not(debuggable_vms_improvements))]
- fn debuggable_vms_improvements(&self) -> bool {
- false
- }
-}
-
#[derive(Args, Default)]
/// Flags for the run_app subcommand
pub struct RunAppConfig {
diff --git a/android/vm/src/run.rs b/android/vm/src/run.rs
index 823546f..b3743ae 100644
--- a/android/vm/src/run.rs
+++ b/android/vm/src/run.rs
@@ -148,7 +148,7 @@
let payload_config_str = format!("{:?}!{:?}", config.apk, payload);
- let mut custom_config = CustomConfig {
+ let custom_config = CustomConfig {
gdbPort: config.debug.gdb.map(u16::from).unwrap_or(0) as i32, // 0 means no gdb
vendorImage: vendor,
devices: config
@@ -163,21 +163,6 @@
..Default::default()
};
- if config.debug.enable_earlycon() {
- if config.debug.debug != DebugLevel::FULL {
- bail!("earlycon is only supported for debuggable VMs")
- }
- if cfg!(target_arch = "aarch64") {
- custom_config
- .extraKernelCmdlineParams
- .push(String::from("earlycon=uart8250,mmio,0x3f8"));
- } else if cfg!(target_arch = "x86_64") {
- custom_config.extraKernelCmdlineParams.push(String::from("earlycon=uart8250,io,0x3f8"));
- } else {
- bail!("unexpected architecture!");
- }
- }
-
let vm_config = VirtualMachineConfig::AppConfig(VirtualMachineAppConfig {
name: config.common.name.unwrap_or_else(|| String::from("VmRunApp")),
apk: apk_fd.into(),