]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
migration: set correct list pointer when removing notifier
authorMatthew Rosato <mjrosato@linux.ibm.com>
Thu, 13 Nov 2025 21:35:45 +0000 (16:35 -0500)
committerPeter Xu <peterx@redhat.com>
Fri, 21 Nov 2025 15:33:21 +0000 (10:33 -0500)
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")
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/r/20251113213545.513453-1-mjrosato@linux.ibm.com
Signed-off-by: Peter Xu <peterx@redhat.com>
migration/migration.c

index 1b2c02d7fae3132079804922193f334ddca1ac4b..b316ee01ab253d03605b40479c7113be12b4668c 100644 (file)
@@ -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;