From patchwork Fri Jul 21 14:49:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322101 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 F074FEB64DC for ; Fri, 21 Jul 2023 14:50:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrSI-0003R0-6M; Fri, 21 Jul 2023 10:50:06 -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-0003CB-3e 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-0004oO-6X 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 36LDgFEB003513; Fri, 21 Jul 2023 07:49:38 -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=QuamT8b2m+DSk95YHQXf68ZBLIgCfdfVMMoJRmVec vg=; b=pmJfR41fqDFERMihA0+QkLFx+sksO2GfEsYmbGyJqNpd/jGoU+NoD7hrA C8/gM0F2iqdlHgvX/1wwbO94E/KTtq9lVGQBqBzMoKY6UrrhHr75OcQMN1+sBGBp sI7ANnGwo3gCkCKtVaetu1eYVcuhZWE8JBquE6FbFQAtTTXEGzGKDaZom3JZFB0z doAmaDdRZL/zKBtyGcQVV4tZ16gTfRz4DiINRBVuz5IkvYyp4C1HFv6Xl7JYNfAN z+PHHfTOHf1AMuRrGH/luEjJ+luvds2o/9gNXmz0LwiuwZWNIfsQ7baLZDbCexUw FoTHJEva2AWeUkY/yogSCmDX3rfuQ== 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-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lKJzP6IbLoxWD7aCYATAL5pysTqxvo/D2L4pH0CVoCtro9YPSHyH5vWKM2TwdPmhXk+P7HfIyShWqlS7fnnK96m79MATYFqdC0asapNSRhJiqeeifnYcJaCwfQ30NU1XGDyjhGI7ZjzLskyy0XcQWAlm9IV2rGS/ltbGw8C2r4yNBxDi2k1QWck7V8Rw+FgJpxVtw0Pb/iYmLCJsQFiZiXhqTGpNp7eiAkvyQRIIeo8nIurBUbzvFDLI3ZIFlOwa3FYUk2gnnti8lBokn42i3Hg0LrubF2JZAsFyf6b3bISAC7tbILKKtIlrpWAV5lCZSkXW7KEzvlPWhm1iJMXbqg== 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=QuamT8b2m+DSk95YHQXf68ZBLIgCfdfVMMoJRmVecvg=; b=GtVHXWio0ojt2y9GabBydyPZSuy/k8ett0jWdTs+lTQOajL6q7i7FwsgCEhahpbsKZewAxF0VDdM7Q4Bb/LQS3NQB5A2uwUpb+glncvWTOAWb0oHktElZZUFQwL3FfPbwWXcxgH69PDrD1voaFire97PXgIKaZ8gnHTFo5gUJA2fx/0SL9beeiC1QfQeBXWRfddCWHWzKA8OoSxINneemNgIbiklfTO3AM3lvHVErJo0lhjaim5dwmO+z2zTK6hfYM4qHzm8iCTfbMt18qw1O4J3GKiALc9R4NYjyT4WijN8iFuPTAwGZ/gV10HdOv0i3OBXM7W116AlBFvwirXH7w== 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=QuamT8b2m+DSk95YHQXf68ZBLIgCfdfVMMoJRmVecvg=; b=Jdq0g0O/XxT6qfDVUcCygbxllA0Uxvz8v/9HK0H24ZdQujHtDJZCsrZuZjs0qQuXjlvunDqU1e/JQV6nYjLjnlOV2o1b3ACNlF1gupkyystdqQsexn7TZBgNkocjpP72pf7ipF/P1tYwIrt96KNGv+g/I43Ws4qjnqk8leIKLA3wGjh2hrmHw/gXVRzO69LMPHr/eoKubGdPp1FckXfFmh6r9fHAThAen3oKh9SeStrKwqknAKzT8F+gR9kDHBUT+u/y2/AzWScL0501LyACOFpm2uoVyXPoD3l7Umxf9nmpD9/aJ8kSFkstEUq4e1V2h/RVJ9EaBQDS/MVR1qikvg== 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:35 +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:35 +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 09/10] migration: Implement MigrateChannelList to hmp migration flow. Thread-Topic: [PATCH v9 09/10] migration: Implement MigrateChannelList to hmp migration flow. Thread-Index: Adm74pENx+Hg9MV+v0CyZYjqfF2pSw== Date: Fri, 21 Jul 2023 14:49:35 +0000 Message-ID: <20230721144914.170991-10-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: d5524c9c-e3c0-4ae2-6482-08db89f9b388 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: rUjHy91hg6n6gI/P3SpEQ5H66szWayYy5OtS6jQcFCkm/tuxUtyi9bCHTfHZtlFGDmj6Nh60aYm1b2tgBS0BLI0onuxPyAKxxxNvtx8BI9ZvXU3AfYBqXXGQ41fU9NTxIeTLWbt/LSFwgr3pEsWo+tiHzYbSWOaAvJdYjBncV9igitLFcffcf+5ijVjn7Ktx+8Cys4Mcf7rMAuAIZckWYeulhuXiI9iYx8idK2hwmx326hDqAY4v71rG8nFDKdcbn/2pWFTrbKfHkPr1E7L4QXSQD3RpnS0/TdiwtY33ouFf7sHn0Ow0b9Y/CpIOFzcLniZw1gi0kEuzBzoA3DSIFxImh03N/OUmjL71O44eVLDZ+DC1+6ouulrjtiHcawnyLnepqZwcRlkiZYCo7NcvyVEcEPYd7QBFN7w6pKhkbgfKkm9LoxBYYCwGxWD92bQagdmtFe8opErBddQMb3gVVe3ccQXOimMH7sWIiPOzMDLukC/KBzIKFcAnxmywwmvn4Tjxgdv8TtoDeOdurpmy9EuEtKVrq6ajeCNckdTZHVaWc4UoKeX65dDNhSGT5+0C7C6eyqFaHsrgcN9q/xIVjM6HKsKzYc5XqGEHS4SHBws+BohkHSxqdZsT46aCPJReN0uTOt+jX7zOAEijVvaXwg== 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)(66899021)(309714004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?XKWmLsKcSzWQwLflRExZZT8ExpXP?= =?utf-8?q?cpUKOKzGJsvoizWJbe647c3wtIiiF0f7fENyet9eTSeRZcahC5oiPmltub3O3zoX/?= =?utf-8?q?Oe/A81Pqisb0d59RLnfYAhpp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RnIG1ltiXJCehPWUexrSskzdRihKyW5p9pn5gxp1NIf++2hA3wV?= =?utf-8?q?xTFGrjagUsAhfwAgRH6WR/pNa+o6EF3a+dpQGNqA2M05FB4ojFzyn1s3YKeCTzKvu?= =?utf-8?q?t2Eq14YqAGirT4F4lD5gtZjwzhxMqoCjL2o89lcUQ0zFTK+WZ+Om4uS9oCI9P7WVC?= =?utf-8?q?EGDtqHw7Tn3ct0nVZaG67RfD+NL393+ljqLlcwBuL1Tfo+YJf7SlyHuuKNCpKafry?= =?utf-8?q?+CPfZ5pVGdCoOJ5Wyw5C1nm4EUzcH1wlX3wDIzuRjXeSVD7qyToXOWfUeCJXFMA8J?= =?utf-8?q?6MLwmwAWrN6+ZBtzs60vrDIGQsoEk9HsNepLzJ7ABngbFLoikrKaE9V7Jru0gy0NZ?= =?utf-8?q?J9e8vzYtlkvXhunf+/p2lYagYYJN+JbWmvjQmc6DyZZBrrGvlGsybMw6bRqfGC5iU?= =?utf-8?q?9cvS6BKBqYLlzv6KLKbj7t8f8ECTZi8wUkhp8fJSxKgO+oj5Uu8MpTfnOvqUXgRFr?= =?utf-8?q?nioYE4FoFgOMYQ2F2VqEjuwN2o+H7oOpqd3PkguofJcup8kcE/l+C9KfSpvD6GwGo?= =?utf-8?q?L8FwlYlyk3T124guZxv/ziHOk3nvuMU5QA=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: d5524c9c-e3c0-4ae2-6482-08db89f9b388 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:35.4866 (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: tZFVKhmyJoOvofFGPWmbN6W78TiGNd3haj/8gPSqVwb8zegOlA7Lfi9Mfd4vMbI6Rd1PIjYRid+jgFhs+e5HxQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8020 X-Proofpoint-GUID: 0DuSJfWA-2F6nWDoDR23iZCwA5HI2udN X-Proofpoint-ORIG-GUID: 0DuSJfWA-2F6nWDoDR23iZCwA5HI2udN 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+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 hmp migration. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration-hmp-cmds.c | 16 +++++++++++++--- migration/migration.c | 5 ++--- migration/migration.h | 3 ++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 49b150f33f..25f51ec99c 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -423,10 +423,14 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) { Error *err = NULL; const char *uri = qdict_get_str(qdict, "uri"); + MigrationChannelList *caps = NULL; + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); - qmp_migrate_incoming(uri, false, NULL, &err); + migrate_uri_parse(uri, &channel, &err); + QAPI_LIST_PREPEND(caps, channel); - hmp_handle_error(mon, err); + qmp_migrate_incoming(NULL, true, caps, &err); + qapi_free_MigrationChannelList(caps); } void hmp_migrate_recover(Monitor *mon, const QDict *qdict) @@ -704,9 +708,15 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) bool resume = qdict_get_try_bool(qdict, "resume", false); const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; + MigrationChannelList *caps = NULL; + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + + migrate_uri_parse(uri, &channel, &err); + QAPI_LIST_PREPEND(caps, channel); - qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + qmp_migrate(NULL, true, caps, !!blk, blk, !!inc, inc, false, false, true, resume, &err); + qapi_free_MigrationChannelList(caps); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index acf80b3590..cf063a76df 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -425,9 +425,8 @@ void migrate_add_address(SocketAddress *address) QAPI_CLONE(SocketAddress, address)); } -static bool migrate_uri_parse(const char *uri, - MigrationChannel **channel, - Error **errp) +bool migrate_uri_parse(const char *uri, MigrationChannel **channel, + Error **errp) { g_autoptr(MigrationChannel) val = g_new0(MigrationChannel, 1); g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); diff --git a/migration/migration.h b/migration/migration.h index b7c8b67542..a8268394ca 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -501,7 +501,8 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm, Error **errp); void migrate_add_address(SocketAddress *address); - +bool migrate_uri_parse(const char *uri, MigrationChannel **channel, + Error **errp); int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque); #define qemu_ram_foreach_block \