Don't discard logs from VMs
Regardless of the debug level of the VM, don't hide the logs it
produces. The VM itself should not emit the logs if it is not debuggable
and it's more useful from the host to see what the VM actually produces.
Bug: 219028028
Test: atest MicrodroidTests
Change-Id: I64c1dd5522cd1830004853f60d789c6307fd45dd
diff --git a/virtualizationservice/src/aidl.rs b/virtualizationservice/src/aidl.rs
index 505eb0c..89c6e8a 100644
--- a/virtualizationservice/src/aidl.rs
+++ b/virtualizationservice/src/aidl.rs
@@ -29,7 +29,6 @@
IVirtualizationService::IVirtualizationService,
Partition::Partition,
PartitionType::PartitionType,
- VirtualMachineAppConfig::DebugLevel::DebugLevel,
VirtualMachineAppConfig::VirtualMachineAppConfig,
VirtualMachineConfig::VirtualMachineConfig,
VirtualMachineDebugInfo::VirtualMachineDebugInfo,
@@ -131,8 +130,8 @@
) -> binder::Result<Strong<dyn IVirtualMachine>> {
check_manage_access()?;
let state = &mut *self.state.lock().unwrap();
- let mut console_fd = console_fd.map(clone_file).transpose()?;
- let mut log_fd = log_fd.map(clone_file).transpose()?;
+ let console_fd = console_fd.map(clone_file).transpose()?;
+ let log_fd = log_fd.map(clone_file).transpose()?;
let requester_uid = ThreadState::get_calling_uid();
let requester_sid = get_calling_sid()?;
let requester_debug_pid = ThreadState::get_calling_pid();
@@ -163,19 +162,6 @@
)
})?;
- // Disable console logging if debug level != full. Note that kernel anyway doesn't use the
- // console output when debug level != full. So, users won't be able to see the kernel
- // output even without this overriding. This is to silence output from the bootloader which
- // doesn't understand the bootconfig parameters.
- if let VirtualMachineConfig::AppConfig(config) = config {
- if config.debugLevel != DebugLevel::FULL {
- console_fd = None;
- }
- if config.debugLevel == DebugLevel::NONE {
- log_fd = None;
- }
- }
-
let is_app_config = matches!(config, VirtualMachineConfig::AppConfig(_));
let config = match config {