Skip to content

Commit

Permalink
Merge pull request #765 from n0toose/read-params
Browse files Browse the repository at this point in the history
fix(hypercall): ReadPrams -> ReadParams
  • Loading branch information
jounathaen authored Oct 28, 2024
2 parents 530c985 + f72eab3 commit 4fdbab9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hypercall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub unsafe fn address_to_hypercall(
Hypercall::FileOpen(sysopen)
}
HypercallAddress::FileRead => {
let sysread = mem.get_ref_mut::<ReadPrams>(data).unwrap();
let sysread = mem.get_ref_mut::<ReadParams>(data).unwrap();
Hypercall::FileRead(sysread)
}
HypercallAddress::FileWrite => {
Expand Down Expand Up @@ -102,7 +102,7 @@ pub fn close(sysclose: &mut CloseParams) {
}

/// Handles an read syscall on the host.
pub fn read(mem: &MmapMemory, sysread: &mut ReadPrams) {
pub fn read(mem: &MmapMemory, sysread: &mut ReadParams) {
unsafe {
let bytes_read = libc::read(
sysread.fd,
Expand Down
2 changes: 1 addition & 1 deletion uhyve-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub enum Hypercall<'a> {
FileClose(&'a mut CloseParams),
FileLseek(&'a mut LseekParams),
FileOpen(&'a mut OpenParams),
FileRead(&'a mut ReadPrams),
FileRead(&'a mut ReadParams),
FileWrite(&'a WriteParams),
FileUnlink(&'a mut UnlinkParams),
/// Write a char to the terminal.
Expand Down
2 changes: 1 addition & 1 deletion uhyve-interface/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub struct WriteParams {
/// Parameters for a [`FileRead`](crate::Hypercall::FileRead) hypercall.
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct ReadPrams {
pub struct ReadParams {
/// File descriptor of the file.
pub fd: i32,
/// Buffer to read the file into.
Expand Down

0 comments on commit 4fdbab9

Please sign in to comment.