mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 10:10:41 +00:00
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:
parent
e98d378d34
commit
299c1121c3
1 changed files with 15 additions and 0 deletions
|
@ -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`.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue