On 10/3/25 11:39 AM, Peter Xu wrote:
> From: Steve Sistare <[email protected]>
> 
> Allow a notifier to be added for multiple migration modes.
> To allow a notifier to appear on multiple per-node lists, use
> a generic list type.  We can no longer use NotifierWithReturnList,
> because it shoe horns the notifier onto a single list.
> 
> Signed-off-by: Steve Sistare <[email protected]>
> Reviewed-by: Fabiano Rosas <[email protected]>
> Link: 
> https://lore.kernel.org/r/[email protected]
> Signed-off-by: Peter Xu <[email protected]>

...

>  void migration_remove_notifier(NotifierWithReturn *notify)
>  {
>      if (notify->notify) {
> -        notifier_with_return_remove(notify);
> +        for (MigMode mode = 0; mode < MIG_MODE__MAX; mode++) {
> +            migration_blockers[mode] =
> +                g_slist_remove(migration_state_notifiers[mode], notify);
> +        }
>          notify->notify = NULL;
>      }

Hi, we started noticing occasional crashes on detach of vfio-pci devices on 
s390x.

The pattern we used to reliably hit the issue is to attach/detach the same 
hostdev to a guest; crash usually happens on the second detach, sometimes the 
third. 

I did a bisect and it points to this patch.  This code isn't my area of 
expertise, but the change above looks wrong.

I tried the following diff and it resolves the crash for me at least:

diff --git a/migration/migration.c b/migration/migration.c
index c2daab6bdd..9e787749b2 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1693,7 +1693,7 @@ void migration_remove_notifier(NotifierWithReturn *notify)
 {
     if (notify->notify) {
         for (MigMode mode = 0; mode < MIG_MODE__MAX; mode++) {
-            migration_blockers[mode] =
+            migration_state_notifiers[mode] =
                 g_slist_remove(migration_state_notifiers[mode], notify);
         }
         notify->notify = NULL;


Reply via email to