crosvm: Report correct exit code on error in balloon_stats command
This CL changes the return value of balloon_stats to reflect error
response correctly to an exit code.
BUG=None
TEST=Observed exit code is 1 on error when running crosvm balloon_stats
Change-Id: Ic319b1948ebe5edb409a5ec8afd838034e7f0931
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2909699
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Hikaru Nishida <hikalium@chromium.org>
Reviewed-by: Charles William Dick <cwd@google.com>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
diff --git a/src/main.rs b/src/main.rs
index 1bf5838..b55d285 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -40,6 +40,7 @@
ModifyUsbError, ModifyUsbResult,
},
BalloonControlCommand, BatteryType, DiskControlCommand, UsbControlResult, VmRequest,
+ VmResponse,
};
fn executable_is_plugin(executable: &Option<Executable>) -> bool {
@@ -2114,7 +2115,10 @@
let socket_path = Path::new(&socket_path);
let response = handle_request(request, socket_path)?;
println!("{}", response);
- Ok(())
+ match response {
+ VmResponse::BalloonStats { .. } => Ok(()),
+ _ => Err(()),
+ }
}
fn create_qcow2(args: std::env::Args) -> std::result::Result<(), ()> {