Re: [RFC v2 06/11] vfio: Move device open/close code to be helpfers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022/11/28 16:21, Tian, Kevin wrote:
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:

it's the device->open_count things. but you are right, it's not in the
vfio_group_ioctl_get_device_fd().

@@ -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.

so more accurate description is splitting the vfio_device_open() into
common vfio_device_open() which is paired with vfio_device_close(), and
another wrapper to deal with device open and device file open, which is
group path specific.

--
Regards,
Yi Liu



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux