From patchwork Fri Jul 21 14:49:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 1810974 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=proofpoint20171006 header.b=nrwAKbOg; dkim=pass (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=L26AQoBe; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R6stm4YGRz1yYc for ; Sat, 22 Jul 2023 00:50:56 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrS7-0003NM-Gd; Fri, 21 Jul 2023 10:49:57 -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 1qMrRu-0003CS-6I for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:42 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMrRs-0004oH-3L for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:41 -0400 Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36LDgFEA003513; Fri, 21 Jul 2023 07:49:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=mwdRW+MdTR8iJH0iLxZ9P37udxvDOnfKoxcXCXxju do=; b=nrwAKbOgsDTsqpSpvHVRoEBycxcdfCoALMNsyQvSpN5Cov+sClvWYsBn+ MGbiS22tZtW6U8zsvHIMrnnglYRkeZGAMtkBkuCZ0T8oMNmRcM1CPt0iGONN5q4n mGmEVf7l1scsRDmLoP0ZaPL7og9vvxAxiNENfZIaM2kOwX3huqq/15J+CcbqERHW iHIXNcT277ZtVb/dYulOmdfbx+ZzcR8pb7fHF0gVSGTFBg73lEL3z/qIGK6S+leS 4+SsYB6Mqoi2UPss+SAMUqU+IjSu5bXQVNw877VGNchQJwRxHQwC/Z8Ebt4O19Rj fiaF1PCFz69ggyzmcIF9Xh1YIYYzg== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx2wn73f8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SPR70PfoAg+6ttlObV462S9qm2N2vdCWJ1dPoPDU340exOyad5ZlCcLY0gjjiSuR6dJNX7d8Rqvj8WLcvyBtFl7Li0vs9A2EMOaYCNG73TQLc/+sbPUn+QyLyIqfKABNWV2hd1F+Uc6Kfn9lK9jkgSzq2tDwWiRtJo7MbKBrkQTO+kohNIpnoTcb62+epZDBGuDbXFvAIaGBaBk2ffllvwiihQq9FbQQZiHWHCu678hRHu1BuR6EtFRo0RsqfvCK8XEpzYJ5aVo06H4ERrS5MysH72Ft9YyCF6sWrZByohQKcOdzcvLiozUTvitqYr1mD2OwB+VB4cDpUvNGge7RqQ== 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=mwdRW+MdTR8iJH0iLxZ9P37udxvDOnfKoxcXCXxjudo=; b=Fczfs/yOCQeER0McUwO/sFiWrqxR6rVIKOktDrea9EGql872HPXNVj89lMObnulDxADZfngsR8k3p6eb7+WkWw0glcEfyuagR4pb7Tq0nHe1jSn+pIrle4sw68DuV+cNXNaFciorElSUCmPJpXSzA8IguN8eSyc0wtMMjze2sOPHCkH2/GtWpgHJbVwFJ7Pgl5Iqj6sC63xXy0oLw44Z6Dv4YgCHFMDNL1IlOopKMeMLAx+yHSoUyEiq0T/VtNjFMO1k1k1uXmXuRU/Pt95MGzB6yqH0qg61d2pKhMh8C2VPZVA2v8/Fu+AmWoTkmZZw6eArExXiDiqYXGFgFHS/eQ== 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=mwdRW+MdTR8iJH0iLxZ9P37udxvDOnfKoxcXCXxjudo=; b=L26AQoBeRJw47u9k8ZJJ3OXW5dpchHQVI1g/mFnYn+JLlbbsb5zCsIIY1J90HFVxlT2fnGhkjITQvBrV6tlCsecOj2NsCv6fLfXczw6efi6ciFBl5XIclEG4asetKo/CHOzk9Ow/fXpZgj7S9qRTA+TXDwom8RAqknVGU2rD4sNygYAVm5oxrl8JyXpUOTw2ABPAnPl+6Chps69bXvDnXYlr5f/OCIfbbQ/lFqz2v0DBVQIjxM8xuIc7XpcxoTfBTyyFLdqSMV6a1Z/aRU84zzo8+rd4wU685hnjSsbAKOKuYow9csrQ/lrH98YxZK0LFnAwE1Cp9Eww+jN58Qtvpg== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by BL3PR02MB8020.namprd02.prod.outlook.com (2603:10b6:208:35b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.16; Fri, 21 Jul 2023 14:49:34 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::89a1:d75c:813:618e]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::89a1:d75c:813:618e%7]) with mapi id 15.20.6609.022; Fri, 21 Jul 2023 14:49:34 +0000 From: Het Gala To: "qemu-devel@nongnu.org" CC: Prerna Saxena , "quintela@redhat.com" , "dgilbert@redhat.com" , "pbonzini@redhat.com" , "berrange@redhat.com" , "armbru@redhat.com" , "eblake@redhat.com" , Manish Mishra , Aravind Retnakaran , Het Gala Subject: [PATCH v9 08/10] migration: Implement MigrateChannelList to qmp migration flow. Thread-Topic: [PATCH v9 08/10] migration: Implement MigrateChannelList to qmp migration flow. Thread-Index: Adm74pAz9n8FphtzYkCF0WoaOKzSow== Date: Fri, 21 Jul 2023 14:49:34 +0000 Message-ID: <20230721144914.170991-9-het.gala@nutanix.com> References: <20230721144914.170991-1-het.gala@nutanix.com> In-Reply-To: <20230721144914.170991-1-het.gala@nutanix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PH0P220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::17) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR02MB4343:EE_|BL3PR02MB8020:EE_ x-ms-office365-filtering-correlation-id: 32e7c924-9c6e-40ea-1039-08db89f9b2ad 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: xWNbIBakDgJX5tzhJ6dWhMT7F+ibxA46JZ85GjIfDbV/qcKEhpZYVpgwxBFOOKpLSH6An/JAlFkbV/oP0NxGsm9xwGko3kn/MFUU/HISrcZ3rZG1psa74w/X6pt/zYseA07GaUvIXeLHZSwxUdxZdY1fZCJHIReoBn5U2NDnrhJULRvNPqV4Si+IKiVLS4sfb/LXbyWdKAxfdpRKwKTb8QWTd18nWOXTpcOMFmBv2NBREacdeXGeQsUAwpykgnTThmm5r5/eW9QbN35wuejJKVVRn/GabuIOZhIg3ZKpDFVQmNDvM9YL3kDnX70pfYLkQ9kZtpfjd8y3sVccPKTndZy/AUVE6qEDuiCBFe4XYs30uKdbhloAPDV0td5bBM6NhG9/0PZsarm2lOuzxzBdcjJ5V09Jq8cqaoSDSdWFMJAln4tPgXYCn9QiODcqNMttZK/4GP9psENebrf1fctQAyh84s18gZpYqd8xexKTpelAP5cYNMifk+0DgJQC4LZgy4FwHvimehlyqjCryQe+SCEs3zIMzC89wCKsf9DDOn4GVSG7rEyQPMY2kFy6p877vTTeYXZ5/Vleh7mBfW3xYmqK1jBUMBH3h7y+ceK67clh14wFKIK7YvTpNI09sUvW x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(346002)(39860400002)(366004)(376002)(396003)(136003)(451199021)(6512007)(1076003)(122000001)(38350700002)(38100700002)(83380400001)(186003)(2616005)(6506007)(26005)(107886003)(44832011)(2906002)(8676002)(8936002)(5660300002)(71200400001)(36756003)(6486002)(478600001)(316002)(52116002)(64756008)(66446008)(4326008)(6916009)(41300700001)(54906003)(66476007)(66556008)(86362001)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?X7XRTcA6D3xXjjarXTB8PWqyNMWb?= =?utf-8?q?kcB47Esy1rx88k+nJ6GnSzpcXR1pufzEf8eKXJmze2hkGlXs/VnhwK/TGNXDztelJ?= =?utf-8?q?T/U2W2+pGeFoHIbhkka1fekKMXVuVqSphXKk7E6c3EoBQaLApZvARsMe4OLbgn0wl?= =?utf-8?q?onjTgiMehKaCa0OH8mRngKrNCH6aoFGQ/mtQrADk5wZQ6cyVpDxhHu9Ez2apc3IXl?= =?utf-8?q?E6tIujdVCHlzruCOvESTsFtC2hTLeJabwNj5KkRLT7lrEwtAmiOHmMKn4sFTuY6dE?= =?utf-8?q?MjigQS5FcdD3fdIygjfcmN+CXCLjD3RJ69BILDzrO3ErBFAK2qBZcBYOmkmkPIB7G?= =?utf-8?q?aTwRSUOu319QX5Os4sXtqby4N1u4B8pZicRyLdoK00AbpTBN8AXrZONKDt96a3YKo?= =?utf-8?q?IYUNnEqY1zAqf837QI6L4vMLsm8nWWvjk80Qe4pTIGGHFhbRh8jWcTzGZE8jaS4fT?= =?utf-8?q?K9yo2yDT6VVPDxIs6xpTyHu163fHHK5rId1K8TK8JUGMApUC6duWXwbE/OIGkh98C?= =?utf-8?q?wVX5p3cPkpMmpCLdUtoeMZyI+8at4TM/MZozSca8YQoTVfRMNHWuWKFUZ7nS3711u?= =?utf-8?q?t3fS1x8p0QuO97ZTJYFH+9gGAYki7s3LeWkoEKlt3cLsc/0VTy6P3cirE9fYAOex4?= =?utf-8?q?X8YxsBVx9IWhbwcMKjZ6/jgx230beANEI5YvT6jipi6AsXEeqklBjh8Dgmd1WMkEg?= =?utf-8?q?a3ad8fcG/ontzcTM5p279DvTzYHzECc1ADyNbRkIuV1YEah9AJ+HR7Bl4vANdZGeO?= =?utf-8?q?lP/TXUlIWKizLq9lF3CTNs6DR20PC7CPt4n3D+y4wN+s4M99V9srMgf+M8nHRhk7q?= =?utf-8?q?HkrluxK8rdPcnZOblyOO/3uHVzWetUfLPNLTJwIlrNXmXYWbmZsI77Wv6u/Bk25m4?= =?utf-8?q?PiNeOKefhfV46Ewha/Nv91Tmk1t2zaoURa8zvfVsIeFtzo6s1Ggduf96zNQsGTEgS?= =?utf-8?q?Psi/g/ROopmMyMwiMi/biJRpOSO3XUGrP4tedDhjd+MJB/fALgreP6MT0VchZJOzR?= =?utf-8?q?C+PzV9QC8zQsDF6PNHrPJMjcfIbk/qirlWIldbaCJ3UvJefRinKz1pydvTKEwniRJ?= =?utf-8?q?4fCevoZEaxwgLZSwDC23UJb1mwY/Acu2/4tjE9ZJvg4lQVl5+YkN9VBCSv+NE10Bq?= =?utf-8?q?y0o8rkdTzH3wFjKfcGSAfyDGkI46evIbTIW+HD1SbYEDuL03fCOC4VXkOyC7uAQPW?= =?utf-8?q?LENP2nc9aAPenfA3M1T9pE2JMtACBzIVDwWhiJOHzPuzwNCqeIEe78X+wBUz8Ipj2?= =?utf-8?q?PDVMqjOWM4ZdYDADzHVuWMtI10FTvzE7U3UOoZ1SJS3Sk+TZVaT19okF+e4HB0t8h?= =?utf-8?q?1Czcy7HU6WGbCRjP2rVl5H5htFxRpAKMyBME4laiw1Hg7ui5b68vDCvx0baiQ8Rk3?= =?utf-8?q?JnUmD1+/uS/YnUWfnbSHvMLTt89XB5Zu7nNGOeQ1dLTXi9wJVSyszAU/Yyo5P5ohq?= =?utf-8?q?q0TMbxQtRtdeH/RdG84r1WdRZcYzBZ2FZ4prqNbUAB7dI0qqmnp5wFu09Sy6+gPHC?= =?utf-8?q?TM4x5gcuxKmDhEbe9am9ANq1w77O/Uk1hA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32e7c924-9c6e-40ea-1039-08db89f9b2ad X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:34.0516 (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: ruuCeSIGlv0RcJuBYi4Eh2zS7jr3fLDZRCtA33jN/s9vQCs2Aj9+v55DEuHJj0dUMacx7WfGi1Iiocqq0o03Pg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8020 X-Proofpoint-GUID: aiBP8e32sveKdKINk9aStjntqaNpGE3d X-Proofpoint-ORIG-GUID: aiBP8e32sveKdKINk9aStjntqaNpGE3d X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_09,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.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 --- migration/migration.c | 77 ++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 6e0a8beaf2..acf80b3590 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -426,9 +426,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; @@ -465,7 +466,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; } @@ -473,7 +476,8 @@ 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 @@ -483,20 +487,29 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, "exclusive; exactly one of the two should be present in " "'migrate-incoming' qmp command "); return; + } 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 { + /* caller uses the old URI syntax */ + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + 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) { @@ -505,11 +518,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); } @@ -1709,7 +1722,8 @@ 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 @@ -1719,14 +1733,23 @@ void qmp_migrate(const char *uri, bool has_channels, "exclusive; exactly one of the two should be present in " "'migrate' qmp command "); return; + } 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 { + /* caller uses the old URI syntax */ + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + 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; } @@ -1743,8 +1766,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) { @@ -1753,11 +1776,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 { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE);