[PATCH v4 3/8] vfio: Document vfio_device_get_region_info()

Vivek Kasireddy posted 8 patches 2 weeks, 3 days ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Dmitry Osipenko <dmitry.osipenko@collabora.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>
There is a newer version of this series
[PATCH v4 3/8] vfio: Document vfio_device_get_region_info()
Posted by Vivek Kasireddy 2 weeks, 3 days ago
Add documentation for vfio_device_get_region_info() and clarify the
expectations around its usage.

Cc: Alex Williamson <alex@shazbot.org>
Cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 include/hw/vfio/vfio-device.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h
index 35a5ec6d92..828a31c006 100644
--- a/include/hw/vfio/vfio-device.h
+++ b/include/hw/vfio/vfio-device.h
@@ -275,6 +275,19 @@ bool vfio_device_get_host_iommu_quirk_bypass_ro(VFIODevice *vbasedev,
 int vfio_device_get_feature(VFIODevice *vbasedev,
                             struct vfio_device_feature *feature);
 
+/**
+ * Return the region info for a given region index. The region info includes
+ * details such as size, offset, and capabilities. Note that the returned
+ * info pointer is either a cached copy or newly allocated by
+ * vfio_device_get_region_info(), so the caller is not expected to allocate
+ * or free it.
+ *
+ * @vbasedev: #VFIODevice to use
+ * @index: region index
+ * @info: pointer to store the region info
+ *
+ * Returns 0 on success or a negative value on error.
+ */
 int vfio_device_get_region_info(VFIODevice *vbasedev, int index,
                                 struct vfio_region_info **info);
 int vfio_device_get_region_info_type(VFIODevice *vbasedev, uint32_t type,
-- 
2.50.1


Re: [PATCH v4 3/8] vfio: Document vfio_device_get_region_info()
Posted by Cédric Le Goater 1 week, 5 days ago
On 1/23/26 07:17, Vivek Kasireddy wrote:
> Add documentation for vfio_device_get_region_info() and clarify the
> expectations around its usage.
> 
> Cc: Alex Williamson <alex@shazbot.org>
> Cc: Cédric Le Goater <clg@redhat.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
> ---
>   include/hw/vfio/vfio-device.h | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h
> index 35a5ec6d92..828a31c006 100644
> --- a/include/hw/vfio/vfio-device.h
> +++ b/include/hw/vfio/vfio-device.h
> @@ -275,6 +275,19 @@ bool vfio_device_get_host_iommu_quirk_bypass_ro(VFIODevice *vbasedev,
>   int vfio_device_get_feature(VFIODevice *vbasedev,
>                               struct vfio_device_feature *feature);
>   
> +/**
> + * Return the region info for a given region index. The region info includes
> + * details such as size, offset, and capabilities. Note that the returned
> + * info pointer is either a cached copy or newly allocated by
> + * vfio_device_get_region_info(), so the caller is not expected to allocate
> + * or free it.
> + *
> + * @vbasedev: #VFIODevice to use
> + * @index: region index
> + * @info: pointer to store the region info
> + *
> + * Returns 0 on success or a negative value on error.
> + */
>   int vfio_device_get_region_info(VFIODevice *vbasedev, int index,
>                                   struct vfio_region_info **info);
>   int vfio_device_get_region_info_type(VFIODevice *vbasedev, uint32_t type,

Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.