vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Tue, 21 Nov 2023 08:44:17 +0000 (16:44 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 19 Dec 2023 18:03:38 +0000 (19:03 +0100)
commit4517c33c31d392f08fa96a9db911da1e3507be94
tree1880aca887eea43c2fac4d3840e43a5f4c383273
parent909a6254edaa8d0b0e3f1c0a623862e73d1842e9
vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks

Some of the callbacks in VFIOIOMMUOps pass VFIOContainerBase poiner,
those callbacks only need read access to the sub object of VFIOContainerBase.
So make VFIOContainerBase, VFIOContainer and VFIOIOMMUFDContainer as const
in these callbacks.

Local functions called by those callbacks also need same changes to avoid
build error.

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/common.c
hw/vfio/container-base.c
hw/vfio/container.c
hw/vfio/iommufd.c
include/hw/vfio/vfio-common.h
include/hw/vfio/vfio-container-base.h