summary refs log tree commit diff stats
path: root/migration/qemu-file-channel.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2021-07-22 13:58:41 -0400
committerDr. David Alan Gilbert <dgilbert@redhat.com>2021-07-26 12:45:03 +0100
commit39675ffffb3394d44b880d083a214c5e44786170 (patch)
treeac3be89aab3c71d61ad772e6c28f7fe523f43ff7 /migration/qemu-file-channel.c
parentc6ad5be7ae5b8c6bbbd0c592bbf18d4a78540516 (diff)
downloadfocaccia-qemu-39675ffffb3394d44b880d083a214c5e44786170.tar.gz
focaccia-qemu-39675ffffb3394d44b880d083a214c5e44786170.zip
migration: Move the yank unregister of channel_close out
It's efficient, but hackish to call yank unregister calls in channel_close(),
especially it'll be hard to debug when qemu crashed with some yank function
leaked.

Remove that hack, but instead explicitly unregister yank functions at the
places where needed, they are:

  (on src)
  - migrate_fd_cleanup
  - postcopy_pause

  (on dst)
  - migration_incoming_state_destroy
  - postcopy_pause_incoming

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210722175841.938739-6-peterx@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/qemu-file-channel.c')
-rw-r--r--migration/qemu-file-channel.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c
index 2f8b1fcd46..bb5a5752df 100644
--- a/migration/qemu-file-channel.c
+++ b/migration/qemu-file-channel.c
@@ -107,9 +107,6 @@ static int channel_close(void *opaque, Error **errp)
     int ret;
     QIOChannel *ioc = QIO_CHANNEL(opaque);
     ret = qio_channel_close(ioc, errp);
-    if (OBJECT(ioc)->ref == 1) {
-        migration_ioc_unregister_yank(ioc);
-    }
     object_unref(OBJECT(ioc));
     return ret;
 }