pci: Store the type of BAR to return correct address

Based on the type of BAR, we can now provide the correct address related
to a BAR index provided by the caller.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-10-28 10:05:27 -07:00
committed by Samuel Ortiz
parent b51a9e1ef1
commit 4f8054fa82
2 changed files with 13 additions and 12 deletions

View File

@@ -521,9 +521,7 @@ impl PciDevice for VirtioPciDevice {
}
fn ioeventfds(&self) -> Vec<(&EventFd, u64, u64)> {
let bar0 = self
.configuration
.get_bar64_addr(self.settings_bar as usize);
let bar0 = self.configuration.get_bar_addr(self.settings_bar as usize);
let notify_base = bar0 + NOTIFICATION_BAR_OFFSET;
self.queue_evts()
.iter()