On Mon, Dec 19, 2022 at 12:47:11AM -0800, Yi Liu wrote: > This defines KVM_DEV_VFIO_FILE* and make alias with KVM_DEV_VFIO_GROUP*. > Old userspace uses KVM_DEV_VFIO_GROUP* works as well. Do we have a circular refcount problem with this plan? The kvm will hold a ref on the vfio device struct file Once the vfio device struct file reaches open_device we will hold a ref on the kvm At this point if both kvm and vfio device FDs are closed will the kernel clean it up or does it leak because they both ref each other? Please test to confirm.. Jason