virtmgr: Don't detect hangup when using GDB
Currently, virtmgr times out and terminates the VM if something has
gone wrong during the boot of the guest kernel, preventing it from
properly reaching a point where it can communicate with the host.
However, if GDB is in use, it is likely that the kernel is being stepped
through, held on a breakpoint, ... Timing out in such conditions is not
only wrong but very unhelpful to the debugging session taking place.
Therefore, don't "detect hangup" when a GDB port has been passed.
Test: TH
Bug: 385659491
Change-Id: Ie11597070fbfc8c72b357bc9746ad5d5789521eb
diff --git a/android/virtmgr/src/aidl.rs b/android/virtmgr/src/aidl.rs
index 82a5573..6122b80 100644
--- a/android/virtmgr/src/aidl.rs
+++ b/android/virtmgr/src/aidl.rs
@@ -748,6 +748,8 @@
.unwrap_or(Ok(UsbConfig { controller: false }))
.or_binder_exception(ExceptionCode::BAD_PARCELABLE)?;
+ let detect_hangup = is_app_config && gdb_port.is_none();
+
// Actually start the VM.
let crosvm_config = CrosvmConfig {
cid,
@@ -774,7 +776,7 @@
ramdump,
indirect_files,
platform_version: parse_platform_version_req(&config.platformVersion)?,
- detect_hangup: is_app_config,
+ detect_hangup,
gdb_port,
vfio_devices,
dtbo,