> From: Liu, Yi L <yi.l.liu@xxxxxxxxx> > Sent: Thursday, November 24, 2022 8:27 PM > > This makes the device open and close be in paired helpers. > > vfio_device_open(), and vfio_device_close() handles the open_count, and > calls vfio_device_first_open(), and vfio_device_last_close() when > open_count condition is met. This also helps to avoid open code for device > in the vfio_group_ioctl_get_device_fd(), and prepares for further moving I didn't get which 'open code' is referred to here: > @@ -918,7 +935,7 @@ static int vfio_group_ioctl_get_device_fd(struct > vfio_group *group, > goto err_put_device; > } > > - filep = vfio_device_open(device); > + filep = vfio_device_open_file(device); it's simply a replacement of function calls.