summary refs log tree commit diff stats
path: root/migration/multifd.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2021-07-22 13:58:39 -0400
committerDr. David Alan Gilbert <dgilbert@redhat.com>2021-07-26 12:44:54 +0100
commit18711405b506e7ca3822ed19830f1c562e0247f9 (patch)
treefabb0f87cb34e59fa61855f1cd14f9dae5f1550c /migration/multifd.c
parent43044ac0ee5758d92b639843c045123c2de578d1 (diff)
downloadfocaccia-qemu-18711405b506e7ca3822ed19830f1c562e0247f9.tar.gz
focaccia-qemu-18711405b506e7ca3822ed19830f1c562e0247f9.zip
migration: Introduce migration_ioc_[un]register_yank()
There're plenty of places in migration/* that checks against either socket or
tls typed ioc for yank operations.  Provide two helpers to hide all these
information.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210722175841.938739-4-peterx@redhat.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/multifd.c')
-rw-r--r--migration/multifd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/migration/multifd.c b/migration/multifd.c
index ab41590e71..377da78f5b 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -987,12 +987,8 @@ int multifd_load_cleanup(Error **errp)
     for (i = 0; i < migrate_multifd_channels(); i++) {
         MultiFDRecvParams *p = &multifd_recv_state->params[i];
 
-        if ((object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET) ||
-             object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_TLS))
-            && OBJECT(p->c)->ref == 1) {
-            yank_unregister_function(MIGRATION_YANK_INSTANCE,
-                                     migration_yank_iochannel,
-                                     QIO_CHANNEL(p->c));
+        if (OBJECT(p->c)->ref == 1) {
+            migration_ioc_unregister_yank(p->c);
         }
 
         object_unref(OBJECT(p->c));