Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2177608/?format=api
{ "id": 2177608, "url": "http://patchwork.ozlabs.org/api/patches/2177608/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20251226211930.27565-15-farosas@suse.de/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20251226211930.27565-15-farosas@suse.de>", "list_archive_url": null, "date": "2025-12-26T21:19:16", "name": "[RFC,14/25] migration: Remove QEMUFile from channel.c", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b00a22b367fcf8845dba25b844b356103bbe53d8", "submitter": { "id": 85343, "url": "http://patchwork.ozlabs.org/api/people/85343/?format=api", "name": "Fabiano Rosas", "email": "farosas@suse.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20251226211930.27565-15-farosas@suse.de/mbox/", "series": [ { "id": 486505, "url": "http://patchwork.ozlabs.org/api/series/486505/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=486505", "date": "2025-12-26T21:19:04", "name": "migration: Cleanup early connection code", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/486505/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2177608/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2177608/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=w25SP+2n;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=OD1xqjTL;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=w25SP+2n;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=OD1xqjTL;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)", "smtp-out1.suse.de;\n\tnone" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4ddJSx2qCVz1y3s\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 27 Dec 2025 08:21:21 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vZFEJ-0001Qh-0x; Fri, 26 Dec 2025 16:20:11 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <farosas@suse.de>) id 1vZFEH-0001QE-Ff\n for qemu-devel@nongnu.org; Fri, 26 Dec 2025 16:20:09 -0500", "from smtp-out1.suse.de ([195.135.223.130])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <farosas@suse.de>) id 1vZFEF-00042s-5W\n for qemu-devel@nongnu.org; Fri, 26 Dec 2025 16:20:09 -0500", "from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id 2725D336A8;\n Fri, 26 Dec 2025 21:19:57 +0000 (UTC)", "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id CF65E3EA63;\n Fri, 26 Dec 2025 21:19:55 +0000 (UTC)", "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id ANiBI/v7TmnwJwAAD6G6ig\n (envelope-from <farosas@suse.de>); Fri, 26 Dec 2025 21:19:55 +0000" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1766783997;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=7EjOJVRn+KNW3Hro0z0DceSzxWOMd1iQUeK8vxjomCk=;\n b=w25SP+2nOZyMHsKD47XbFNPraeNf8guPbC8u125Yc/xQWsOs2/VmCRSpoPwDBYEBPTnNoc\n DMuBq29KHhj2cm15h9esmM6S2fEoUEu0hKvUdXkTrMFuNImpCFMUdZdUweP0J23iKy+oxr\n Hr3Ogt06fk/RxedhzuGAwnIHUb/1QVs=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1766783997;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=7EjOJVRn+KNW3Hro0z0DceSzxWOMd1iQUeK8vxjomCk=;\n b=OD1xqjTLDhIUALKyciGW2L2sJ1zauzUtn10NQVlZ+GH4JgTjWIDkvWUNYXlAFP6ThcwtpR\n 882T+Br4lvqrEsDA==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1766783997;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=7EjOJVRn+KNW3Hro0z0DceSzxWOMd1iQUeK8vxjomCk=;\n b=w25SP+2nOZyMHsKD47XbFNPraeNf8guPbC8u125Yc/xQWsOs2/VmCRSpoPwDBYEBPTnNoc\n DMuBq29KHhj2cm15h9esmM6S2fEoUEu0hKvUdXkTrMFuNImpCFMUdZdUweP0J23iKy+oxr\n Hr3Ogt06fk/RxedhzuGAwnIHUb/1QVs=", "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1766783997;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=7EjOJVRn+KNW3Hro0z0DceSzxWOMd1iQUeK8vxjomCk=;\n b=OD1xqjTLDhIUALKyciGW2L2sJ1zauzUtn10NQVlZ+GH4JgTjWIDkvWUNYXlAFP6ThcwtpR\n 882T+Br4lvqrEsDA==" ], "From": "Fabiano Rosas <farosas@suse.de>", "To": "qemu-devel@nongnu.org", "Cc": "peterx@redhat.com,\n\tLi Zhijian <lizhijian@fujitsu.com>", "Subject": "[RFC PATCH 14/25] migration: Remove QEMUFile from channel.c", "Date": "Fri, 26 Dec 2025 18:19:16 -0300", "Message-ID": "<20251226211930.27565-15-farosas@suse.de>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20251226211930.27565-1-farosas@suse.de>", "References": "<20251226211930.27565-1-farosas@suse.de>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spamd-Result": "default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[];\n R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.988];\n MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+];\n TO_DN_SOME(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo];\n RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[];\n RCVD_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n RCPT_COUNT_THREE(0.00)[3]; RCVD_TLS_ALL(0.00)[]", "X-Spam-Score": "-2.80", "Received-SPF": "pass client-ip=195.135.223.130; envelope-from=farosas@suse.de;\n helo=smtp-out1.suse.de", "X-Spam_score_int": "-43", "X-Spam_score": "-4.4", "X-Spam_bar": "----", "X-Spam_report": "(-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Make channel.c deal only with QIOChannel objects. Move any handling of\nQEMUFile into migration.c. To achieve this in a clean way:\n\n1) Define a migration_outgoing_setup, analogous to\nmigration_incoming_setup, responsible for creating the QEMUFile from\nthe QIOChannel.\n\n2) Increase the scope of migration_incoming_setup to create not only\nthe main channel, but all the others as well. That is currently being\ndone at migration_ioc_process, so move the code.\n\n3) Adjust RDMA code to pass in the QIOChannel and remove some of the\nusage of QEMUFile.\n\nSigned-off-by: Fabiano Rosas <farosas@suse.de>\n---\n migration/channel.c | 21 ++++++-----\n migration/migration.c | 88 ++++++++++++++++++++++---------------------\n migration/migration.h | 6 ++-\n migration/multifd.c | 7 ++--\n migration/multifd.h | 2 +-\n migration/rdma.c | 28 ++++----------\n 6 files changed, 73 insertions(+), 79 deletions(-)", "diff": "diff --git a/migration/channel.c b/migration/channel.c\nindex 7243b99108..af6c2cc76e 100644\n--- a/migration/channel.c\n+++ b/migration/channel.c\n@@ -14,7 +14,6 @@\n #include \"channel.h\"\n #include \"tls.h\"\n #include \"migration.h\"\n-#include \"qemu-file.h\"\n #include \"trace.h\"\n #include \"qapi/error.h\"\n #include \"io/channel-tls.h\"\n@@ -34,6 +33,7 @@ void migration_channel_process_incoming(QIOChannel *ioc)\n {\n MigrationIncomingState *mis = migration_incoming_get_current();\n Error *local_err = NULL;\n+ uint8_t ch;\n \n trace_migration_set_incoming_channel(\n ioc, object_get_typename(OBJECT(ioc)));\n@@ -42,9 +42,16 @@ void migration_channel_process_incoming(QIOChannel *ioc)\n migration_tls_channel_process_incoming(ioc, &local_err);\n } else {\n migration_ioc_register_yank(ioc);\n- migration_ioc_process_incoming(ioc, &local_err);\n- }\n+ ch = migration_ioc_process_incoming(ioc, &local_err);\n+ if (!ch) {\n+ goto out;\n+ }\n \n+ if (migration_incoming_setup(ioc, ch, &local_err)) {\n+ migration_incoming_process();\n+ }\n+ }\n+out:\n if (local_err) {\n error_report_err(local_err);\n migrate_set_state(&mis->state, mis->state, MIGRATION_STATUS_FAILED);\n@@ -75,14 +82,8 @@ void migration_channel_connect(MigrationState *s, QIOChannel *ioc)\n return;\n }\n \n- QEMUFile *f = qemu_file_new_output(ioc);\n-\n migration_ioc_register_yank(ioc);\n-\n- qemu_mutex_lock(&s->qemu_file_lock);\n- s->to_dst_file = f;\n- qemu_mutex_unlock(&s->qemu_file_lock);\n-\n+ migration_outgoing_setup(ioc);\n migration_connect(s);\n }\n \ndiff --git a/migration/migration.c b/migration/migration.c\nindex 5c6c76f110..677581b5a5 100644\n--- a/migration/migration.c\n+++ b/migration/migration.c\n@@ -92,7 +92,7 @@ enum mig_rp_message_type {\n };\n \n /* Migration channel types */\n-enum { CH_MAIN, CH_MULTIFD, CH_POSTCOPY };\n+enum { CH_NONE, CH_MAIN, CH_MULTIFD, CH_POSTCOPY };\n \n /* When we add fault tolerance, we could have several\n migrations at once. For now we don't need to add\n@@ -934,17 +934,48 @@ out:\n migrate_incoming_unref_outgoing_state();\n }\n \n-/**\n- * migration_incoming_setup: Setup incoming migration\n- * @f: file for main migration channel\n- */\n-static void migration_incoming_setup(QEMUFile *f)\n+static bool migration_has_main_and_multifd_channels(void);\n+\n+bool migration_incoming_setup(QIOChannel *ioc, uint8_t channel, Error **errp)\n {\n MigrationIncomingState *mis = migration_incoming_get_current();\n+ QEMUFile *f;\n \n- assert(!mis->from_src_file);\n- mis->from_src_file = f;\n- qemu_file_set_blocking(f, false, &error_abort);\n+ switch (channel) {\n+ case CH_MAIN:\n+ f = qemu_file_new_input(ioc);\n+ assert(!mis->from_src_file);\n+ mis->from_src_file = f;\n+ qemu_file_set_blocking(f, false, &error_abort);\n+ break;\n+\n+ case CH_MULTIFD:\n+ if (!multifd_recv_new_channel(ioc, errp)) {\n+ return false;\n+ }\n+ break;\n+\n+ case CH_POSTCOPY:\n+ assert(!mis->postcopy_qemufile_dst);\n+ f = qemu_file_new_input(ioc);\n+ postcopy_preempt_new_channel(mis, f);\n+ return false;\n+\n+ default:\n+ g_assert_not_reached();\n+ }\n+\n+ return migration_has_main_and_multifd_channels();\n+}\n+\n+void migration_outgoing_setup(QIOChannel *ioc)\n+{\n+ MigrationState *s = migrate_get_current();\n+ QEMUFile *f = qemu_file_new_output(ioc);\n+\n+ qemu_mutex_lock(&s->qemu_file_lock);\n+ s->to_dst_file = f;\n+ qemu_mutex_unlock(&s->qemu_file_lock);\n }\n \n /* Returns true if recovered from a paused migration, otherwise false */\n@@ -990,12 +1021,6 @@ void migration_incoming_process(void)\n qemu_coroutine_enter(co);\n }\n \n-void migration_fd_process_incoming(QEMUFile *f)\n-{\n- migration_incoming_setup(f);\n- migration_incoming_process();\n-}\n-\n static bool migration_has_main_and_multifd_channels(void)\n {\n MigrationIncomingState *mis = migration_incoming_get_current();\n@@ -1012,12 +1037,10 @@ static bool migration_has_main_and_multifd_channels(void)\n return true;\n }\n \n-void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)\n+uint8_t migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)\n {\n MigrationIncomingState *mis = migration_incoming_get_current();\n- Error *local_err = NULL;\n- QEMUFile *f;\n- uint8_t channel;\n+ uint8_t channel = CH_NONE;\n uint32_t channel_magic = 0;\n int ret = 0;\n \n@@ -1036,7 +1059,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)\n ret = migration_channel_read_peek(ioc, (void *)&channel_magic,\n sizeof(channel_magic), errp);\n if (ret != 0) {\n- return;\n+ goto out;\n }\n \n channel_magic = be32_to_cpu(channel_magic);\n@@ -1051,7 +1074,6 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)\n channel = CH_MAIN;\n } else {\n error_setg(errp, \"unknown channel magic: %u\", channel_magic);\n- return;\n }\n } else if (mis->from_src_file && migrate_multifd()) {\n /*\n@@ -1063,33 +1085,13 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp)\n channel = CH_MAIN;\n } else {\n error_setg(errp, \"non-peekable channel used without multifd\");\n- return;\n }\n } else {\n assert(migrate_postcopy_preempt());\n channel = CH_POSTCOPY;\n }\n-\n- if (channel == CH_MAIN) {\n- f = qemu_file_new_input(ioc);\n- migration_incoming_setup(f);\n- } else if (channel == CH_MULTIFD) {\n- /* Multiple connections */\n- multifd_recv_new_channel(ioc, &local_err);\n- if (local_err) {\n- error_propagate(errp, local_err);\n- return;\n- }\n- } else if (channel == CH_POSTCOPY) {\n- assert(!mis->postcopy_qemufile_dst);\n- f = qemu_file_new_input(ioc);\n- postcopy_preempt_new_channel(mis, f);\n- return;\n- }\n-\n- if (migration_has_main_and_multifd_channels()) {\n- migration_incoming_process();\n- }\n+out:\n+ return channel;\n }\n \n /**\ndiff --git a/migration/migration.h b/migration/migration.h\nindex f340cd518d..d2b82cf54f 100644\n--- a/migration/migration.h\n+++ b/migration/migration.h\n@@ -526,8 +526,10 @@ struct MigrationState {\n void migrate_set_state(MigrationStatus *state, MigrationStatus old_state,\n MigrationStatus new_state);\n \n-void migration_fd_process_incoming(QEMUFile *f);\n-void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp);\n+void migration_outgoing_setup(QIOChannel *ioc);\n+bool migration_incoming_setup(QIOChannel *ioc, uint8_t channel, Error **errp);\n+\n+uint8_t migration_ioc_process_incoming(QIOChannel *ioc, Error **errp);\n void migration_incoming_process(void);\n \n bool migration_has_all_channels(void);\ndiff --git a/migration/multifd.c b/migration/multifd.c\nindex 3fb1a07ba9..c6639dbab5 100644\n--- a/migration/multifd.c\n+++ b/migration/multifd.c\n@@ -1521,7 +1521,7 @@ bool multifd_recv_all_channels_created(void)\n * Try to receive all multifd channels to get ready for the migration.\n * Sets @errp when failing to receive the current channel.\n */\n-void multifd_recv_new_channel(QIOChannel *ioc, Error **errp)\n+bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp)\n {\n MultiFDRecvParams *p;\n Error *local_err = NULL;\n@@ -1536,7 +1536,7 @@ void multifd_recv_new_channel(QIOChannel *ioc, Error **errp)\n \"failed to receive packet\"\n \" via multifd channel %d: \",\n qatomic_read(&multifd_recv_state->count));\n- return;\n+ return false;\n }\n trace_multifd_recv_new_channel(id);\n } else {\n@@ -1549,7 +1549,7 @@ void multifd_recv_new_channel(QIOChannel *ioc, Error **errp)\n id);\n multifd_recv_terminate_threads(error_copy(local_err));\n error_propagate(errp, local_err);\n- return;\n+ return false;\n }\n p->c = ioc;\n object_ref(OBJECT(ioc));\n@@ -1558,4 +1558,5 @@ void multifd_recv_new_channel(QIOChannel *ioc, Error **errp)\n qemu_thread_create(&p->thread, p->name, multifd_recv_thread, p,\n QEMU_THREAD_JOINABLE);\n qatomic_inc(&multifd_recv_state->count);\n+ return true;\n }\ndiff --git a/migration/multifd.h b/migration/multifd.h\nindex 9b6d81e7ed..89a395aef2 100644\n--- a/migration/multifd.h\n+++ b/migration/multifd.h\n@@ -42,7 +42,7 @@ int multifd_recv_setup(Error **errp);\n void multifd_recv_cleanup(void);\n void multifd_recv_shutdown(void);\n bool multifd_recv_all_channels_created(void);\n-void multifd_recv_new_channel(QIOChannel *ioc, Error **errp);\n+bool multifd_recv_new_channel(QIOChannel *ioc, Error **errp);\n void multifd_recv_sync_main(void);\n int multifd_send_sync_main(MultiFDSyncReq req);\n bool multifd_queue_page(RAMBlock *block, ram_addr_t offset);\ndiff --git a/migration/rdma.c b/migration/rdma.c\nindex 596a1aba0b..7bee871e2b 100644\n--- a/migration/rdma.c\n+++ b/migration/rdma.c\n@@ -384,7 +384,6 @@ struct QIOChannelRDMA {\n QIOChannel parent;\n RDMAContext *rdmain;\n RDMAContext *rdmaout;\n- QEMUFile *file;\n bool blocking; /* XXX we don't actually honour this yet */\n };\n \n@@ -3836,32 +3835,20 @@ static void qio_channel_rdma_register_types(void)\n \n type_init(qio_channel_rdma_register_types);\n \n-static QEMUFile *rdma_new_input(RDMAContext *rdma)\n+static QIOChannel *rdma_new_ioc(RDMAContext *rdma)\n {\n QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(object_new(TYPE_QIO_CHANNEL_RDMA));\n \n- rioc->file = qemu_file_new_input(QIO_CHANNEL(rioc));\n- rioc->rdmain = rdma;\n- rioc->rdmaout = rdma->return_path;\n-\n- return rioc->file;\n-}\n-\n-static QEMUFile *rdma_new_output(RDMAContext *rdma)\n-{\n- QIOChannelRDMA *rioc = QIO_CHANNEL_RDMA(object_new(TYPE_QIO_CHANNEL_RDMA));\n-\n- rioc->file = qemu_file_new_output(QIO_CHANNEL(rioc));\n rioc->rdmaout = rdma;\n rioc->rdmain = rdma->return_path;\n \n- return rioc->file;\n+ return QIO_CHANNEL(rioc);\n }\n \n static void rdma_accept_incoming_migration(void *opaque)\n {\n RDMAContext *rdma = opaque;\n- QEMUFile *f;\n+ QIOChannel *ioc;\n \n trace_qemu_rdma_accept_incoming_migration();\n if (qemu_rdma_accept(rdma) < 0) {\n@@ -3875,15 +3862,16 @@ static void rdma_accept_incoming_migration(void *opaque)\n return;\n }\n \n- f = rdma_new_input(rdma);\n- if (f == NULL) {\n+ ioc = rdma_new_ioc(rdma);\n+ if (!ioc) {\n error_report(\"RDMA ERROR: could not open RDMA for input\");\n qemu_rdma_cleanup(rdma);\n return;\n }\n \n rdma->migration_started_on_destination = 1;\n- migration_fd_process_incoming(f);\n+ migration_incoming_setup(ioc, 0, NULL);\n+ migration_incoming_process();\n }\n \n void rdma_start_incoming_migration(InetSocketAddress *host_port,\n@@ -3995,8 +3983,8 @@ void rdma_start_outgoing_migration(void *opaque,\n \n trace_rdma_start_outgoing_migration_after_rdma_connect();\n \n- s->to_dst_file = rdma_new_output(rdma);\n s->rdma_migration = true;\n+ migration_outgoing_setup(rdma_new_ioc(rdma));\n migration_connect(s);\n return;\n return_path_err:\n", "prefixes": [ "RFC", "14/25" ] }