vring: Add "get_call" method

Add a "get_call" method to obtain the current value for the call
EventFd.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez 2021-09-13 13:38:20 +02:00 committed by Jiang Liu
parent f4ee3226c0
commit a577bbc868

View file

@ -251,6 +251,11 @@ impl<M: GuestAddressSpace> VringState<M> {
self.call = file.map(|f| unsafe { EventFd::from_raw_fd(f.into_raw_fd()) });
}
/// Get the `EventFd` for call.
pub fn get_call(&self) -> &Option<EventFd> {
&self.call
}
/// Set `EventFd` for err.
fn set_err(&mut self, file: Option<File>) {
// SAFETY: see comment in set_kick()