From 51ceae9131d156eb7d16cff1732eb3ccef386ec4 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 9 Jul 2021 14:13:30 +0000 Subject: [PATCH] pci: vfio: Make get_irq_info() return a non-reference Returning a reference is not possible for the vfio-user code as it is constructed for the function. Signed-off-by: Rob Bradford --- pci/src/vfio.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pci/src/vfio.rs b/pci/src/vfio.rs index a1bc6e03e..e710c3b05 100644 --- a/pci/src/vfio.rs +++ b/pci/src/vfio.rs @@ -301,7 +301,7 @@ pub(crate) trait Vfio { unimplemented!() } - fn get_irq_info(&self, _irq_index: u32) -> Option<&VfioIrq> { + fn get_irq_info(&self, _irq_index: u32) -> Option { unimplemented!() } @@ -341,8 +341,8 @@ impl Vfio for VfioDeviceWrapper { self.device.region_write(index, data, offset) } - fn get_irq_info(&self, irq_index: u32) -> Option<&VfioIrq> { - self.device.get_irq_info(irq_index) + fn get_irq_info(&self, irq_index: u32) -> Option { + self.device.get_irq_info(irq_index).copied() } fn enable_irq(