Skip to content

Commit 577d4eb

Browse files
committed
Add access method VcpuFd::vcpu_file()
Add access method VcpuFd::vcpu_file() and also export new_vmfd(). Signed-off-by: Liu Jiang <[email protected]>
1 parent fde84ee commit 577d4eb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ioctls/vcpu.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,11 @@ impl VcpuFd {
13941394
Ok(())
13951395
}
13961396
}
1397+
1398+
/// Get reference to the underlying vcpu file object.
1399+
pub fn vcpu_file(&self) -> &File {
1400+
&self.vcpu
1401+
}
13971402
}
13981403

13991404
/// Helper function to create a new `VcpuFd`.

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ pub use cap::Cap;
222222
pub use ioctls::device::DeviceFd;
223223
pub use ioctls::system::Kvm;
224224
pub use ioctls::vcpu::{VcpuExit, VcpuFd};
225-
pub use ioctls::vm::{IoEventAddress, NoDatamatch, VmFd};
225+
pub use ioctls::vm::{new_vmfd, IoEventAddress, NoDatamatch, VmFd};
226226
// The following example is used to verify that our public
227227
// structures are exported properly.
228228
/// # Example

0 commit comments

Comments
 (0)