interrupt: Make notifier function return Option<EventFd>

In anticipation for supporting the notifier function for the legacy
interrupt source group, we need this function to return an EventFd
instead of a reference to this same EventFd.

The reason is we can't return a reference when there's an Arc<Mutex<>>
involved in the call chain.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-02-09 08:20:45 +01:00
committed by Rob Bradford
parent 62c6efb2e5
commit acfbee5b7a
6 changed files with 16 additions and 16 deletions

View File

@@ -169,7 +169,7 @@ pub trait InterruptSourceGroup: Send + Sync {
/// to inject interrupts into a guest, by writing to the file returned
/// by this method.
#[allow(unused_variables)]
fn notifier(&self, index: InterruptIndex) -> Option<&EventFd> {
fn notifier(&self, index: InterruptIndex) -> Option<EventFd> {
// One use case of the notifier is to implement vhost user backends.
// For all other implementations we can just return None here.
None