vfio/container: Move vfio_container_destroy() to an instance_finalize() handler
commit96b7af4388b38bc1f66467a9c7c8ee9d3bff500f
authorCédric Le Goater <clg@redhat.com>
Mon, 17 Jun 2024 06:34:09 +0000 (17 08:34 +0200)
committerCédric Le Goater <clg@redhat.com>
Mon, 24 Jun 2024 21:15:31 +0000 (24 23:15 +0200)
tree58844bc5ef9699d1af08ae5613caf90a5e89594a
parentb052f73cbec3bf593a04b2f5cdaf3569256859a3
vfio/container: Move vfio_container_destroy() to an instance_finalize() handler

vfio_container_destroy() clears the resources allocated
VFIOContainerBase object. Now that VFIOContainerBase is a QOM object,
add an instance_finalize() handler to do the cleanup. It will be
called through object_unref().

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