> From: Jason Gunthorpe <jgg@xxxxxxxxxx> > Sent: Friday, February 17, 2023 11:59 PM > > On Fri, Feb 17, 2023 at 10:55:08AM +0000, Liu, Yi L wrote: > > > One more thinking on this. For a single device, my above reply is true. > > The device should have been fully-opened when its > GET_PCI_HOT_RESET_INFO > > and HOT_RESET path have been unblocked. However, when there are > > multiple devices that have been affected by the hotreset. User may only > > have one device that is fully opened while others are not yet. In such case, > > existing vfio_file_is_valid() is not enough. Shall we have another API for > > this purpose? E.g. if it's cdev fd, then the new API return true only when > > the device is fully opened. Any suggestion here? > > I think what I heard is you need two APIs, one for pci and one for KVM > and the PCI one requires binding to succeed. Yes. One is vfio_file_is_valid() - for KVM Another one is vfio_file_device_opened() - for PCI. Regards, Yi Liu