mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
pci: don't cleanup msi/msix interrupts repeatedly
We disabled msi/msix twice inside Drop trait for VfioPciDevice, which resulted in error message "Could not disable MSI-X". Eliminating this error by check whether the msi/msix capability is enabled. Signed-off-by: Wu Zongyong <wuzongyong@linux.alibaba.com> CC: Liu Jiang <gerry@linux.alibaba.com>
This commit is contained in:
parent
66fde245b3
commit
d7dc1a9226
@ -573,7 +573,7 @@ impl VfioPciDevice {
|
||||
},
|
||||
Some(InterruptUpdateAction::DisableMsix) => {
|
||||
if let Err(e) = self.device.disable_msix() {
|
||||
warn!("Could not disable MSI: {}", e);
|
||||
warn!("Could not disable MSI-X: {}", e);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
@ -676,12 +676,16 @@ impl VfioPciDevice {
|
||||
|
||||
impl Drop for VfioPciDevice {
|
||||
fn drop(&mut self) {
|
||||
if self.interrupt.msi.is_some() && self.device.disable_msi().is_err() {
|
||||
error!("Could not disable MSI");
|
||||
if let Some(msix) = &self.interrupt.msix {
|
||||
if msix.cap.enabled() && self.device.disable_msix().is_err() {
|
||||
error!("Could not disable MSI-X");
|
||||
}
|
||||
}
|
||||
|
||||
if self.interrupt.msix.is_some() && self.device.disable_msix().is_err() {
|
||||
error!("Could not disable MSI-X");
|
||||
if let Some(msi) = &self.interrupt.msi {
|
||||
if msi.cap.enabled() && self.device.disable_msi().is_err() {
|
||||
error!("Could not disable MSI");
|
||||
}
|
||||
}
|
||||
|
||||
if self.device.unset_dma_map().is_err() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user