Skip to content

Commit e9ab82b

Browse files
lukasstraub2Juan Quintela
authored andcommitted
multifd: Unconditionally unregister yank function
To: qemu-devel <[email protected]> Cc: "Dr. David Alan Gilbert" <[email protected]>, Juan Quintela <[email protected]>, Peter Xu <[email protected]>, Leonardo Bras Soares Passos <[email protected]> Date: Wed, 4 Aug 2021 21:26:32 +0200 (5 weeks, 11 hours, 52 minutes ago) [[PGP Signed Part:No public key for 35AB0B289C5DB258 created at 2021-08-04T21:26:32+0200 using RSA]] Unconditionally unregister yank function in multifd_load_cleanup(). If it is not unregistered here, it will leak and cause a crash in yank_unregister_instance(). Now if the ioc is still in use afterwards, it will only lead to qemu not being able to recover from a hang related to that ioc. After checking the code, i am pretty sure that ref is always 1 when arriving here. So all this currently does is remove the unneeded check. Signed-off-by: Lukas Straub <[email protected]> Reviewed-by: Juan Quintela <[email protected]> Signed-off-by: Juan Quintela <[email protected]>
1 parent 20171ea commit e9ab82b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

migration/multifd.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,7 @@ int multifd_load_cleanup(Error **errp)
991991
for (i = 0; i < migrate_multifd_channels(); i++) {
992992
MultiFDRecvParams *p = &multifd_recv_state->params[i];
993993

994-
if (OBJECT(p->c)->ref == 1) {
995-
migration_ioc_unregister_yank(p->c);
996-
}
997-
994+
migration_ioc_unregister_yank(p->c);
998995
object_unref(OBJECT(p->c));
999996
p->c = NULL;
1000997
qemu_mutex_destroy(&p->mutex);

0 commit comments

Comments
 (0)