MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / move_bar

Method move_bar

devices/src/ivshmem.rs:355–383  ·  view source on GitHub ↗
(&mut self, old_base: u64, new_base: u64)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 9

data_bar_addrMethod · 0.80
takeMethod · 0.80
unmap_ram_regionMethod · 0.80
map_ram_regionMethod · 0.80
set_regionMethod · 0.80
iter_mutMethod · 0.80
set_addressMethod · 0.80
cloneMethod · 0.45
addrMethod · 0.45

Tested by

no test coverage detected