[PATCH v3 3/5] vfio: Introduce vfio_device_feature helper function

Farhan Ali posted 5 patches 2 days, 23 hours ago
Maintainers: Matthew Rosato <mjrosato@linux.ibm.com>, Eric Farman <farman@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Halil Pasic <pasic@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Alex Williamson <alex.williamson@redhat.com>, "Cédric Le Goater" <clg@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
[PATCH v3 3/5] vfio: Introduce vfio_device_feature helper function
Posted by Farhan Ali 2 days, 23 hours ago
Introduce a helper function to call internal VFIODeviceIOOps
device_feature().

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
---
 hw/vfio/device.c              | 6 ++++++
 include/hw/vfio/vfio-device.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/hw/vfio/device.c b/hw/vfio/device.c
index 08f12ac31f..2ea2af3f79 100644
--- a/hw/vfio/device.c
+++ b/hw/vfio/device.c
@@ -504,6 +504,12 @@ void vfio_device_unprepare(VFIODevice *vbasedev)
     vbasedev->bcontainer = NULL;
 }
 
+int vfio_device_feature(VFIODevice *vbasedev,
+                        struct vfio_device_feature *feature)
+{
+    return vbasedev->io_ops->device_feature(vbasedev, feature);
+}
+
 /*
  * Traditional ioctl() based io
  */
diff --git a/include/hw/vfio/vfio-device.h b/include/hw/vfio/vfio-device.h
index e7e6243e2d..a7f00d2a80 100644
--- a/include/hw/vfio/vfio-device.h
+++ b/include/hw/vfio/vfio-device.h
@@ -157,6 +157,8 @@ bool vfio_device_attach_by_iommu_type(const char *iommu_type, char *name,
                                       Error **errp);
 void vfio_device_detach(VFIODevice *vbasedev);
 VFIODevice *vfio_get_vfio_device(Object *obj);
+int vfio_device_feature(VFIODevice *vbasedev,
+                        struct vfio_device_feature *feat);
 
 typedef QLIST_HEAD(VFIODeviceList, VFIODevice) VFIODeviceList;
 extern VFIODeviceList vfio_device_list;
-- 
2.43.0