qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migration: set correct list pointer when removing notifier
@ 2025-11-13 21:35 Matthew Rosato
  2025-11-14  6:37 ` Cédric Le Goater
  2025-11-14 15:48 ` Peter Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Rosato @ 2025-11-13 21:35 UTC (permalink / raw)
  To: peterx; +Cc: farosas, steven.sistare, alex, clg, qemu-devel

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>
---
 migration/migration.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.51.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] migration: set correct list pointer when removing notifier
  2025-11-13 21:35 [PATCH] migration: set correct list pointer when removing notifier Matthew Rosato
@ 2025-11-14  6:37 ` Cédric Le Goater
  2025-11-14 15:48 ` Peter Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Cédric Le Goater @ 2025-11-14  6:37 UTC (permalink / raw)
  To: Matthew Rosato, peterx; +Cc: farosas, steven.sistare, alex, qemu-devel

On 11/13/25 22:35, Matthew Rosato wrote:
> 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>
> ---
>   migration/migration.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] migration: set correct list pointer when removing notifier
  2025-11-13 21:35 [PATCH] migration: set correct list pointer when removing notifier Matthew Rosato
  2025-11-14  6:37 ` Cédric Le Goater
@ 2025-11-14 15:48 ` Peter Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2025-11-14 15:48 UTC (permalink / raw)
  To: Matthew Rosato; +Cc: farosas, steven.sistare, alex, clg, qemu-devel

On Thu, Nov 13, 2025 at 04:35:45PM -0500, Matthew Rosato wrote:
> 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>
> ---
>  migration/migration.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;
> -- 
> 2.51.1
> 

queued, thanks.

-- 
Peter Xu



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-14 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 21:35 [PATCH] migration: set correct list pointer when removing notifier Matthew Rosato
2025-11-14  6:37 ` Cédric Le Goater
2025-11-14 15:48 ` Peter Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).