devices: Lock the BtreeMap inside to avoid deadlocks

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-10-23 14:06:13 -07:00
committed by Samuel Ortiz
parent 733e636f02
commit 1870eb4295
4 changed files with 45 additions and 39 deletions

View File

@@ -89,8 +89,8 @@ impl PciBus {
pub fn register_mapping(
&self,
dev: Arc<Mutex<dyn BusDevice>>,
io_bus: &mut devices::Bus,
mmio_bus: &mut devices::Bus,
io_bus: &devices::Bus,
mmio_bus: &devices::Bus,
bars: Vec<(GuestAddress, GuestUsize, PciBarRegionType)>,
) -> Result<()> {
for (address, size, type_) in bars {