crosvm_control: Add make_rt API

Adds a make_rt API to the crosvm_control library.

BUG=b:188858559
TEST=cq

Change-Id: I3affcd6cb003a17f125b45e78906fabe1e371c43
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3635255
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Kameron Lutes <kalutes@chromium.org>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
This commit is contained in:
Kameron Lutes 2022-05-09 22:29:09 +00:00 committed by Chromeos LUCI
parent e98d378d34
commit 299c1121c3

View file

@ -73,6 +73,21 @@ pub extern "C" fn crosvm_client_resume_vm(socket_path: *const c_char) -> bool {
.unwrap_or(false)
}
/// Creates an RT vCPU for the crosvm instance whose control socket is listening on `socket_path`.
///
/// The function returns true on success or false if an error occured.
#[no_mangle]
pub extern "C" fn crosvm_client_make_rt_vm(socket_path: *const c_char) -> bool {
catch_unwind(|| {
if let Some(socket_path) = validate_socket_path(socket_path) {
vms_request(&VmRequest::MakeRT, &socket_path).is_ok()
} else {
false
}
})
.unwrap_or(false)
}
/// Adjusts the balloon size of the crosvm instance whose control socket is
/// listening on `socket_path`.
///