Skip to content

Commit

Permalink
Add access method VcpuFd::vcpu_file()
Browse files Browse the repository at this point in the history
Add access method VcpuFd::vcpu_file() and also export new_vmfd().

Signed-off-by: Liu Jiang <[email protected]>
  • Loading branch information
jiangliu committed Jun 5, 2021
1 parent fde84ee commit 577d4eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ioctls/vcpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,11 @@ impl VcpuFd {
Ok(())
}
}

/// Get reference to the underlying vcpu file object.
pub fn vcpu_file(&self) -> &File {
&self.vcpu
}
}

/// Helper function to create a new `VcpuFd`.
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub use cap::Cap;
pub use ioctls::device::DeviceFd;
pub use ioctls::system::Kvm;
pub use ioctls::vcpu::{VcpuExit, VcpuFd};
pub use ioctls::vm::{IoEventAddress, NoDatamatch, VmFd};
pub use ioctls::vm::{new_vmfd, IoEventAddress, NoDatamatch, VmFd};
// The following example is used to verify that our public
// structures are exported properly.
/// # Example
Expand Down

0 comments on commit 577d4eb

Please sign in to comment.