From patchwork Wed Oct 4 07:58:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80803E8FDD9 for ; Wed, 4 Oct 2023 08:00:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwn5-0005Bt-FC; Wed, 04 Oct 2023 03:59:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnwn3-00057Y-R6 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:29 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnwmo-0006Mg-TF for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:29 -0400 Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 39418rdg001163; Wed, 4 Oct 2023 00:59:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=oJ5EX9EKG0HkvFwRHhF2aiRbWcNp9jX3HMH++lQaC iQ=; b=mBa6fe5RsN8/VUsJfuMJKtZ+dsqiHfO1tF9jHvVnaypzM6HEyWhM8U/iK vGJg03w1pu2uxWj8dtxe+tTgzmxItLMhi3c8/0jvofoQhoVup+KKBtIm4TrjExsG LHq6ErHWDnL42GRHSbNk9RnVqUQtQasRN96nUa7RwfeiN6otTMjFYvdltC8duyNT TpYU1nSPdrQlJuD9nlXafN2OULFS0A1AoMtyYtJepnFvTMQ760USOdwT+h/jYKlm gerBGnRQJ/dBRIZPBBqqcBjRaezSaq6yj+/BX6VbmGDawz1dFKCXop8oW0SNOLn+ F8A2RLmrW/1/YWc/ZTeSyw4d7hTMw== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3tejrdeh9y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PnEOJOgV4caIqhTm0WZODRCgTZodlQP667xZoz55xdhdtjhvcoKUtgVd6qY3lDLbxYenf7VfzUAiMWeBktyli2Fo8XIupcDVjqrglpUnU9R/uZk4fjf9UuiOV8fbNg5zEBwpKHj6UWDnG2tu2NwE4273OUhuUVT4qujPUw/HtRJAu0PKoHej/pP0yt4jiLbjdtW1rBPlnbG0rndRA2EvkxjSg1R7DXuLp75oXsJC+cSCgSaxeMNP7kxl7IbySd/wt7Ww/sspPtDA4j7qIqTSTqI6vgDSboonczeCsjDkGnSCSjte68cDr1W/uEckRa/hBSQAiovPtrqB7+fwu46ZMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oJ5EX9EKG0HkvFwRHhF2aiRbWcNp9jX3HMH++lQaCiQ=; b=AsIvnxkHR7K354j5vmj8n0MDK555y8wuRYo4Ph1i5w5jdw83JyNeHT/Lf1DCPR2NxufO5kI2FcmE82PKPuMaH+zxhts1tiB4SbT0ywbgklz0ykmCMcJdTwHNz4NBC5uVuL2Uoxk5gnMFFDfEmuFs1eWwUymq1ZQx+u5oqh6msB+qvSDtZIbxkMfngEsN7Ln7ASjUOr4bZmF3JI/GdAVCBj67/r3y2CHZowUw+E6JSUe2ccxjofKjx508YGScvZgIG0zjH1lJqCycMQ82+0H6Mxtkq652FV8JIfCXzv5213Wm8v3a8ArcDaNtLvBEQx3OIIk4oHGs2fc9t0HnrnBmsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oJ5EX9EKG0HkvFwRHhF2aiRbWcNp9jX3HMH++lQaCiQ=; b=mmI0xGMPApSBKzzZsa9U7sVSp3xAZPTC6gtxZgVRgM0jqqfvFNV4/UWA9AHiAPE1EnnyOiUygx9F9AUqO81fs7eCz1Ox6544dN6Uy8aclszLP+BfT+FPFPsx9a9+a8eVqSEpIr+BPTD9xnjSsIazOh0tnjbdPJHfnHRBIcvCuHVjmpzMVuF+4/4ev/yAa08GjihSlfHxeSiw9e8e6aDiAxsglIBrtcnmFdBAy5ezcIcqX30S7oUAxjcKiD/3X2YS1xcQ9D2YewpKiwC3ApAFGZMBnBRvhRtiJId7ggWbjnpeWcQPsWfp5N+z/d7zZRekTaMTwtRZsLb5hHmtrVelTA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:11 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:11 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 08/10] migration: Implement MigrateChannelList to qmp migration flow. Date: Wed, 4 Oct 2023 07:58:49 +0000 Message-Id: <20231004075851.219173-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 593a0a56-7db5-4143-e5aa-08dbc4afcb38 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jq7cCV7sPvmKJk9b983VPur9Dp0e0ycJqVxYsxp4LfeT6jBnLrEuXYWlsqttLMo1/SKWzeDiTBsMYjN7BjtStAPVvALkrSQGjb00suSlwDZEU7v+naN/eHg6/PCc60/yEXvRy4TW3b9qkCWk76tCGZ8x4T72UhtYMfafSxljy2Y6GTKwCMIqpOtwEGp4k5eAL1+lW8L9RlRgHlRHjXB7zFZfK6fZqVPvKquK6WVo+BkNpFxf/EPntxfJaKnagRrjyuyP0KtJ7aS2VMdSTAWah4+jTIl9SohGr+2dTcgLHiP6fh873mFeKeB15xt14A1spMXzO9N9dWrJeDAwVBkH2CRNlzQTjAgoi05vyqnkkGv27ikcYYhisxH7E+y1Fg8DMeNoHN1CVNcVA9qWYB/anZfZ4uB1YDWxrtBTKWHY+yNV2Nf/EWHB+2aoIHjSJrDnob1svPYmPXUr8CoBhDKjtVxz0A++uoeFulh+bIZPpy5diGCiNmO66FybuWNPYkO5fgKtfFSxFdKv9o0T3lqW+JUraFnpVFudavO9K1xf98ei98YgKdsasjgQnWw1M461/RHbLj/zHKAkK6uG5JhSdaAVtsuBHntVXi0pNypn6xa6ti+ZBGrk7KyuwC3d3MUw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IEhJDbzHkaTjFC1wCi4iEt43tawL?= =?utf-8?q?WXTL07wwu+4NT9/0sdieVuHIJX/vaTjDH4LmJiRN0mrbe0a2BUZZ/6ADNvA7u8+FN?= =?utf-8?q?UJym5ikO4UlZcWr9KqCqMoRz/b59FnLGtvyzt1jeezWxcJ0vHzuNxmbqlk3FExZjV?= =?utf-8?q?rZDkalzqA3yyjn24cwiFnzEju5Z49v0tSa2BmHVlc4S7DrGzIoHzCoclviGsAibp7?= =?utf-8?q?FdhFL4QDZ5wX8fQO1FeolJErHhOAOfk91WL1tyyf5YUb3UbcSaShhiWGseV/sOSWT?= =?utf-8?q?IR6NFx0KjjLIWx3rMN+zxfwsA1ZvSLMf2yieJuybPwSlPdOnjYU+yZzn4RlBYzVec?= =?utf-8?q?emFL7eOFxHallK2Ka81Lakt8KIXjZPEPYCyj8OPRxl/sX1bwo8Km5OSupIR/P4Jts?= =?utf-8?q?asgAB3ltSIlJ9koECbLfUzHUbUQaSIHXmXRUjGrFfgvXxReqaulbFxzocozEFQP4N?= =?utf-8?q?7EYgDK6JNgMFAeXaTvEpOTbulohfErOYUM9hKhFSoQGrBgfMdH4BtQWqnHSI6gn9+?= =?utf-8?q?w9YFIk71hdTPCuy1LtkynY5EZjfYK98NqwReqQCMltK9HwLicrPc6MiOZ0rNYq1vO?= =?utf-8?q?FcN861S+auCn/uSJ+vdnyvc8zVDeVCMiTOGh1UUXERYdP+bO1mQDT4ZePtaM9cizH?= =?utf-8?q?Uam5i4EhWwF53aNMRUj8KuRu0fQ/eRMIHH0OxKFP199sxcHxAo1DL02fkGAdSEp7b?= =?utf-8?q?NBfIYX4N8072oPQ4U0/TwFikfrbPMmJrNEajAyF7KkrsCOsw9IKnHCc4fm7K9qV8B?= =?utf-8?q?+unLGZf545o3fo/Ltq8CYdBUWqp5/WOtIqM2A7f4l9nZEntxvnXFttUEnBeSNxo5A?= =?utf-8?q?unuPS4MyEKMVV9FcF5oT5EujwHpFIzpqCxOazUME2I4NP5112xsXkU0VQUSYAH0/3?= =?utf-8?q?+OQ9A5oWixEcI3j1Es1ZEj+/u9J8dorcguRRrYnHlIrYMdkQ3lpJdtdXbD/Tsx/6i?= =?utf-8?q?N6dsvSYturgkJidVHuMtOTOkFrJbl6IQq2FKN8jCXkPFH7EBFxgUsAb1UIbAjmaex?= =?utf-8?q?rd/RUTNueLMfYjNJUuNeedNzAxhnzaJbt7G5AL5jQZIANVKV9je+fm1NSY63Xeljj?= =?utf-8?q?NelAmeBHKKMpeZS06Er5K1ZKoG+xISJB5WahaOJK6SZaAcGH9rD+Kk2RQKa+CrdFy?= =?utf-8?q?D7o0BlVk2kzN855uapA/7uQ6j1shTHim0DZrVGErW57bzTkaTC4w0QTB9WwMSrYQz?= =?utf-8?q?NWzeJW4/qW2FDXW3HKvHswNg0Jv//OV11QP/7OGeGr1goO08lhvH/mycZST38zCDE?= =?utf-8?q?qA3R+sm9iYP8RVzQssM4/AONt09T7VhPtIVGk0W25lX2a8wq/OWCJP+kZcQnNXi7X?= =?utf-8?q?orNUa4jdvlVGS9VFfXAoew3yJtvJ1378yAv761VD6/QnDO48llR6JlcrCkAiI83X0?= =?utf-8?q?xw2v2oWMBQUwLX1sBmvVNHPwsQXvVp+gQs8R00hIRn+gJf/2gn+QWJfNbPBMERwLI?= =?utf-8?q?5Vy35X92kwJltiBOVKV0Q5cXQO2GJEVbVWiGZqbTtxbLc0kaK00It7A5P2j6eaDzr?= =?utf-8?q?5N86wK79GjLN9MGUJG92cqU13ujX0Xh5GQ=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 593a0a56-7db5-4143-e5aa-08dbc4afcb38 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:11.2399 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D4HdMRM+JYsiRScraTVJSfh6p45ow8SqOff+rq0YAey+MVbzxt++kJIa1zvCxc0O1+bbP0GIpHCLXaoCC0rrbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-GUID: ZDTYD-Op4AXSZBiJPgB8hnCkxy2fg-Fj X-Proofpoint-ORIG-GUID: ZDTYD-Op4AXSZBiJPgB8hnCkxy2fg-Fj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for qmp migration. For current series, limit the size of MigrateChannelList to single element (single interface) as runtime check. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 95 +++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 6f948988ec..3eae32e616 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -432,9 +432,10 @@ void migrate_add_address(SocketAddress *address) } static bool migrate_uri_parse(const char *uri, - MigrationAddress **channel, + MigrationChannel **channel, Error **errp) { + g_autoptr(MigrationChannel) val = g_new0(MigrationChannel, 1); g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); SocketAddress *saddr = &addr->u.socket; InetSocketAddress *isock = &addr->u.rdma; @@ -471,7 +472,9 @@ static bool migrate_uri_parse(const char *uri, return false; } - *channel = addr; + val->channel_type = MIGRATION_CHANNEL_TYPE_MAIN; + val->addr = addr; + *channel = val; return true; } @@ -479,41 +482,44 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, MigrationChannelList *channels, Error **errp) { - g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); /* * Having preliminary checks for uri and channel */ - if (has_channels) { - error_setg(errp, "'channels' argument should not be set yet."); - return; - } - if (uri && has_channels) { error_setg(errp, "'uri' and 'channels' arguments are mutually " "exclusive; exactly one of the two should be present in " "'migrate-incoming' qmp command "); return; - } - - if (!uri && !has_channels) { + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel = channels->value; + } else if (uri) { + /* caller uses the old URI syntax */ + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + } else { error_setg(errp, "neither 'uri' or 'channels' argument are " "specified in 'migrate-incoming' qmp command "); return; } - - if (uri && !migrate_uri_parse(uri, &channel, errp)) { - return; - } + addr = channel->addr; /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addr, errp)) { return; } qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { - SocketAddress *saddr = &channel->u.socket; + if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &addr->u.socket; if (saddr->type == SOCKET_ADDRESS_TYPE_INET || saddr->type == SOCKET_ADDRESS_TYPE_UNIX || saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { @@ -522,11 +528,11 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, fd_start_incoming_migration(saddr->u.fd.str, errp); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_incoming_migration(&channel->u.rdma, errp); -#endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_incoming_migration(channel->u.exec.args, errp); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_incoming_migration(&addr->u.rdma, errp); + #endif + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_incoming_migration(addr->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1750,35 +1756,38 @@ void qmp_migrate(const char *uri, bool has_channels, bool resume_requested; Error *local_err = NULL; MigrationState *s = migrate_get_current(); - g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); /* * Having preliminary checks for uri and channel */ - if (has_channels) { - error_setg(errp, "'channels' argument should not be set yet."); - return; - } - if (uri && has_channels) { error_setg(errp, "'uri' and 'channels' arguments are mutually " "exclusive; exactly one of the two should be present in " "'migrate' qmp command "); return; - } - - if (!uri && !has_channels) { + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel = channels->value; + } else if (uri) { + /* caller uses the old URI syntax */ + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + } else { error_setg(errp, "neither 'uri' or 'channels' argument are " "specified in 'migrate' qmp command "); return; } - - if (!migrate_uri_parse(uri, &channel, errp)) { - return; - } + addr = channel->addr; /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addr, errp)) { return; } @@ -1795,8 +1804,8 @@ void qmp_migrate(const char *uri, bool has_channels, } } - if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { - SocketAddress *saddr = &channel->u.socket; + if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &addr->u.socket; if (saddr->type == SOCKET_ADDRESS_TYPE_INET || saddr->type == SOCKET_ADDRESS_TYPE_UNIX || saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { @@ -1805,11 +1814,11 @@ void qmp_migrate(const char *uri, bool has_channels, fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_outgoing_migration(s, &addr->u.rdma, &local_err); #endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, addr->u.exec.args, &local_err); } else { error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol");