vfio_user: Shutdown the communication with the backend

Whenever a vfio-user device is dropped, the communication between the
VMM and the backend should be shutdown.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2022-03-17 11:24:54 +01:00
parent 9c95109a6b
commit 028961ac9f
2 changed files with 12 additions and 0 deletions
+4
View File
@@ -506,6 +506,10 @@ impl Drop for VfioUserPciDevice {
if self.common.interrupt.intx_in_use() {
self.common.disable_intx(&self.vfio_wrapper);
}
if let Err(e) = self.client.lock().unwrap().shutdown() {
error!("Failed shutting down vfio-user client: {}", e);
}
}
}