crosvm: add cmdline option wait on balloon adjust response

Change-Id: Iae2bde20e9e68d9a40a40526da4553ee9b7cc312
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5255763
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
This commit is contained in:
Frederick Mayle 2024-01-31 16:47:47 -08:00 committed by crosvm LUCI
parent 62a3fb4be7
commit f35dc67e13
2 changed files with 4 additions and 1 deletions

View file

@ -176,6 +176,9 @@ pub struct BalloonCommand {
#[argh(positional, arg_name = "VM_SOCKET")]
/// VM Socket path
pub socket_path: String,
/// wait for response
#[argh(switch)]
pub wait: bool,
}
#[derive(argh::FromArgs)]

View file

@ -230,7 +230,7 @@ fn inject_gpe(cmd: cmdline::GpeCommand) -> std::result::Result<(), ()> {
fn balloon_vms(cmd: cmdline::BalloonCommand) -> std::result::Result<(), ()> {
let command = BalloonControlCommand::Adjust {
num_bytes: cmd.num_bytes,
wait_for_success: false,
wait_for_success: cmd.wait,
};
vms_request(&VmRequest::BalloonCommand(command), cmd.socket_path)
}