From 7ed6c6896b642c2ca1e6c945321a0e0952ccb924 Mon Sep 17 00:00:00 2001 From: Alex Lyn Date: Thu, 16 May 2024 17:53:18 +0800 Subject: [PATCH] runtime-rs: add an option dbg_monitor_socket for HMP support This option allows to add a debug monitor socket when `enable_debug = true` to control QEMU within debugging case. Fixes: #9603 Signed-off-by: Alex Lyn --- src/libs/kata-types/src/config/hypervisor/mod.rs | 14 ++++++++++++++ .../config/configuration-qemu-runtime-rs.toml.in | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libs/kata-types/src/config/hypervisor/mod.rs b/src/libs/kata-types/src/config/hypervisor/mod.rs index 08a95bf8df..f73969d850 100644 --- a/src/libs/kata-types/src/config/hypervisor/mod.rs +++ b/src/libs/kata-types/src/config/hypervisor/mod.rs @@ -411,6 +411,20 @@ pub struct DebugInfo { /// much disk space. #[serde(default)] pub guest_memory_dump_path: String, + + /// This option allows to add a debug monitor socket when `enable_debug = true` + /// WARNING: Anyone with access to the monitor socket can take full control of + /// Qemu. This is for debugging purpose only and must *NEVER* be used in + /// production. + /// Valid values are : + /// - "hmp" + /// - "qmp" + /// - "qmp-pretty" (same as "qmp" with pretty json formatting) + /// If set to the empty string "", no debug monitor socket is added. This is + /// the default. + /// dbg_monitor_socket = "hmp" + #[serde(default)] + pub dbg_monitor_socket: String, } impl DebugInfo { diff --git a/src/runtime-rs/config/configuration-qemu-runtime-rs.toml.in b/src/runtime-rs/config/configuration-qemu-runtime-rs.toml.in index a6bf0acea5..6f20e55f70 100644 --- a/src/runtime-rs/config/configuration-qemu-runtime-rs.toml.in +++ b/src/runtime-rs/config/configuration-qemu-runtime-rs.toml.in @@ -346,7 +346,7 @@ pflashes = [] # # If set to the empty string "", no extra monitor socket is added. This is # the default. -#extra_monitor_socket = hmp +#extra_monitor_socket = "hmp" # Disable the customizations done in the runtime when it detects # that it is running on top a VMM. This will result in the runtime