mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Add set_notifier() method to VirtioInterrupt
It is currently left as unimplemented!(). No functional change intended as there are no callers. Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
0f7dc514ba
commit
e1c40211ae
Generated
+1
@@ -2455,6 +2455,7 @@ dependencies = [
|
|||||||
"byteorder",
|
"byteorder",
|
||||||
"epoll",
|
"epoll",
|
||||||
"event_monitor",
|
"event_monitor",
|
||||||
|
"hypervisor",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"mshv-ioctls",
|
"mshv-ioctls",
|
||||||
|
|||||||
Generated
+1
@@ -1372,6 +1372,7 @@ dependencies = [
|
|||||||
"byteorder",
|
"byteorder",
|
||||||
"epoll",
|
"epoll",
|
||||||
"event_monitor",
|
"event_monitor",
|
||||||
|
"hypervisor",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"net_util",
|
"net_util",
|
||||||
|
|||||||
@@ -119,6 +119,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! align {
|
macro_rules! align {
|
||||||
|
|||||||
@@ -121,6 +121,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
||||||
|
|||||||
@@ -148,6 +148,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queues(bytes: &[&[u8; QUEUE_DATA_SIZE]], base_addr: u64) -> Vec<Queue> {
|
fn setup_virt_queues(bytes: &[&[u8; QUEUE_DATA_SIZE]], base_addr: u64) -> Vec<Queue> {
|
||||||
|
|||||||
@@ -130,6 +130,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
||||||
|
|||||||
@@ -125,6 +125,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a dummy virtio-mem device for fuzzing purpose only
|
// Create a dummy virtio-mem device for fuzzing purpose only
|
||||||
|
|||||||
@@ -166,6 +166,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queues(bytes: &[&[u8; QUEUE_DATA_SIZE]], base_addr: u64) -> Vec<Queue> {
|
fn setup_virt_queues(bytes: &[&[u8; QUEUE_DATA_SIZE]], base_addr: u64) -> Vec<Queue> {
|
||||||
|
|||||||
@@ -95,6 +95,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a dummy virtio-pmem device for fuzzing purpose only
|
// Create a dummy virtio-pmem device for fuzzing purpose only
|
||||||
|
|||||||
@@ -119,6 +119,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
||||||
|
|||||||
@@ -128,6 +128,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
||||||
|
|||||||
@@ -84,6 +84,15 @@ impl VirtioInterrupt for NoopVirtioInterrupt {
|
|||||||
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
fn trigger(&self, _int_type: VirtioInterruptType) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
fn setup_virt_queue(bytes: &[u8; QUEUE_DATA_SIZE]) -> Queue {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ block = { path = "../block" }
|
|||||||
byteorder = { workspace = true }
|
byteorder = { workspace = true }
|
||||||
epoll = { workspace = true }
|
epoll = { workspace = true }
|
||||||
event_monitor = { path = "../event_monitor" }
|
event_monitor = { path = "../event_monitor" }
|
||||||
|
hypervisor = { path = "../hypervisor" }
|
||||||
libc = { workspace = true }
|
libc = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
mshv-ioctls = { workspace = true, optional = true }
|
mshv-ioctls = { workspace = true, optional = true }
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ pub trait VirtioInterrupt: Send + Sync {
|
|||||||
fn notifier(&self, _int_type: VirtioInterruptType) -> Option<EventFd> {
|
fn notifier(&self, _int_type: VirtioInterruptType) -> Option<EventFd> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
int_type: u32,
|
||||||
|
notifier: Option<EventFd>,
|
||||||
|
vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()>;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|||||||
@@ -914,6 +914,15 @@ impl VirtioInterrupt for VirtioInterruptMsix {
|
|||||||
self.interrupt_source_group
|
self.interrupt_source_group
|
||||||
.notifier(vector as InterruptIndex)
|
.notifier(vector as InterruptIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PciDevice for VirtioPciDevice {
|
impl PciDevice for VirtioPciDevice {
|
||||||
|
|||||||
@@ -188,6 +188,15 @@ pub mod unit_tests {
|
|||||||
) -> std::result::Result<(), std::io::Error> {
|
) -> std::result::Result<(), std::io::Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn set_notifier(
|
||||||
|
&self,
|
||||||
|
_interrupt: u32,
|
||||||
|
_eventfd: Option<EventFd>,
|
||||||
|
_vm: &dyn hypervisor::Vm,
|
||||||
|
) -> std::io::Result<()> {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TestBackend {
|
pub struct TestBackend {
|
||||||
|
|||||||
Reference in New Issue
Block a user