mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Add helper to VirtioCommon for EventFd duplication
Add a helper to VirtioCommon which returns duplicates of the EventFds for kill and pause event. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -319,6 +319,13 @@ impl VirtioCommon {
|
||||
// Return the interrupt
|
||||
Some(self.interrupt_cb.take().unwrap())
|
||||
}
|
||||
|
||||
pub fn dup_eventfds(&self) -> (EventFd, EventFd) {
|
||||
(
|
||||
self.kill_evt.as_ref().unwrap().try_clone().unwrap(),
|
||||
self.pause_evt.as_ref().unwrap().try_clone().unwrap(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl Pausable for VirtioCommon {
|
||||
|
||||
Reference in New Issue
Block a user