Skip to content

Commit

Permalink
Add compute id in the response
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Mar 11, 2024
1 parent 7d0c7ec commit 6f92183
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sidevm-quickjs/src/host_functions/riscvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct ExecRequest {
#[derive(ToJsValue, Debug)]
#[qjsbind(rename_all = "camelCase")]
struct ExecResponse {
compute_id: AsBytes<Vec<u8>>,
exit_code: u32,
journal: AsBytes<Vec<u8>>,
}
Expand Down Expand Up @@ -46,6 +47,7 @@ fn riscv_run_elf(req: ExecRequest) -> Result<ExecResponse> {
ExitCode::SessionLimit => bail!("Session limit reached"),
};
Ok(ExecResponse {
compute_id: AsBytes(instance.compute_id().as_bytes().to_vec()),
exit_code,
journal: AsBytes(session.journal.unwrap_or_default().bytes),
})
Expand Down

0 comments on commit 6f92183

Please sign in to comment.