mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
device: Improvement for BusDevice trait and PciDevice trait
BusDevice includes two methods which are only for PCI devices, which should be as members of PciDevice trait for a better clean high level APIs. Signed-off-by: Jing Liu <jing2.liu@linux.intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
5f7d520dc1
commit
9da2343cb7
@@ -397,6 +397,15 @@ impl PciDevice for VirtioPciDevice {
|
||||
}
|
||||
}
|
||||
|
||||
fn write_config_register(&mut self, reg_idx: usize, offset: u64, data: &[u8]) {
|
||||
self.configuration
|
||||
.write_config_register(reg_idx, offset, data);
|
||||
}
|
||||
|
||||
fn read_config_register(&self, reg_idx: usize) -> u32 {
|
||||
self.configuration.read_reg(reg_idx)
|
||||
}
|
||||
|
||||
fn ioeventfds(&self) -> Vec<(&EventFd, u64, u64)> {
|
||||
let bar0 = self
|
||||
.configuration
|
||||
@@ -589,13 +598,4 @@ impl BusDevice for VirtioPciDevice {
|
||||
fn write(&mut self, offset: u64, data: &[u8]) {
|
||||
self.write_bar(offset, data)
|
||||
}
|
||||
|
||||
fn write_config_register(&mut self, reg_idx: usize, offset: u64, data: &[u8]) {
|
||||
self.configuration
|
||||
.write_config_register(reg_idx, offset, data);
|
||||
}
|
||||
|
||||
fn read_config_register(&self, reg_idx: usize) -> u32 {
|
||||
self.configuration.read_config_register(reg_idx)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user