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

Method has_matching_slots

pci/src/vfio.rs:287–293  ·  view source on GitHub ↗

Returns true if this region has the exact same memory slots as the other region.

(&self, other: &MmioRegion)

Source from the content-addressed store, hash-verified

285impl MmioRegion {
286 /// Returns true if this region has the exact same memory slots as the other region.
287 pub fn has_matching_slots(&self, other: &MmioRegion) -> bool {
288 self.user_memory_regions.len() == other.user_memory_regions.len()
289 && self
290 .user_memory_regions
291 .iter()
292 .all(|u| other.user_memory_regions.iter().any(|o| o.slot == u.slot))
293 }
294}
295
296/// # Safety

Callers 1

eject_deviceMethod · 0.80

Calls 2

iterMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected