mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 21:55:20 +00:00
7cbd47a71a
When shutting down a VM using VFIO, the following error has been detected: vfio-ioctls/src/vfio_device.rs:312 -- Could not delete VFIO group: KvmSetDeviceAttr(Error(9)) After some investigation, it appears the KVM device file descriptor used for removing a VFIO group was already closed. This is coming from the Rust sequence of Drop, from the DeviceManager all the way down to VfioDevice. Because the DeviceManager owns passthrough_device, which is effectively a KVM device file descriptor, when the DeviceManager is dropped, the passthrough_device follows, with the effect of closing the KVM device file descriptor. Problem is, VfioDevice has not been dropped yet and it still needs a valid KVM device file descriptor. That's why the simple way to fix this issue coming from Rust dropping all resources is to make Linux accountable for it by duplicating the file descriptor. This way, even when the passthrough_device is dropped, the KVM file descriptor is closed, but a duplicated instance is still valid and owned by the VfioContainer. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |