]> git.ipfire.org Git - thirdparty/qemu.git/commit
vfio: Register/unregister container for CPR only once for each container
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Thu, 24 Apr 2025 06:33:55 +0000 (14:33 +0800)
committerCédric Le Goater <clg@redhat.com>
Fri, 25 Apr 2025 07:01:38 +0000 (09:01 +0200)
commitf3028b7d2d9895799159433ccb18180c2d4d1516
tree6f43c0023a219b41d4124a7079e0d02d15c49f3e
parentfdd75967836ca1affa29ad5a50a690851d310cd9
vfio: Register/unregister container for CPR only once for each container

vfio_cpr_register_container and vfio_cpr_unregister_container are container
scoped function. Calling them for each device attaching/detaching would
corrupt CPR reboot notifier list, i.e., when two VFIO devices are attached
to same container and have same notifier registered twice.

Fixes: d9fa4223b30a ("vfio: register container for cpr")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250424063355.3855174-1-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
hw/vfio/iommufd.c