Skip to contentSkip to conversation

migration: set correct list pointer when removing notifier

PATCH Applied Matthew Rosato 3 participants 3 messages Nov 13, 2025 – Nov 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 migration: set correct list pointer when removing notifier

In migration_remove_notifier(), g_slist_remove() will search for and potentially remove an entry from the specified list. The return value should be used to update the potentially-changed head pointer of the list that was just searched (migration_state_notifiers[mode]) instead of the migration blockers list.

Fixes dc79c7d5e1 ("migration: multi-mode notifier")
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index c2daab6bdd..9e787749b2 100644
@@ -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;
Signature · 1 line
2.51.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Matthew Rosato

In migration_remove_notifier(), g_slist_remove() will search for and potentially remove an entry from the specified list. The return value should be used to update the potentially-changed head pointer of the list that was just searched (migration_state_notifiers[mode]) instead of the migration blockers list.

Fixes dc79c7d5e1 ("migration: multi-mode notifier")
---
  migration/migration.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +0 -0
index c2daab6bdd..9e787749b2 100644

migration/migration.c void migration_remove_notifier(NotifierWithReturn *notify) · line 1699

Quoted 8 lines
migration/migration.c +1 -1
@@ -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;

Thanks,

C.

Applied
#2 lore raw
In reply to Matthew Rosato
Quoted 28 lines · Matthew Rosato

In migration_remove_notifier(), g_slist_remove() will search for and potentially remove an entry from the specified list. The return value should be used to update the potentially-changed head pointer of the list that was just searched (migration_state_notifiers[mode]) instead of the migration blockers list.

Fixes dc79c7d5e1 ("migration: multi-mode notifier")
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
migration/migration.c +1 -1
index c2daab6bdd..9e787749b2 100644
@@ -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;
Signature · 1 line
2.51.1

queued, thanks.

Signature · 1 line
Peter Xu