(&mut self, old_base: u64, new_base: u64)
| 353 | } |
| 354 | |
| 355 | fn move_bar(&mut self, old_base: u64, new_base: u64) -> result::Result<(), std::io::Error> { |
| 356 | if new_base == self.data_bar_addr() { |
| 357 | if let Some(old_mapping) = self.userspace_mapping.take() { |
| 358 | self.ivshmem_ops |
| 359 | .lock() |
| 360 | .unwrap() |
| 361 | .unmap_ram_region(old_mapping) |
| 362 | .map_err(std::io::Error::other)?; |
| 363 | } |
| 364 | let (region, new_mapping) = self |
| 365 | .ivshmem_ops |
| 366 | .lock() |
| 367 | .unwrap() |
| 368 | .map_ram_region( |
| 369 | new_base, |
| 370 | self.region_size as usize, |
| 371 | self.backend_file.clone(), |
| 372 | ) |
| 373 | .map_err(std::io::Error::other)?; |
| 374 | self.set_region(region, new_mapping); |
| 375 | } |
| 376 | for bar in self.bar_regions.iter_mut() { |
| 377 | if bar.addr() == old_base { |
| 378 | *bar = bar.set_address(new_base); |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | Ok(()) |
| 383 | } |
| 384 | |
| 385 | fn restore_bar_addr(&mut self, params: &BarReprogrammingParams) { |
| 386 | self.configuration.restore_bar_addr(params); |
nothing calls this directly
no test coverage detected