mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio: Modify VirtioInterrupt callback into a trait
Callbacks are not the most Rust idiomatic way of programming. The right way is to use a Trait to provide multiple implementation of the same interface. Additionally, a Trait will allow for multiple functions to be defined while using callbacks means that a new callback must be introduced for each new function we want to add. For these two reasons, the current commit modifies the existing VirtioInterrupt callback into a Trait of the same name. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
ef7d889a79
commit
c396baca46
@@ -67,7 +67,7 @@ pub trait PciDevice: BusDevice {
|
||||
}
|
||||
|
||||
/// Assign MSI-X to this device.
|
||||
fn assign_msix(&mut self, _msi_cb: Arc<InterruptDelivery>) {}
|
||||
fn assign_msix(&mut self) {}
|
||||
|
||||
/// Allocates the needed PCI BARs space using the `allocate` function which takes a size and
|
||||
/// returns an address. Returns a Vec of (GuestAddress, GuestUsize) tuples.
|
||||
|
||||
Reference in New Issue
Block a user