vfio/common: return early if space isn't empty
commit1eae5b7bd3ddd03b5591e9122b011c6520064a5a
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Tue, 21 Nov 2023 08:44:02 +0000 (21 16:44 +0800)
committerCédric Le Goater <clg@redhat.com>
Tue, 19 Dec 2023 18:03:38 +0000 (19 19:03 +0100)
tree992edd3a2ea9eba4bd0efaf5c77a198a8d840787
parentd6b5c4c1b516a8176b74ec35a0af8cf89b04b6c1
vfio/common: return early if space isn't empty

This is a trivial optimization. If there is active container in space,
vfio_reset_handler will never be unregistered. So revert the check of
space->containers and return early.

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