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

Method drop

pci/src/vfio_user.rs:503–525  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

501
502impl Drop for VfioUserPciDevice {
503 fn drop(&mut self) {
504 self.unmap_mmio_regions();
505
506 if let Some(msix) = &self.common.interrupt.msix
507 && msix.bar.enabled()
508 {
509 self.common.disable_msix();
510 }
511
512 if let Some(msi) = &self.common.interrupt.msi
513 && msi.cfg.enabled()
514 {
515 self.common.disable_msi();
516 }
517
518 if self.common.interrupt.intx_in_use() {
519 self.common.disable_intx();
520 }
521
522 if let Err(e) = self.client.lock().unwrap().shutdown() {
523 error!("Failed shutting down vfio-user client: {e}");
524 }
525 }
526}
527
528impl Pausable for VfioUserPciDevice {}

Callers

nothing calls this directly

Calls 7

intx_in_useMethod · 0.80
disable_intxMethod · 0.80
unmap_mmio_regionsMethod · 0.45
enabledMethod · 0.45
disable_msixMethod · 0.45
disable_msiMethod · 0.45
shutdownMethod · 0.45

Tested by

no test coverage detected