On Fri, Jan 06, 2023 at 11:04:42PM +0800, Yi Liu wrote: > > This will allow the VFIO device file to close and drop the users_count > > yeah. It's interesting I haven't hit real problem so far. But this does > look to be a circular. When I ctrl+c to kill qemu, I can boot qemu again > with the same device assigned. anyhow, let me add some prtink to check > it. thanks for the catch. You have to test with one of the situations that hold the kvm ref during open, eg gvt on intel To make it happen hack the vfio code to hold the reference at open_device and let it go during close_device, then you should see the problem. Jason