From 1b0dfc0da30ac2195180bc58886e699554dfc624 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Fri, 29 May 2026 01:04:12 +0000 Subject: [PATCH] ch-remote: Make snapshot and restore config arguments required The snapshot and restore subcommands in ch-remote had optional snapshot_config and restore_config arguments, but the implementation was unconditionally unwrapping them. This change marks these arguments as required to handle the missing argument validation and report a proper error message instead of letting the application panic. Signed-off-by: Andrei Vagin --- cloud-hypervisor/src/bin/ch-remote.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloud-hypervisor/src/bin/ch-remote.rs b/cloud-hypervisor/src/bin/ch-remote.rs index 236e7438e..0e022c3cd 100644 --- a/cloud-hypervisor/src/bin/ch-remote.rs +++ b/cloud-hypervisor/src/bin/ch-remote.rs @@ -1127,6 +1127,7 @@ fn get_cli_commands_sorted() -> Box<[Command]> { .arg( Arg::new("restore_config") .index(1) + .required(true) .help(RestoreConfig::SYNTAX), ), Command::new("resume").about("Resume the VM"), @@ -1144,6 +1145,7 @@ fn get_cli_commands_sorted() -> Box<[Command]> { .arg( Arg::new("snapshot_config") .index(1) + .required(true) .help(""), ), ]