From patchwork Fri Jul 21 14:49:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322098 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 27757C001E0 for ; Fri, 21 Jul 2023 14:50:17 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRj-0002j5-Gv; Fri, 21 Jul 2023 10:49:32 -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 1qMrRg-0002ew-JK for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:28 -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 1qMrRe-0004lW-Tx for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:28 -0400 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36LCwUEq028352; Fri, 21 Jul 2023 07:49:25 -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-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=DZoVG4Hyk9lWJBTZiGUC+AfIlKGUOqYEFcO/lc HEz/M=; b=TdcBgdow6S32GzS2a6P34qju5l6C//JuH4i7d5AdUxIUNFUSpprEEn in6MO3EKQJEpZO+y6mKBQGWLuwPcPuu7Ji7huWn5s9mlRJy3pb7gCK1Z+/srxDsi FFDTH6TmkON/OMwKhjCiWeRuiZxJ5JZLTYPQWGT8w6kNaBKJ96NfyM/Hmv8VoFAm PFDvTZ5zK0rptUWqL0DTPX/ntU7FOrkoZoQKLRM2XIZUBXe2JdVAIuRu32KHc++6 K25nTVbig2iG2tWQuKlntsWCO0TLXoucSHZfScXas/IwV78KjZxBf7DAHCA2flL7 5wCJVGQmeXaZEIhLhXsWr1uFuxZzG8oA== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx3fmxgf2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eEvLT5zhdmGfbykpiqepyGzWopLwhWbdojgjZsJrvzVy2q7aOzN+zxXbKaGku/LvGEx4Dt/bq2/HGBixXh8S0Ed8ZZ/un8si/BQTGuVeGDzEo/gdYaCOIqP4hmmoFdzHikKot/BxHv2Snr1aV5JJfv5DRPdCeuEg3nL9/W7VIMG95RlMIH7aPP69e9Zctnk7kJYzg8ZQ8ltYaMk8roZlKd7AhGXyL9tmM/5MMG7At2wx3TJ2VvesrmWE/1Ouh/dyWOSi1e8PKSzryU4ak9k1d0VD4EclcYV8OO1PevQAzBhfpvfLPBJefEzragJgiBc8yyHZAY97ckzB9lgSeMLvxQ== 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=DZoVG4Hyk9lWJBTZiGUC+AfIlKGUOqYEFcO/lcHEz/M=; b=mTG9fswANoEwIbbtsHGMMJd3XvTqN1PMI8xZpdMPUOz9UGb+CX6y+DFxGtW6xU1EwLNEonRL4IxmUTxK2kuvSMBnEF12j2OEMZX6Dt6OOFVCj7VRpmtrZbl6UcMJT3shwd4XI6fOxakmdiODFYbCrY0VgEdTmn6+iBbp8505ALWbcZyOxxuqbRX6ZFO+DiZpgEpvh8l+46QfkrQBdBJcxpCg81Dp2P1na6+koohRpcgzPlRMv/L3x4ShGwZ2aJdvbL3suHqJmigetdj9MSE4c3ytPDLMBgFaPSgNtaP/3lrv3oLGMOI8uPfhfWnSX/5eKusvv3n00shlXroH7hNTlw== 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=DZoVG4Hyk9lWJBTZiGUC+AfIlKGUOqYEFcO/lcHEz/M=; b=VTFDGyhjeuurZzy677C2UrCVveIKEmR0vgHmHW4Qy947dXHc6pO3K3RwCwNN1MoD4QoSXuS1toCGHoeln6w9iSo0mTa8x013OHsZlab1ayK/c9k88n7iruNKvLw9jcUVJcx8hQAqJ4nF1qq/5O15As8W4i/lkqY73QHKenQqryuqGx4lHn8z2QnpuE8iXHd0YqneOAaN/gZfpjxwEv4n9ZnkjQPmIP1dHsoS0Y6Jrm9S2JbcP73PGvDzMDTXYEg1PLlEqGHK8T1cT6UY8QhrJfIveGYVyutDJNPIhfMSIIKeOTkyhq/E4ZEZV2DXtLcbAqdPRQIsY3RfciTW3DkFwA== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:23 +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:23 +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 01/10] migration: New QAPI type 'MigrateAddress' Thread-Topic: [PATCH v9 01/10] migration: New QAPI type 'MigrateAddress' Thread-Index: Adm74omRkBS4AYfqEEK9gSKYOnRtWA== Date: Fri, 21 Jul 2023 14:49:22 +0000 Message-ID: <20230721144914.170991-2-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: 87a18a9b-dc40-41c3-69b9-08db89f9ac10 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: 9KHd+uSRoy2JBPalzVLtU+5CvGxlZ41irAm7F72rbI1nygoGmpV7isYP+Vhn+gFe9g9CaHcDg46VergPXOMMvTh6j0FNTXMX8WhQB15IJtQTp95e1lmzY5zoJKZMdmaMjuIUKlWWnauvrPy1VVPHjnb8mJpeCLCKRXwRMicgRGIUJOu7D00YdHodMm6xHtt6sST2NstA+XyqdBjs1Y8DbODMaikbI9iiYXLFDR17WAO0wKbKwxUfnDD1LHy2fvfpRoiRz+gQ+fCnQsL6N/eKPKQkkaP1YOAQBkyBKTJEs9xJkP0bxqH5LON+QKHqcRs1gWIEb3n85T2LasVjLoUoPzrzexA/qTDsMXqmfrqk+jubKgi4H9Zfy0082q/+D5hxfCmp/eD15JPVT6PF01g7sJuJ2cKtHQ1wlCl24sZWqbifsNnA29qL8ChvXFijGu/H2zPL8GRjnaJ3rmIspWE9BnMZPQGbIkCpRh9iorhRPhuZV9EKVysMM9tRQ008pKhZNvUoner24ZGrlUIvAt1goBQZ1wJQJCxnxoVf7FtXGgOwGYq0C90+haKg1sA3xSzhhIfYzHJN7kiKsElSIx+ln+C++plY31epRzFFWJqNR60IdH9P/ekFbUmBJbB048pF 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(66899021)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?XHbEW5qS/kmeRkv5vPQpKF82G869?= =?utf-8?q?sBqcS32kvq7nNXoOe6l2hGuCR/sKNAFsGHcmE23UYau9ibotFP4HpWPL4mmR02iIj?= =?utf-8?q?uxpWm8XMHGgDoDA91SJjwNtVVgAieCb6doI8JMyU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HFU6KaLB9xgP3edyl8IkgjzTiFLBLyhluMcoYcuw?= =?utf-8?q?sR3yop8AzPV42VccHjF21Atx9HyYDAVxn9t1z0ZCzz27/h9osRS3uq8/m2rJ4QGXy?= =?utf-8?q?0hE2QFkw8vQhzmVWLJCZgvOjQerwwY8oaYgWWpdIA26gu+PGwe6WKuhkSP+6qdq37?= =?utf-8?q?Qc+WV8nq6HfrjJW7nry7MgYIHyd5puCAYSruGq8QmhhaHbYruOHnzgTNhwAYGuxQz?= =?utf-8?q?VFeNGSOCoPPY6YwLsCfbjfuBVFdDv0HoKob4TTgSofBQgsd53RrveTVOb90xh37zM?= =?utf-8?q?xHnBwBdmwyInnZtEk9neIErxU8lwiW1auj1XRqClgWPmiNgGb9Z8h+IplGTB0sj/I?= =?utf-8?q?HX28ldhS1Vdxq+4zukpWEPqKVXwiDtrbngv8bomYToNl2MvTCuihHKTlgXpyyycjI?= =?utf-8?q?jyOWh5QDWfCw6lOXA4APZAc5itqFLGmCNYGApDhqAZRCqOBAseRAQYm5ZRst1GiAm?= =?utf-8?q?saqhdalzTue/2u5MKyqktksDaGSbJoh4riFBAb+07BZQdBlK1TtdQ5BpAU6eaGmTz?= =?utf-8?q?Z6XinqFiw1FsDJWY3wB21qqItUfOB0lnJw=3D=3D?= Content-ID: <37ADCAD0E7AF7A4E9F9DBC360AE2D896@namprd02.prod.outlook.com> 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: 87a18a9b-dc40-41c3-69b9-08db89f9ac10 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:22.9288 (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: HJ7CHijSKEh+mSZEi1NJp5v857hGzhY3FgB6tyO8lSO9tpNPpILIlyF5Rof3XVXW/ubJvdzMqjb3kr7ictWX+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-ORIG-GUID: y2V6RjeAwAzYqzFAwp_rK65x7RbmQzvY X-Proofpoint-GUID: y2V6RjeAwAzYqzFAwp_rK65x7RbmQzvY 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.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, 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 This patch introduces well defined MigrateAddress struct and its related child objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of type string. The current implementation follows double encoding scheme for fetching migration parameters like 'uri' and this is not an ideal design. Motive for intoducing struct level design is to prevent double encoding of QAPI arguments, as Qemu should be able to directly use the QAPI arguments without any level of encoding. Note: this commit only adds the type, and actual uses comes in later commits. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Juan Quintela Reviewed-by: Daniel P. Berrangé Acked-by: Markus Armbruster --- qapi/migration.json | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/qapi/migration.json b/qapi/migration.json index 47dfef0278..0f4a54a7ed 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1417,6 +1417,47 @@ ## { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} } +## +# @MigrationAddressType: +# +# The migration stream transport mechanisms. +# +# @socket: Migrate via socket. +# +# @exec: Direct the migration stream to another process. +# +# @rdma: Migrate via RDMA. +# +# Since 8.2 +## +{ 'enum': 'MigrationAddressType', + 'data': ['socket', 'exec', 'rdma'] } + +## +# @MigrationExecCommand: +# +# @args: command (list head) and arguments to execute. +# +# Since 8.2 +## +{ 'struct': 'MigrationExecCommand', + 'data': {'args': [ 'str' ] } } + +## +# @MigrationAddress: +# +# Migration endpoint configuration. +# +# Since 8.2 +## +{ 'union': 'MigrationAddress', + 'base': { 'transport' : 'MigrationAddressType'}, + 'discriminator': 'transport', + 'data': { + 'socket': 'SocketAddress', + 'exec': 'MigrationExecCommand', + 'rdma': 'InetSocketAddress' } } + ## # @migrate: # From patchwork Fri Jul 21 14:49:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322096 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 3FBCEEB64DC for ; Fri, 21 Jul 2023 14:50:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRp-0002z4-0K; Fri, 21 Jul 2023 10:49:37 -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 1qMrRj-0002iE-7r for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:31 -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 1qMrRh-0004m4-CL for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:30 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36LBo1b3027837; Fri, 21 Jul 2023 07:49:27 -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-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=JXLHqTV6sn5nvsSbIcczXz3Ezhv3xr8Tj/y1wI PCOZw=; b=CCNoIWq/E/tayAn/wZNjmj71O7/Lv4PuopxkgL3M1Di3f2OSVeJIEi nvWtoqE3L4CEG3hYBn1NVP4usVYoM7epBhNCxscEnWoaOje3w7Fcg0hUWkKwDHi/ B6qJTaqR0ALD2DSGi7EDjQvO0D4LTy4HrMCm1FqY7HhMs/EMx8y7rN1MclKsQDCc WBfRf8b0J9nCDs6WMXT7sCHskSns/KPFiOH2rREY31WDUK3FpFeXmBdeM3MKAkwA Vp12UCd/D32BxIo1fSKKarNmK0ZYHfUSQI2CCPvM2qyX3qqFztAubDHpGe6labL9 UdW5J6bBBtWsWivLr9STd1zFTpy2wS6Q== Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx319phvh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YUfny+LK2g01Et899KMUb81C5NyPEQ/P+TigDZySuY399NmkUhL+qCWTb7dePfTX6Sd7l/a3MD0bfRlhRs0priebPB6reUKvpqZDo6GWmovJ+ZQrfy0hdVuQf13Kx/Z+ogAtUtfXBNQPBvS8vk+Tz1ArGU/ZqAnOhDyZEHVu0ubQtGiEKLEBkwEHIOhE+IWzGehDo395OFDchLbHTO/fZGY0DpGwFpafSQX8cmE5BnijgDJ4sDj53C076Q5e9fsz6PCnIGku6/O4wtZnGLTWEfSV2h8flA1psJ7bU3vSHZCRYd7VKjXfbj1Qk5ILKVE1Xszr8t2Mo4WYocGXfU24Yw== 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=JXLHqTV6sn5nvsSbIcczXz3Ezhv3xr8Tj/y1wIPCOZw=; b=l4EOOtUXuaahvNo5E0WL3/AI1B73AGkO6YSZKef9dpo0yJmftLaTGDgVI4XynnMJe4UvCXU0TF0D/7A/Njthr0J0C1vd8srOHvV3NdJnVyJD0Zpx2Vz45q5sFEpGiJ2DItF3L8eLla63hkCR0aOO49t1v+Spuw+LS7X5SoPW21f+D5DAQJX7a0dr/1BNkjTiqAGASfopv0RxkxQNtc1r0EBHaP3Q3qJsLDq+NSqGlQZMHUsDYM4HnKQB6HED8jkYUfFQLhtSmxNlQSmSjFCwATkLYXe4MDh574dH1Gt6WSyXZ1b0Mt7GN6kSJHT6HPHNyH+nyc5qDrOJp/zVVE6tJQ== 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=JXLHqTV6sn5nvsSbIcczXz3Ezhv3xr8Tj/y1wIPCOZw=; b=gctETqcXMmcnYqIuZAlL7TNpDqaNqimUfHVFG7YtboHsVOkQ4S/mVDILyfNENKFdrRFzjcdMUOSA9fPNMvY4h5E2Okwp5oGU+S3TDDBrqYz8r7cyGf+7xfIl9aT6kR5O6i/7mTcMuhTETjH3uR1gDXIHTlpEJIO9kraRjQGBx8ru9uBcFwYjRbivaTOselOXFHmu49iG8OFeRVQZSQVxuTr9ar2BJcu1ZEEaluvd2Ok9Jz/qMVWdyH2A7uE9NuF0B1CTlRyG4fbniRp9c43lz3tBCbGV9b4yudOA39v7LfzH2i5Wl4Gg3xkwfe1G+ESbS+dCEqoMPyON2ER3ehG4hQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:24 +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:24 +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 02/10] migration: convert migration 'uri' into 'MigrateAddress' Thread-Topic: [PATCH v9 02/10] migration: convert migration 'uri' into 'MigrateAddress' Thread-Index: Adm74oqBvS7bXSvbLEanSGWgWQmLog== Date: Fri, 21 Jul 2023 14:49:24 +0000 Message-ID: <20230721144914.170991-3-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: 089fa485-ef9a-4619-d092-08db89f9acfe 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: HuOuUbNXTSIBY6LL3nLXby55oqqFuQDg90vvD6B4jHRY15jB2ta682tPd0rWViHB1AqJnXAcZRRJ9L9a6ImmPu9LVo6V9xBouB3BL7po8inOfncqameUx5axlOIVm7g7zDO9Em1SymgP8C66km8FLwrBHY7viPtjAOF1pa17rz3E0KA/lyvizoXfjoIb6I+apKD1eIjCuVXfbN6xaFFJDAaSUxYncZETTzXiRMyopVUzTEUAquKA+MvY2SqVK4QEVfDIlEyMHWcaxqAXh/N5c/O1r6OdJP1eSS5HK774/S743LNPu1rEF37s2yAQtrvoPkteJGhqk2ve/a3Jq3dJ6KG5ZC2ng1hy53wHcxs7EQ1VHlmuLVNtBwcuTSTC13o+aP0+OakYbbaTndZOln7y4Q+z4SQgYrK6ReTn/uvMPPAS9fk98M7brNykLZi+uUvWwq+gly56Z4Vl1Ats90hBWy2SSa84gMVGywM6j5olHOLD+shPMXk9WKR19tMIhZLirNMPJtc6KdGW1TyWSw6uLAaSj7TOqo/gP49jziuN+0YOzjAnUoVcn+3//anpZ+bMHzlmY21fDdh60IZTeR03ImF6BUlV8NeNhdCS9gmJBDUJ6kOSPm9VsqhY9fKCjd45 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?sIq0BuAFt0evsbCQFDRzulk26AA5?= =?utf-8?q?L/pF6n/Zfzen1aTcyne58STiBtdibISbJKZVsImNTgKbcAxL+uPaw6aww5uTPtxty?= =?utf-8?q?AHuKbB72rYOQaiLWXMO+7riRuohrguKdIvepT3hHLCzIFlRYYic6oT9Vxs292TFt8?= =?utf-8?q?eWi3LvLPWYL8Lfn1jJuGniQoeZtSCIeFUQ5O8XD1SquNCUWUXmUexTR7DhsbBaJPc?= =?utf-8?q?/baiN92nxpJu+YNrAsk7TlOa68H6LY8m+x1js8mWWkCoTDgXhgyT74Tr2oS4rpjDy?= =?utf-8?q?VqZQmtQeJmJ8CR+kMINJ6syehiobL20d+rHoJ1ghJHRAkxtg5Aj0HGjJxGUVFuxh9?= =?utf-8?q?Zwmbhqs/imX42zN5QhKNSD5j7sz/a7a2+62NvMUAQkUjIrb5SYZtMYdoaP59vxDIw?= =?utf-8?q?eT54wVtynQOOeAXmiYmzNABAdf2W05vk8MOr+i1+/8dTB/fWMUcBsWbCdvSh1JfcH?= =?utf-8?q?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Okz5Dimin6VUsxXzYPW65a+gI2GD33nTTVUf?= =?utf-8?q?DSjxL6Vrv05qloXvgm4oectiyGHW+jkgzxTSydGoo7IGMfmsgw7FgqwlZ7L5Z68SH?= =?utf-8?q?wYl4zm8gzIiRisa7/8F1XBCyEUaoc+eMCuCbG3b6Sg1mdSj8GCMKdnecY5bW5SxaZ?= =?utf-8?q?d5B+oWStkZlIqvZwKaNj727u4+ImDLdErg=3D=3D?= Content-ID: <441266E840DD9B44A32CEBB18D0024F3@namprd02.prod.outlook.com> 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: 089fa485-ef9a-4619-d092-08db89f9acfe X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:24.4960 (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: SG2RG5dsK+E5fDVrQe0cH2QtTRZzJMuLAUAnmoEvIfmRDw6MdCxSY0ONyWzSoz9+zG+PsFzOFv2mozf2uXELNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-GUID: 9-TZ7449ankJKBwEMo065A5_d3rNqGi3 X-Proofpoint-ORIG-GUID: 9-TZ7449ankJKBwEMo065A5_d3rNqGi3 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.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, 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 This patch parses 'migrate' and 'migrate-incoming' QAPI's 'uri' string containing migration connection related information and stores them inside well defined 'MigrateAddress' struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/exec.c | 1 - migration/exec.h | 4 ++++ migration/migration.c | 55 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/migration/exec.c b/migration/exec.c index 2bf882bbe1..32f5143dfd 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -27,7 +27,6 @@ #include "qemu/cutils.h" #ifdef WIN32 -const char *exec_get_cmd_path(void); const char *exec_get_cmd_path(void) { g_autofree char *detected_path = g_new(char, MAX_PATH); diff --git a/migration/exec.h b/migration/exec.h index b210ffde7a..736cd71028 100644 --- a/migration/exec.h +++ b/migration/exec.h @@ -19,6 +19,10 @@ #ifndef QEMU_MIGRATION_EXEC_H #define QEMU_MIGRATION_EXEC_H + +#ifdef WIN32 +const char *exec_get_cmd_path(void); +#endif void exec_start_incoming_migration(const char *host_port, Error **errp); void exec_start_outgoing_migration(MigrationState *s, const char *host_port, diff --git a/migration/migration.c b/migration/migration.c index 91bba630a8..5b3be767f0 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -64,6 +64,7 @@ #include "yank_functions.h" #include "sysemu/qtest.h" #include "options.h" +#include "qemu/sockets.h" static NotifierList migration_state_notifiers = NOTIFIER_LIST_INITIALIZER(migration_state_notifiers); @@ -421,15 +422,64 @@ void migrate_add_address(SocketAddress *address) QAPI_CLONE(SocketAddress, address)); } +static bool migrate_uri_parse(const char *uri, + MigrationAddress **channel, + Error **errp) +{ + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); + SocketAddress *saddr = &addr->u.socket; + InetSocketAddress *isock = &addr->u.rdma; + strList **tail = &addr->u.exec.args; + + if (strstart(uri, "exec:", NULL)) { + addr->transport = MIGRATION_ADDRESS_TYPE_EXEC; +#ifdef WIN32 + QAPI_LIST_APPEND(tail, g_strdup(exec_get_cmd_path())); + QAPI_LIST_APPEND(tail, g_strdup("/c")); +#else + QAPI_LIST_APPEND(tail, g_strdup("/bin/sh")); + QAPI_LIST_APPEND(tail, g_strdup("-c")); +#endif + QAPI_LIST_APPEND(tail, g_strdup(uri + strlen("exec:"))); + } else if (strstart(uri, "rdma:", NULL)) { + if (inet_parse(isock, uri + strlen("rdma:"), errp)) { + qapi_free_InetSocketAddress(isock); + return false; + } + addr->transport = MIGRATION_ADDRESS_TYPE_RDMA; + } else if (strstart(uri, "tcp:", NULL) || + strstart(uri, "unix:", NULL) || + strstart(uri, "vsock:", NULL) || + strstart(uri, "fd:", NULL)) { + addr->transport = MIGRATION_ADDRESS_TYPE_SOCKET; + saddr = socket_parse(uri, errp); + if (!saddr) { + qapi_free_SocketAddress(saddr); + return false; + } + } else { + error_setg(errp, "unknown migration protocol: %s", uri); + return false; + } + + *channel = addr; + return true; +} + static void qemu_start_incoming_migration(const char *uri, Error **errp) { const char *p = NULL; + g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; } + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + return; + } + qapi_event_send_migration(MIGRATION_STATUS_SETUP); if (strstart(uri, "tcp:", &p) || strstart(uri, "unix:", NULL) || @@ -1641,12 +1691,17 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, Error *local_err = NULL; MigrationState *s = migrate_get_current(); const char *p = NULL; + g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; } + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + resume_requested = has_resume && resume; if (!migrate_prepare(s, has_blk && blk, has_inc && inc, resume_requested, errp)) { From patchwork Fri Jul 21 14:49:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322100 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 9B566EB64DC for ; Fri, 21 Jul 2023 14:50:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRo-0002uH-7D; Fri, 21 Jul 2023 10:49:36 -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 1qMrRi-0002iB-UZ for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:31 -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 1qMrRh-0004lx-0N for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:30 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36LBo1b4027837; Fri, 21 Jul 2023 07:49:27 -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-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=Lu7RYOYUT7ZvuwWWjZLt5SHjd1hMIBqQ7OkfsG 17fWw=; b=UtK+Nej4bvtZTPdUx9b3qIMHFJZYN91ybk2jbtUvWQ11Rn1SqE1Atm d94u1I+1UzPPkI8+5w6sQGM7QrTNhaC5a44jRHYPHCC/tv/+go0V23/ebhI/dox6 YGhB+AGmoJpeCArwNd7v1i36c2OSLKUACkEYokFN5vzUT83gWiHvJ/Tn3EFodxFj 2Bytu33+zKww9bBxTM2hJRB18qg23qvg831Vkln0/uky488QCGCT8WQK+zuU/8pG 6uoIJ7XqcBpkAUbBoPesk5bUZ+QdK7fTj3NQAfnUdp8IHU9WCEBEO+VMeQiHNwa7 AUB5X3SRtKNSf0Q+2QCpIqkMD74YTDmA== Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2044.outbound.protection.outlook.com [104.47.51.44]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx319phvh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j8yXIdo3kE6yWzHrvIuat6cgY/aZsTt1fjLwgLMhupnNE8qeGZagJGx8uUcm0hVsqnjW6gqHQeWwJaWK89+R1EUGme8hkMQYF0tkh0IOLdKGYCApSlfRhJOEVrrrst7vbjedHcItTg5OQgBTNoCuK7A6aloutX8x+/15lJodFGCMD9ZrrGbdMk91gqs4/DDp01M1M2tuhr4exh4SmR59XU0vHovDAJFTYrowhU/vdP525lmeL9iZ0W52gL4rRQ+GUC63pgWlY5Qr5/Oqgyu+TWUr41UOH1wNERgsHKukX7kIrTtUbzgPuPfseuUmJx7afsNWpKZZE0Nazbkk3/SXmg== 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=Lu7RYOYUT7ZvuwWWjZLt5SHjd1hMIBqQ7OkfsG17fWw=; b=Z+1lenhbMQhHHOA4eQILGTFL0h4V0l3a/IfQKY7n65cTP4NxE8iqFXPVP2hP8Nq6D3WtHZVg6hLOTaepA8QC5rhXbMndn78imz8vR8YvyUPyJXzynJEGygBirDKsVo0saw+2jjGKiNhvnodFiT06mMqad1oYbFottbQlRJk9gDWsFR0d3ZV/VkRlvnicAOvkiXk2GE6yAGlB6+P1TLJSFxl8rD8mSeMa10tdypOcu9zXLusvIl6osETD2Rol/znlTUnoJWHLUDm3B4PDjIdsvxZ3wyKElqciTYfHOTJRH3vDDaACE8nTt1ccvLW7oPDnqTHKiswpOz8wQDx5BCsesA== 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=Lu7RYOYUT7ZvuwWWjZLt5SHjd1hMIBqQ7OkfsG17fWw=; b=ROhFHWDa7ygA6zsEiRR2kowdyEMAtokKkXh73/Ve8DTRgsbY2qqUN88M/cFhWVA8s0p8YRg+Dlko+WpC+Id71IezdqV5XxqsJghGzRGAhctOZvuFJhdleQOew+03wzi/jugbc5ew59y4ocnBvGwXmNb0WeU0mTj1dI1UWQVpV4PmqB/H8AcTDcrjudnsZZk7PTeRKwm0n3keENJbnWxj1ubC54OzbN75392V63+1LJk8gdzGN1oA9yFCGnnm82Qqt32OM6XYG2fIVbG3+WVeehX0jdtqvR6GiJbxx5zFk3umh64z9O6PH3bP61nBXgziR8F44+2JZbcg8OOUyEVxuQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:26 +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:26 +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 03/10] migration: convert socket backend to accept MigrateAddress Thread-Topic: [PATCH v9 03/10] migration: convert socket backend to accept MigrateAddress Thread-Index: Adm74otwXZ11rOI+JUiscwI+vxTRZw== Date: Fri, 21 Jul 2023 14:49:26 +0000 Message-ID: <20230721144914.170991-4-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: fc5cd793-bacc-4e0b-c07c-08db89f9adf6 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: r6eo9cKCwV55kckO2q9SR9VegOlrq3PNgSq08cghPjUFg9AQ3cNDWXoCfaEK2mkQaa5RG2NUCiWmILZ8nglk9O+kKJOfvAd2dlFxYjxm+hjkqFk9oS4iLipdYDwk4WmzMR2HjcleJbbQI8XlU33mAGdmaqAsn1gEGV4qb7Y/8hvJ+2YBEsztzJpR/x5Iz1nKQP2Sj8CCQ+HAT3xqI8UmtKNGi15dTZ4I+gUKGhnX7U8ypEEAwElizj+6qiTnCI3a8wNuv6hQATnXo8jxAwGhxYaEzIVBOFYmmq/hmWdKg4OX7AhFuStbISFPfLCBw0KLJ1FYNorjQWRWbK8ZNGWtRGxeFU2oSGR4W2rtUX38RVmmTqOwKMQQoIj7e4YOj9g69noEfIxqRq6ViYycqIBDMwuUFgHU2waNHwRm8nTN728FE5SymOEYey1acHkz3gy1nj/V3yYdjUe/UZbCvRC04TcMTfwgoM3vL/OgbKxE/vjJC9EVOODYFeYfn3gB17ceQCCU+8a4hdHRbixoVZ/GIZdl4eJQ/OXYSjb70PrMFmli5JTIwk8XE6bCDsZ0Sveq9ghICdHA3dHECHVJi0XH1240xTguX+kNRDeeTHXgH/NAud8o2YEYKuzLqDX7wSUY 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?PaGE1o02kgWTohXV0h3tpDS6Jop/?= =?utf-8?q?3fFWZx5LaNMHnYAlLj/t0US35w+kgTKCUrnEje+aHOg2wKyuis5tqhz+4qztvKfqc?= =?utf-8?q?Nu2KUEDBs4kCG3a0meMiYMWHsvgNa/B7+i/OMRCVaeBEEiYasmc9tjkY7zaMBWSSm?= =?utf-8?q?jOnCjnByGS5F7p/FHrR6XOEAzkEu3KLRHuIvZxg7/MmRU7mOC9HKu9iWcNc34920B?= =?utf-8?q?QUrDyYXLg73rvp70lt6bOnD7roFeUuZ7k3h4z9msXLO4uX8HDzdcLdRXuHY0nTdGF?= =?utf-8?q?xmdWJjnJj3zQ4Hx9fN7dwYo3w90ix7lc6kChMT3FZfcNWbIoJuIjRq+RROnhjxhfB?= =?utf-8?q?m36tk2UMKWaDhgdR1oG0/rhpNZ1KV+IBZ+kHowJT2Flmj+oBJgXiQ8oGSwwqvQGWl?= =?utf-8?q?UD/hlUXPFxPL4fK1/0fxXZR4TIKqf8/vrschTOPWeA3vHlTLpzMDiOM7H5HWwzjzM?= =?utf-8?q?bvvIYUd90Ur1j55DyhxQI0IBmSOCsT2L4f7BF5hMDoL0dRf0W7QmLpH9TSInWgAJg?= =?utf-8?q?SUAdoYCtkOhLs2KxYJMyJcoW/KXaBPYqwRmAkuEXko8GxhTRIhjtUc69KkcsDOJEt?= =?utf-8?q?e54U4SlBOjKw+ahGYKBeIE0f5WlSccMz8hlNWt09jLxrr6HEtlbqGxlgdPgi6oRWJ?= =?utf-8?q?O4bqOKDe2Nrr5EvYdKV/0S/spcxBZZ/PsjSsEFzNKEj6udWOkyEbfI6r4JnqP1bKK?= =?utf-8?q?BgG6MLrgh18eEb0D8rK7Y/qCUcWp2H//veiQw9gLCaQKse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anix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc5cd793-bacc-4e0b-c07c-08db89f9adf6 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:26.0922 (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: Y3iggOamZPegcXVBi1mIdJKFrXi8Zjg+drEAlvZkC+EV6Yj3Brd3rZ1Ocu85NOAOOv1aXasgIpWBHwmBh7yM3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-GUID: 8deqt2Oi2SriADX8o2GrnWFpkZqAtU6O X-Proofpoint-ORIG-GUID: 8deqt2Oi2SriADX8o2GrnWFpkZqAtU6O 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.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, 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 Socket transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for socket connection into well defined SocketAddress struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 30 ++++++++++++++++++------------ migration/socket.c | 39 +++++++++------------------------------ migration/socket.h | 7 ++++--- 3 files changed, 31 insertions(+), 45 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5b3be767f0..c4bcf8bbd7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -481,18 +481,21 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) } qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_incoming_migration(p ? p : uri, errp); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_incoming_migration(saddr, errp); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_incoming_migration(saddr->u.fd.str, errp); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_incoming_migration(p, errp); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_incoming_migration(p, errp); - } else if (strstart(uri, "fd:", &p)) { - fd_start_incoming_migration(p, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1715,18 +1718,21 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } } - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_outgoing_migration(s, p ? p : uri, &local_err); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_outgoing_migration(s, saddr, &local_err); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_outgoing_migration(s, p, &local_err); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); - } else if (strstart(uri, "fd:", &p)) { - fd_start_outgoing_migration(s, p, &local_err); } else { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); diff --git a/migration/socket.c b/migration/socket.c index 1b6f5baefb..98e3ea1514 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -28,6 +28,8 @@ #include "trace.h" #include "postcopy-ram.h" #include "options.h" +#include "qapi/clone-visitor.h" +#include "qapi/qapi-visit-sockets.h" struct SocketOutgoingArgs { SocketAddress *saddr; @@ -108,19 +110,19 @@ out: object_unref(OBJECT(sioc)); } -static void -socket_start_outgoing_migration_internal(MigrationState *s, - SocketAddress *saddr, - Error **errp) +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, + Error **errp) { QIOChannelSocket *sioc = qio_channel_socket_new(); struct SocketConnectData *data = g_new0(struct SocketConnectData, 1); + SocketAddress *addr = QAPI_CLONE(SocketAddress, saddr); data->s = s; /* in case previous migration leaked it */ qapi_free_SocketAddress(outgoing_args.saddr); - outgoing_args.saddr = saddr; + outgoing_args.saddr = addr; if (saddr->type == SOCKET_ADDRESS_TYPE_INET) { data->hostname = g_strdup(saddr->u.inet.host); @@ -135,18 +137,6 @@ socket_start_outgoing_migration_internal(MigrationState *s, NULL); } -void socket_start_outgoing_migration(MigrationState *s, - const char *str, - Error **errp) -{ - Error *err = NULL; - SocketAddress *saddr = socket_parse(str, &err); - if (!err) { - socket_start_outgoing_migration_internal(s, saddr, &err); - } - error_propagate(errp, err); -} - static void socket_accept_incoming_migration(QIONetListener *listener, QIOChannelSocket *cioc, gpointer opaque) @@ -172,9 +162,8 @@ socket_incoming_migration_end(void *opaque) object_unref(OBJECT(listener)); } -static void -socket_start_incoming_migration_internal(SocketAddress *saddr, - Error **errp) +void socket_start_incoming_migration(SocketAddress *saddr, + Error **errp) { QIONetListener *listener = qio_net_listener_new(); MigrationIncomingState *mis = migration_incoming_get_current(); @@ -213,13 +202,3 @@ socket_start_incoming_migration_internal(SocketAddress *saddr, } } -void socket_start_incoming_migration(const char *str, Error **errp) -{ - Error *err = NULL; - SocketAddress *saddr = socket_parse(str, &err); - if (!err) { - socket_start_incoming_migration_internal(saddr, &err); - } - qapi_free_SocketAddress(saddr); - error_propagate(errp, err); -} diff --git a/migration/socket.h b/migration/socket.h index dc54df4e6c..5e4c33b8ea 100644 --- a/migration/socket.h +++ b/migration/socket.h @@ -19,13 +19,14 @@ #include "io/channel.h" #include "io/task.h" +#include "qemu/sockets.h" void socket_send_channel_create(QIOTaskFunc f, void *data); QIOChannel *socket_send_channel_create_sync(Error **errp); int socket_send_channel_destroy(QIOChannel *send); -void socket_start_incoming_migration(const char *str, Error **errp); +void socket_start_incoming_migration(SocketAddress *saddr, Error **errp); -void socket_start_outgoing_migration(MigrationState *s, const char *str, - Error **errp); +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, Error **errp); #endif From patchwork Fri Jul 21 14:49:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322099 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 D7539C0015E for ; Fri, 21 Jul 2023 14:50:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRq-00033N-6v; Fri, 21 Jul 2023 10:49:40 -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 1qMrRl-0002nR-7l for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:35 -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 1qMrRj-0004mT-Bf for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:33 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36LCwD6q029460; Fri, 21 Jul 2023 07:49:30 -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-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=LdFPeWHVioB1e7qZ7C2aafcMAQvP9Z+ahpshtJ 0ONDQ=; b=Pr8poepAKrOprH5Xib/yK6e/i1OatkL9z7Y3wcW6PA5enR8EwFcyNQ ycgO30LbK8r/uOGQapPQQy9slGx/nftVp7ZL2vci1Df5eMqOMgLhfzF4fC6wmT54 8Rh6P4GbTH+lmd+h+4oCZ8zJZiWr0s6n0zkmqISVOQ+g0uAjoTeh59FHmWjDeYud YLnn0icAEQK+WvbwLF5XdEUIC7rKfbU7RlIENSXM9y4BZsey4K1kzvYHyqMhgrOa 9r4HPfZhhdsZykael9WouVLWARjyAbudKziz4ETUOIk2DI5/4e+qR30pRS9fcPR+ RWex6lkoQTqANDAP7vnEJ2KioDARFwEw== Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx319phvm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NZIfhVDxMKPcauGgWMkXZf2yx7JKgkNl/mzCuQ2o+EQlsJagIqRY00puLTLz850EABgHJn8VPmb7WgIjOvwKSDqK8AgTTpF/bno/hcG+ckRySpByjhmt8uNYD5h3OvVbE05SZDf2IHkpFXnu9yVDpspmaLGX+0qDhOSInCjeWuClXfEN1LPPmpsXgKSM2pjVuk1UqV5QNuo1n4byRNFmHoUBBOk5FtC70HevVNU1r4LiEhi1mpnuaROk8Dky0mn1Ducpm4uY0dcIpIQR3+byvdarVH3fy/hDfrrMIIJ12gXpUsZZyc8ZN1I44e86nx0SYDXKAoQO6W1SApQQGgSrLA== 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=LdFPeWHVioB1e7qZ7C2aafcMAQvP9Z+ahpshtJ0ONDQ=; b=NljYJvv78XS2bZMniKxjZ+ccp25Jf9VuN3i8GV07mTQA5NqZP4nzEjpAKYVqkm+mjFIF9JPCL/N+B5DXNHke10yhWZzoKzfWUICTxTWNKtp9IA4+Bwh50a6CLf81fZR3Ibj2jBA+q6xsx3VHLuXwZLgsfNU7t/2aICqqrX7yiFK8zSwDBGeY2pdAEQDyhY6dS8W4WQXefaj5P/Sh3Ov3Ha3BidAm+s809wjwqSagcAdQl846oeDAk9qxnMQW1cjzDoSLH1yCkiiLkOv6KvgeG6/GyT3c7K6wasW5loSvmbtEmnYtYJkNReGfEprAKM1OfJCdMIm8vMU7J73n/zf06g== 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=LdFPeWHVioB1e7qZ7C2aafcMAQvP9Z+ahpshtJ0ONDQ=; b=Q2gKN3dcSX+esTKPfguoxI6K7Hz6Wvdr1RYdpzaYoycYXL/tCAwGV/zPB/sGH1Uzox/p9xOzPcVYg4CIxDszjfCGtoWhkhKlMrYtgncdJXNeR7ZFB9KnB4zQbK4DJYS9pXtSLF+UYJeMPGCBjGizx4/nmLRPAjYJJuioJjhOj7dNrRvuxluSTkw7bVNq1ycowaCqhhtRL6hA089JPIDASDawCcINxQq0WMnlpmT85/S8Ybqwz7yig6p9jPIdSRQePsHUbB1PBsuX0svAAHuZKLPYF9nDa9cUKXwjeJoyc4aGJvokFBTjnRj1g/kGWHyAg9EU1GYrdP81fVseSZ7qEA== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:27 +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:27 +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 04/10] migration: convert rdma backend to accept MigrateAddress Thread-Topic: [PATCH v9 04/10] migration: convert rdma backend to accept MigrateAddress Thread-Index: Adm74oxc2BvHNvUF/UiT5VPJngsiqw== Date: Fri, 21 Jul 2023 14:49:27 +0000 Message-ID: <20230721144914.170991-5-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: 7feff78c-f31a-4c6d-9e09-08db89f9aedb 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: 4vpSAAJ9D7EXPH2tfWJdIvcsPuXMueTw041EpipEDAwlxcEC0uhDk2D0raajP45i2OEqQ+wnjI3dpPBWXSB6iBRvNlTHsUBwDsPlVAPgd0PFPQzee/qd0jFJGm5aKaILWbGUXnLj4Wew6lDFi9r0ViAIZ6uY5dNyMzO8iUW47VzzHW1MqWps04tmNGqCn1JkLKSULoEqQispWcfJwFWvVLe9lsLXuBejtUhEGdNXr7shWIMVTeckfnenuj+DuRQABwGIeGfYoCUQzjvURd4A8CpM9/lxLTaHUWp/a5Sx2K/TnXaxFRuDyGIkikY/7Y7d0Y8fmgEyJErW6Majy484/jRW+XA8MD9AyRNWPwhOpHL3Tpg/CkaIHwppW1cj515hg9+vre9yuJOZk4hwJNtjYUJu7bGywm8H7iN4MI1HVUuCCYeeD1mpX3YarE5Ti0OlVlXobDXw9xkrOvjcd8q2mRYUQ+j6MR2K4TWyAmOy8QmJyPbsSJFZW1GcmO0wJ1e/DZnNqxj1DIm+3XSdIVQV4aOPi9G6eBrSurT5g7GDS1dp+Nt+KrL9EB/5ldgMuVGu6XwVxNqHw3268xQaiIgakMdC1hc7G8PvlXoVN/fiSQSS0bhfjtCDPtgMOC6gpdUe 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?GKctlElpkrBtlHRszBkTzmm8vEYT?= =?utf-8?q?VYH6l8L6WBB/LLU19RusPevgSw/gGFTWEKz7Llu0fZc/E7/zfCGvlzAz+LqKejqpJ?= =?utf-8?q?a1K5XTnOC6Kt+/2NlO1aEA839MMRfLRg8Qbee0/rscRUlNQJWzXtAMJhRPm3Bwgt4?= =?utf-8?q?Du33vrgTT+W14g5sztilpFBjU2fWPj8+ojIhMgUKPHKEaiFWO7yd3zO8vi5H7E9uC?= =?utf-8?q?s9b/eZUHZpuI7Mr7QVRAWYCa8MgnFjiarkSiGyAGz3ydNkI5+61+wPUCYZzTzcf5X?= =?utf-8?q?Rk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L9/MnNKj2ygutaEvJ8bhqFT+huMrAUi1XjDcnT6l87q/nGk85ngnH?= =?utf-8?q?49RZBNnPVa8C/1V6k1zJIlWOQC+uBD3kkEAUvxJvkROyIVo1oFt8QznnEk6LNpp4Y?= =?utf-8?q?vMn3wFN5tVIVmyR/YON8vODauoLmA2UUOKyImLnZS69EorcUFOBH0AyYYhvIk8vJe?= =?utf-8?q?oPwjSm6Wb6hcAhtk+g2W1Oq42ZejErJHgMYB4mIfbC7m6JQ+ne8byt0TGUNqflMgk?= =?utf-8?q?7/vWnpScYCuxTFxiI3getO0Ya1aijbtEVh1Jqaa+K5Ih6JC3LelX8DE+e4qE71D7D?= =?utf-8?q?hklFjkKY5fbtWsit9aY+KHLJSZh6ZQlqG02ufCFn+KJGaCdpKBHmjtj9zgL68Wacg?= =?utf-8?q?lFV0acRb7yhxOkvY/wCpS8c3WFCcm+90dw=3D=3D?= Content-ID: 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: 7feff78c-f31a-4c6d-9e09-08db89f9aedb X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:27.6200 (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: HcnByRoAt+IAL1iN5tO6XE4qyqQbDTy1B93LhZYybfb86QfcdSBHWfzngP2bAf6ms7QWSRACBpMZbHXJe5NYAA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-GUID: UOm6NfzKrNWaoUWfXsZmCb_8dNNKp9l6 X-Proofpoint-ORIG-GUID: UOm6NfzKrNWaoUWfXsZmCb_8dNNKp9l6 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.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, 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 RDMA based transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for RDMA connection into well defined InetSocketAddress struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 8 ++++---- migration/rdma.c | 34 ++++++++++++---------------------- migration/rdma.h | 6 ++++-- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index c4bcf8bbd7..8012f93f1b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -491,8 +491,8 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) fd_start_incoming_migration(saddr->u.fd.str, errp); } #ifdef CONFIG_RDMA - } else if (strstart(uri, "rdma:", &p)) { - rdma_start_incoming_migration(p, errp); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_incoming_migration(&channel->u.rdma, errp); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_incoming_migration(p, errp); @@ -1728,8 +1728,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); } #ifdef CONFIG_RDMA - } else if (strstart(uri, "rdma:", &p)) { - rdma_start_outgoing_migration(s, p, &local_err); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); diff --git a/migration/rdma.c b/migration/rdma.c index dd1c039e6c..4d64fae492 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -319,7 +319,6 @@ typedef struct RDMALocalBlocks { typedef struct RDMAContext { char *host; int port; - char *host_port; RDMAWorkRequestData wr_data[RDMA_WRID_MAX]; @@ -2455,9 +2454,7 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) rdma->channel = NULL; } g_free(rdma->host); - g_free(rdma->host_port); rdma->host = NULL; - rdma->host_port = NULL; } @@ -2739,28 +2736,17 @@ static void qemu_rdma_return_path_dest_init(RDMAContext *rdma_return_path, rdma_return_path->is_return_path = true; } -static void *qemu_rdma_data_init(const char *host_port, Error **errp) +static void *qemu_rdma_data_init(InetSocketAddress *saddr, Error **errp) { RDMAContext *rdma = NULL; - InetSocketAddress *addr; - if (host_port) { + if (saddr) { rdma = g_new0(RDMAContext, 1); rdma->current_index = -1; rdma->current_chunk = -1; - addr = g_new(InetSocketAddress, 1); - if (!inet_parse(addr, host_port, NULL)) { - rdma->port = atoi(addr->port); - rdma->host = g_strdup(addr->host); - rdma->host_port = g_strdup(host_port); - } else { - ERROR(errp, "bad RDMA migration address '%s'", host_port); - g_free(rdma); - rdma = NULL; - } - - qapi_free_InetSocketAddress(addr); + rdma->host = g_strdup(saddr->host); + rdma->port = atoi(saddr->port); } return rdma; @@ -3359,6 +3345,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) .private_data_len = sizeof(cap), }; RDMAContext *rdma_return_path = NULL; + g_autoptr(InetSocketAddress) isock = g_new0(InetSocketAddress, 1); struct rdma_cm_event *cm_event; struct ibv_context *verbs; int ret = -EINVAL; @@ -3374,13 +3361,16 @@ static int qemu_rdma_accept(RDMAContext *rdma) goto err_rdma_dest_wait; } + isock->host = rdma->host; + isock->port = g_strdup_printf("%d", rdma->port); + /* * initialize the RDMAContext for return path for postcopy after first * connection request reached. */ if ((migrate_postcopy() || migrate_return_path()) && !rdma->is_return_path) { - rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL); + rdma_return_path = qemu_rdma_data_init(isock, NULL); if (rdma_return_path == NULL) { rdma_ack_cm_event(cm_event); goto err_rdma_dest_wait; @@ -4113,7 +4103,8 @@ static void rdma_accept_incoming_migration(void *opaque) } } -void rdma_start_incoming_migration(const char *host_port, Error **errp) +void rdma_start_incoming_migration(InetSocketAddress *host_port, + Error **errp) { int ret; RDMAContext *rdma; @@ -4159,13 +4150,12 @@ err: error_propagate(errp, local_err); if (rdma) { g_free(rdma->host); - g_free(rdma->host_port); } g_free(rdma); } void rdma_start_outgoing_migration(void *opaque, - const char *host_port, Error **errp) + InetSocketAddress *host_port, Error **errp) { MigrationState *s = opaque; RDMAContext *rdma_return_path = NULL; diff --git a/migration/rdma.h b/migration/rdma.h index de2ba09dc5..ee89296555 100644 --- a/migration/rdma.h +++ b/migration/rdma.h @@ -14,12 +14,14 @@ * */ +#include "qemu/sockets.h" + #ifndef QEMU_MIGRATION_RDMA_H #define QEMU_MIGRATION_RDMA_H -void rdma_start_outgoing_migration(void *opaque, const char *host_port, +void rdma_start_outgoing_migration(void *opaque, InetSocketAddress *host_port, Error **errp); -void rdma_start_incoming_migration(const char *host_port, Error **errp); +void rdma_start_incoming_migration(InetSocketAddress *host_port, Error **errp); #endif From patchwork Fri Jul 21 14:49:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322097 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 323DCC04A6A for ; Fri, 21 Jul 2023 14:50:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRo-0002yL-T5; Fri, 21 Jul 2023 10:49:36 -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 1qMrRl-0002nX-T7 for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:35 -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 1qMrRj-0004mk-WB for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:33 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36LCwD6r029460; Fri, 21 Jul 2023 07:49:30 -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-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=VOYz5S/4uYWfmd8nUc24UL/Kyx+8c7qNbEVR9P b3iZs=; b=jxuC6aPIWp6gVOnpBsxVxoYTWMFxlzGjJznK8Y0eBD1YBovvhcLeEq FhjhxI+y2Mbng9VlSBzewQDKAqX8OBouJqYlQQZZstVB/Unx1n6tXAxO0t8774Bp 19cB/ER3tHI5vdu6s9R3cZn9wU0qsESWdJKHpY9Go/H8uNS64VWpKMSFr7WVIDQo zi45raJeRpIPISZojaC0YhkI2w74fj6DejZAWmi/EXiuHvnDtuPEix1G0cjTF7E9 Z4A9QQrNjHuMnkhSOfXCiO8Q860sdlWrJz1owcoRNKb7Njyh7zqA72FIQYiLBJ7i kQSxzG23bKhbM+YrAN+yi/DLXWYzNl5w== Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx319phvm-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VkRMYdiyTGPkThkJmRmsaL9NL5CeBz3iznNK/9a2MwjqawHgIgXJbZFGwmbZEEVEPAsf9PBwuXDwyDSSo05NWFf/wAc17LkocyjN6Ih5ky+KMA3YaGZe3V4MFrgVyWR12vSsIhM9DrUd8epiAFldQhXYAQwlhK2hSWeds3pa1RybNxlAfiq6ZzBxdnvB9ataEyjekJY0dhiwRfBJAvofyLs0P0tpRiwHo9DS0h+nIguh6zXnofE/YCkaaXpPgszwRztzT05ef4V4CMP7OfKXFc+0tm6+M3yM7m55zCZZmOS5ojeNUY3RNPmoVVo/15MGZfyAm4L2e6aewlJnlvQGDA== 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=VOYz5S/4uYWfmd8nUc24UL/Kyx+8c7qNbEVR9Pb3iZs=; b=HFipw8MBDjxZn0T4eq9VAxeKIw506Wt7VHHH3zfNaneUX1G7Sl2wOTvCukAiSlJFSa5ltnF/6Pg3wqucDKtH4CEsz2MIzz4vcA3xuJtPH/SZ6FmrgndtXO5otQrWrUFYBVmlPqYwTr002ts+OpEpKZQfcXcAILrZbUgiSS7K8eg/VYtYDkjWy+xMMIE3B6aabQYIBJb6ayKuUCfIUTJYLfRikeC5ng3pklBicn0CFHPta5YmBdvVTycsnomsHMrF3oTIsXK4WtCxvbjLO6Do3+CBtGN9fYBJ6g9f3j7e9rGpSoLcF2uI4fdOYdECLMacRQMr5eueIVS5ZLqyKhURBw== 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=VOYz5S/4uYWfmd8nUc24UL/Kyx+8c7qNbEVR9Pb3iZs=; b=T/r1rkl8rJs0ihLBiCGDT6uhVJ5DdCPTs7YW5OLsSpPhscgQttgrm7EMu0lgisR7iYJ1uz8B38WWko/x/N5oZGJvrzwOD2p030OBNQxOsYdZrKxabfYlCqnxSZYZLfcvLfTwKP2DXSw0HnkWgZmj9YN9CohTpiUbgwaa24Zllq8kCTD9uKyX2lA7YGwOJLb3vQIEGx8CpmLjVZfKHChQKs7/qTkHyDUKE2V2xJzuEbOmwhfkZMa63nVHZI7MJkk2cQkMgV5rxs/jiJTnUC/snDk+jhdgfkmeYQ4BW8eiZdL2TVFOSrs2yahHOMUVxNaZnbrmtd7ojE2vxM91a9D/Zg== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:29 +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:29 +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 05/10] migration: convert exec backend to accept MigrateAddress. Thread-Topic: [PATCH v9 05/10] migration: convert exec backend to accept MigrateAddress. Thread-Index: Adm74o1FEhxkOQ2ejke62AvxQfbATQ== Date: Fri, 21 Jul 2023 14:49:29 +0000 Message-ID: <20230721144914.170991-6-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: 7f3ed791-6dd0-4e03-04cd-08db89f9afca 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: e72fazQdGNASiWpdoYuSkIX0gncfF05QR7M7e4S/BexM08UQEQB8etoDqBQ8Atb5sMXwHQcTc2l5xfZs69PfAcjFWjhrM2h9ltXGfkZMiiMS+xw4KGHnVBOg125sC+iTP6+s9MqK/+oisXOYlshuA6NoeRXtnYmizR61eye0soI3kgjHh4nCRG9HRzbIA1cpR/Wp/eM6mI9a2R7orTPsPseH2+WmPOWtZMn3LXZSHHOBuaNe2U3whTSycI8+62rJNDMreih27s5gxWEmexutkdbSXfaJwrPfL7R16gIfB2b1L5j1UX7EvGty47NVzJWLCDJclCznvI1JFwetIyHRYLt07k4YpOS0hpmY1sBqJP5xlDjivXSRAnlIfG4HAoLnvzctqnudpEI2kM1TTh0E6hfnPhkOsB2RF/XK/WjevvsmwXGG3R5iSyI1j/Rd5hogAm3SvsAZUBmPQ67WR4arXMWwlavqlGiI7CGY8aH2Lhum/tNgrnU1yh9uz7DsNybiuJMy0g5SFy7OVL7qg6jQ0pIYKVlF9dIFFjyK9lB8mXOWxgpLx+mDWtWHMR0c6+lI9K6oj8GkIoH8f4QEJ4x3Yis8jtW9BX2CWCIh+65xmgrNMCjb/5sjmGy4yGggX773I7cPo36s38IsjFZEREVkxw== 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001)(218753002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?c1nAxFA1n7TILPOK7Y9A98RgC8kQ?= =?utf-8?q?ke6sjhew74uCZNI4HsN+55BVEmbS3IhaGbJUg792Ah+iKjxM+G6icxLPyr6QLf3n9?= =?utf-8?q?mMxw2Vqs/dj9hTcnL8THqD/0dNr6PekeciWs2l7Gr/jwYO39dzsC94uTb/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HJ3I8Qd9D/p?= =?utf-8?q?idqrDyncAzuCJEFeemDdNOvXHRLmJxZzAJiW9UHxNtFjkOB9Lk11CXWXb5+nx1wU8?= =?utf-8?q?D9+fYIxgCCTFHzodcAtNlwcw0Ug8HaZ9KPMBv3nRzGqdWGjVe1Utm5ubbtXIhXgb/?= =?utf-8?q?uf7vs1H63EjYwkHw8AKdhSDkUJeK337SGuA3bMt2Bx4z/uX5b5PDtwUQfBqAbW22e?= =?utf-8?q?mKef3wuZIsMZyQnstMvNjaJRWyGTgWWk+dJQcco9UNnIvrB3cH3Ul4zBGYEVWF4pq?= =?utf-8?q?4EHkWW6L4Hm4XP5mcP/G9Qb9EU6+FAHPsAioZAkYaUH68upecz0MiIfFVxJZqVf7y?= =?utf-8?q?st//pDSnq9KQoxB/EnXToDDEgJre3PLFBvSje1ssYM9jZj+YiB1uDIYXiwBG+rAPx?= =?utf-8?q?3yUSrHyU/EUf+kydIg0x13QFoytwkdG5qTVyyn03tZ0GStf6y8QxuOg3CUMz61HL7?= =?utf-8?q?LR7Zb8zsfUacRemFIjQwyY8bkIC52OwKm4tOiNY/YT+o30y/uwxDVpfN+G1a2hYXU?= =?utf-8?q?ZYns33+ZrsaGvVI5kPQVtkXPxYgfM56YRw=3D=3D?= Content-ID: 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: 7f3ed791-6dd0-4e03-04cd-08db89f9afca X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:29.1579 (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: MEXtDuyBFFnEY6p4wEyMfno/IpKwb9y6nun4uxGbCLT3VsN3tYDv1GYo0fO1OppZVtsKGtKqJs4ZiPHBMDUZFQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-GUID: Wj51MFHXrPQsaRS5EfWkMGHCKEQKECc7 X-Proofpoint-ORIG-GUID: Wj51MFHXrPQsaRS5EfWkMGHCKEQKECc7 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.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, 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 Exec transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for exec connection into strList struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/exec.c | 71 +++++++++++++++++++++++++++++++------------ migration/exec.h | 4 +-- migration/migration.c | 10 +++--- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/migration/exec.c b/migration/exec.c index 32f5143dfd..8bc321c66b 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -39,20 +39,50 @@ const char *exec_get_cmd_path(void) } #endif -void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp) +/* provides the length of strList */ +static int +str_list_length(strList *list) +{ + int len = 0; + strList *elem; + + for (elem = list; elem != NULL; elem = elem->next) { + len++; + } + + return len; +} + +static void +init_exec_array(strList *command, char **argv, Error **errp) +{ + int i = 0; + strList *lst; + + for (lst = command; lst; lst = lst->next) { + argv[i++] = lst->value; + } + + argv[i] = NULL; + return; +} + +void exec_start_outgoing_migration(MigrationState *s, strList *command, + Error **errp) { QIOChannel *ioc; -#ifdef WIN32 - const char *argv[] = { exec_get_cmd_path(), "/c", command, NULL }; -#else - const char *argv[] = { "/bin/sh", "-c", command, NULL }; -#endif + int length = str_list_length(command); + g_auto(GStrv) argv = (char **) g_new0(const char *, length); - trace_migration_exec_outgoing(command); - ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv, - O_RDWR, - errp)); + init_exec_array(command, argv, errp); + g_autofree char *new_command = g_strjoinv(" ", (char **)argv); + + trace_migration_exec_outgoing(new_command); + ioc = QIO_CHANNEL( + qio_channel_command_new_spawn((const char * const *) argv, + O_RDWR, + errp)); if (!ioc) { return; } @@ -71,20 +101,21 @@ static gboolean exec_accept_incoming_migration(QIOChannel *ioc, return G_SOURCE_REMOVE; } -void exec_start_incoming_migration(const char *command, Error **errp) +void exec_start_incoming_migration(strList *command, Error **errp) { QIOChannel *ioc; -#ifdef WIN32 - const char *argv[] = { exec_get_cmd_path(), "/c", command, NULL }; -#else - const char *argv[] = { "/bin/sh", "-c", command, NULL }; -#endif + int length = str_list_length(command); + g_auto(GStrv) argv = (char **) g_new0(const char *, length); + + init_exec_array(command, argv, errp); + g_autofree char *new_command = g_strjoinv(" ", (char **)argv); - trace_migration_exec_incoming(command); - ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv, - O_RDWR, - errp)); + trace_migration_exec_incoming(new_command); + ioc = QIO_CHANNEL( + qio_channel_command_new_spawn((const char * const *) argv, + O_RDWR, + errp)); if (!ioc) { return; } diff --git a/migration/exec.h b/migration/exec.h index 736cd71028..3107f205e3 100644 --- a/migration/exec.h +++ b/migration/exec.h @@ -23,8 +23,8 @@ #ifdef WIN32 const char *exec_get_cmd_path(void); #endif -void exec_start_incoming_migration(const char *host_port, Error **errp); +void exec_start_incoming_migration(strList *host_port, Error **errp); -void exec_start_outgoing_migration(MigrationState *s, const char *host_port, +void exec_start_outgoing_migration(MigrationState *s, strList *host_port, Error **errp); #endif diff --git a/migration/migration.c b/migration/migration.c index 8012f93f1b..f37b388876 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -468,7 +468,6 @@ static bool migrate_uri_parse(const char *uri, static void qemu_start_incoming_migration(const char *uri, Error **errp) { - const char *p = NULL; g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ @@ -494,8 +493,8 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { rdma_start_incoming_migration(&channel->u.rdma, errp); #endif - } else if (strstart(uri, "exec:", &p)) { - exec_start_incoming_migration(p, errp); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_incoming_migration(channel->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1693,7 +1692,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, bool resume_requested; Error *local_err = NULL; MigrationState *s = migrate_get_current(); - const char *p = NULL; g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ @@ -1731,8 +1729,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); #endif - } else if (strstart(uri, "exec:", &p)) { - exec_start_outgoing_migration(s, p, &local_err); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); } else { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); From patchwork Fri Jul 21 14:49:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322104 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 C8814EB64DD for ; Fri, 21 Jul 2023 14:50:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRs-00033i-Db; Fri, 21 Jul 2023 10:49:40 -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 1qMrRo-0002yP-RF for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:36 -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 1qMrRm-0004nO-Lo for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:36 -0400 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36L9tsg7000874; Fri, 21 Jul 2023 07:49:33 -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=kcoLYCWWGTkt79MpNmcniCnCtBC5L9iWy8fEEdfF4 UU=; b=IW9djY1alTCOrk894LMDU01B1Vxp5JjhhtWAwjSshKEB+7k4+nlht7CKD jk4nusgkHMDf5HaeZUFgGL5DSNHYJHLfuZzgghFfWfu3/nh0PvYgsPNbVhTru64k 91jcps9gTWYv5RHQq97SVM+batFFZhgMhVcLPMTxEI9c/KYRyIhDHKRG2bEZYAvv MpMEMmOPtFnNJmsCn/dI9Xe3rxnVmkiregpOVU38AS+dInK6UKQ9kL/OypbXahh4 6Yc1JQYwSnQMLA61gpqNm9caz0lhSTjscg6VvZH5jXrok8dAuzEGoD7g09/nnOjS TuhzrLrdDMYO+bt2EINFZhng3jNWA== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx3fmxgfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9USIIsCCodFkb56aprqm+khkXL7GrZHBgMQGERX9bVY3npZb7/xwdbYcAKQkujNoXg32qw+f2Ugx1Dhtm0n1Rnfq8sHF0wznsWj/IREb4bMa9Ap8vQOedHfrYfvcapd5umQ3IyFSM5ebcWW4hr129jSALEkmFeFpbxKmFtzrRoQO4h2r0ddr4IzUmLQ0B1ac1Ns/yIJEEn9BlP6ysRzvV6fg7jHKwMZ3GWQ441DsE+fC3vBcRz6OYaAmeLkMdMIhD+CFulHp3L8wgzkQ6mxQ3fIz8efAXkc4+BsYRKsqJjeqxzqTxUXE8cAOc1yMVQd/HX+wwlGducTShMbq1M/LA== 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=kcoLYCWWGTkt79MpNmcniCnCtBC5L9iWy8fEEdfF4UU=; b=CTIPYU/s9odwNjEv7DIQkeIPCRtfao5xOqBKIYMtHmoAEs+YWq7fBrXSZTPvyxAIHh2BKkWdc+EkwMJMd3M2DgkBIXal9S7SwR3O74KA1vtBq/+yyhSF37Ush2SuB38foyifOBAezvLKkJjjo/OblHdPFY7/WcADaWDF2YqUT/gPsvs93Xpp/GqnPLXKzu3ZngMEAAITTewrN3btZVkUP34SXAhrVibdQm2KyYIUJi21qt0ojG0BWNdBmMydeEeEwRyz+II7JEUPYP80yoFvIJEzHx/LsFqZ5M1z5jDdoeNGAAgaZNiJN0u0XvgQjX4dl2Q237tZY5pgbr6lDrtMvQ== 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=kcoLYCWWGTkt79MpNmcniCnCtBC5L9iWy8fEEdfF4UU=; b=C8JsOBcDRa8SvsVw3dqGmuWaECRqyCBcHoRcJzbap8TcWgIhd6lPaVahct9UY/6YU7uT7TtqGnAb7AIZ1XCXJyhDXlqX813gQ9XCvqBTrusQ3LITNqJO5B2ELocIDQdmAZzFbxFgInIBz8HchDoG73rNGjZehnhibgrIuL4YDIJDwbasWvoQ3VCuufaHPt/sv8hgrrQIY4sYdGS9m9w4eM7U7JHTyhLegqOepnyzYiTZ4Rw8XdCn9/6hl0JlyskJgIEw+Z6ixyY3gvF9G/Z1ffIJ7Fmlwzj2ZP+00ffTkLQfJw6zKyzPWC4DIus3cQQUcksEI/3BpZpS2pJKqrejvQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:31 +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:31 +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 06/10] migration: New migrate and migrate-incoming argument 'channels' Thread-Topic: [PATCH v9 06/10] migration: New migrate and migrate-incoming argument 'channels' Thread-Index: Adm74o5wbui5hd/vo0qtqkIMunFvLw== Date: Fri, 21 Jul 2023 14:49:31 +0000 Message-ID: <20230721144914.170991-7-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: 66ca65e6-f5b6-42d1-a301-08db89f9b0f1 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: vIkPkJAuUqDCo5TInvVVLnFg2SCuxHj9H7ygQEuy/zdsgwBxl73DYqpEc8nHNijp7kSSWTeMzeVdnHX08APb7SM2fngcj41k522Qy11CtFKcllwJtpc4+bYiLMCy18K2pno3Rk3V+X6SevzN+NB40amVbVPy9CsRapqL7aXpPTVLAEHJW9HkoO2sCnhIcdnr2/ijFFNBGQAzPwRYSvbs/mSTiusuLho9ROZQyBNMv3P35RzjbaaXwK83zRF6jx61i62xwOSJP4foZSIO9sl0t+4HhsOT2KmwKrJ79454NKSmZ1hFt/6JQrwRCWi3uDSKMiIfE1Z7GpjgrzThXai+SJRL0xC4DG11C99Xe7g72IQYicpg26hNNoQp2MjBmMwA1Si9146pfhu1LiDt6WlkiXpclsAlb6b+xBIzHX7LJhakxODRzvQ5R68iu2lSvKoDeQ3FbPgkGmpo+ZQarjYR/tLrpaQyLNID/EVlHZXHLn0tVYU4qhXW/V4YRacN/YrB3kcezJpCtTKzdrs6JkthsUkZAATKlINvSJvL7H+ffbYT09/zsMWjx3PPB6F4+WENMtRuIP9Jdi62j8ywP6DIzl6wm0iSAeP5xYaYsvoxWWtsN9IHKu/U+bKkf6l8+tWiUu6XJKpB/b1uZqy/EqHplA== 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001)(309714004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?97C8+dinRGqwm4xGl8lZH7osQWbl?= =?utf-8?q?aqwZXuvEYM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jWBgyTDVldHTYLy2YzjxhfPgO/6nptjDQ1toOeJEbt9O169Yq07?= =?utf-8?q?LgpD5Tzgm+oeCzVwUFT3mFDiuJ+S1YJbVEdbFr0HUJereda2VPCrqSpNba8JAQ9D2?= =?utf-8?q?MTEOfGyzGZURcbzQimqBTBp9fciqXzwZ6wVEO5NQNfKBwhprGBCRVC//YEqhZGqSe?= =?utf-8?q?EWK7lBuBHPN2Tmm4ETpXncrADaI9HRv4Yk4347KXROBfiRjSLSFjctEW00f9A1FNw?= =?utf-8?q?N6vfAArpJBPNBOosnEm7wknTw/asXzpe2Bi0fOgO6RVl4s5S2+be+yzY74mjtYznp?= =?utf-8?q?idgH3bRn8RElHA3ZpxsqS5x0H1/4ONwVkYibK6r0dn7Y3knDirPmlgxnqoRqgBlY6?= =?utf-8?q?lzanmxml7jyXybj9vd+myaQ7wgwUgW6X2HaCMJSty3GEbxJCBz/SWBi1BEbdLaNtN?= =?utf-8?q?zg7KqbXZivbhUBnmUpcMQx0zjwAjCw0p+CaSzIsrIcmYSUATBCRUL1TTIJ+uO+s3x?= =?utf-8?q?rkaYUf8fiMJYTodY+hmcvkFBgcnrvt0tNdvRnwhUDDNX7i/6H0MmYPzfaOjfBkB5s?= =?utf-8?q?qQ2jdKQW8rrWymfke7mBWvBPUk1nTgLXua8r40Zjimhys+EUc1EDHEFDk4zyMcYmX?= =?utf-8?q?rGn8j6pVQIs+bNrLlfo7GVdF/GgQJB7QTg=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: 66ca65e6-f5b6-42d1-a301-08db89f9b0f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:31.1082 (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: HsggupzvTRoYtPDeO5kYk/zNVo4ixfWN/a9a1BKlWK/JjYaKRXHJTe7oRoLkGGvCxZFN/nvCM27L0hj1+3lCag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-ORIG-GUID: DWJUQRD4ehHDLpLm15n_OClzWTW7pMXU X-Proofpoint-GUID: DWJUQRD4ehHDLpLm15n_OClzWTW7pMXU 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.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, 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 MigrateChannelList allows to connect accross multiple interfaces. Add MigrateChannelList struct as argument to migration QAPIs. We plan to include multiple channels in future, to connnect multiple interfaces. Hence, we choose 'MigrateChannelList' as the new argument over 'MigrateChannel' to make migration QAPIs future proof. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Acked-by: Markus Armbruster --- migration/migration-hmp-cmds.c | 6 +- migration/migration.c | 34 ++++++++-- qapi/migration.json | 109 ++++++++++++++++++++++++++++++++- softmmu/vl.c | 2 +- 4 files changed, 139 insertions(+), 12 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 9885d7c9f7..49b150f33f 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -424,7 +424,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) Error *err = NULL; const char *uri = qdict_get_str(qdict, "uri"); - qmp_migrate_incoming(uri, &err); + qmp_migrate_incoming(uri, false, NULL, &err); hmp_handle_error(mon, err); } @@ -705,8 +705,8 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; - qmp_migrate(uri, !!blk, blk, !!inc, inc, - false, false, true, resume, &err); + qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index f37b388876..bd3a93fc8c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -466,10 +466,22 @@ static bool migrate_uri_parse(const char *uri, return true; } -static void qemu_start_incoming_migration(const char *uri, Error **errp) +static void qemu_start_incoming_migration(const char *uri, bool has_channels, + MigrationChannelList *channels, + Error **errp) { g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + /* + * Having preliminary checks for uri and channel + */ + 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; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; @@ -1497,7 +1509,8 @@ void migrate_del_blocker(Error *reason) migration_blockers = g_slist_remove(migration_blockers, reason); } -void qmp_migrate_incoming(const char *uri, Error **errp) +void qmp_migrate_incoming(const char *uri, bool has_channels, + MigrationChannelList *channels, Error **errp) { Error *local_err = NULL; static bool once = true; @@ -1515,7 +1528,7 @@ void qmp_migrate_incoming(const char *uri, Error **errp) return; } - qemu_start_incoming_migration(uri, &local_err); + qemu_start_incoming_migration(uri, has_channels, channels, &local_err); if (local_err) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1551,7 +1564,7 @@ void qmp_migrate_recover(const char *uri, Error **errp) * only re-setup the migration stream and poke existing migration * to continue using that newly established channel. */ - qemu_start_incoming_migration(uri, errp); + qemu_start_incoming_migration(uri, false, NULL, errp); } void qmp_migrate_pause(Error **errp) @@ -1685,7 +1698,8 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, return true; } -void qmp_migrate(const char *uri, bool has_blk, bool blk, +void qmp_migrate(const char *uri, bool has_channels, + MigrationChannelList *channels, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, bool has_resume, bool resume, Error **errp) { @@ -1694,6 +1708,16 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, MigrationState *s = migrate_get_current(); g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + /* + * Having preliminary checks for uri and channel + */ + 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; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; diff --git a/qapi/migration.json b/qapi/migration.json index 0f4a54a7ed..9a365ac774 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1458,6 +1458,34 @@ 'exec': 'MigrationExecCommand', 'rdma': 'InetSocketAddress' } } +## +# @MigrationChannelType: +# +# The migration channel-type request options. +# +# @main: Main outbound migration channel. +# +# Since 8.1 +## +{ 'enum': 'MigrationChannelType', + 'data': [ 'main' ] } + +## +# @MigrationChannel: +# +# Migration stream channel parameters. +# +# @channel-type: Channel type for transfering packet information. +# +# @addr: Migration endpoint configuration on destination interface. +# +# Since 8.1 +## +{ 'struct': 'MigrationChannel', + 'data': { + 'channel-type': 'MigrationChannelType', + 'addr': 'MigrationAddress' } } + ## # @migrate: # @@ -1465,6 +1493,9 @@ # # @uri: the Uniform Resource Identifier of the destination VM # +# @channels: list of migration stream channels with each stream in the +# list connected to a destination interface endpoint. +# # @blk: do block migration (full disk copy) # # @inc: incremental disk copy migration @@ -1489,14 +1520,50 @@ # 3. The user Monitor's "detach" argument is invalid in QMP and should # not be used # +# 4. The uri argument should have the Uniform Resource Identifier of +# default destination VM. This connection will be bound to default +# network. +# +# 5. For now, number of migration streams is restricted to one, i.e +# number of items in 'channels' list is just 1. +# +# 6. The 'uri' and 'channels' arguments are mutually exclusive; +# exactly one of the two should be present. +# # Example: # # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } # <- { "return": {} } +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "socket", +# "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "rdma", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# ## { 'command': 'migrate', - 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', - '*detach': 'bool', '*resume': 'bool' } } + 'data': {'*uri': 'str', '*channels': [ 'MigrationChannel' ], + '*blk': 'bool', '*inc': 'bool', '*detach': 'bool', + '*resume': 'bool' } } ## # @migrate-incoming: @@ -1507,6 +1574,9 @@ # @uri: The Uniform Resource Identifier identifying the source or # address to listen on # +# @channels: list of migration stream channels with each stream in the +# list connected to a destination interface endpoint. +# # Returns: nothing on success # # Since: 2.3 @@ -1522,13 +1592,46 @@ # # 3. The uri format is the same as for -incoming # +# 5. For now, number of migration streams is restricted to one, i.e +# number of items in 'channels' list is just 1. +# +# 4. The 'uri' and 'channels' arguments are mutually exclusive; +# exactly one of the two should be present. +# # Example: # # -> { "execute": "migrate-incoming", # "arguments": { "uri": "tcp::4446" } } # <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "socket", +# "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "rdma", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } ## -{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } } +{ 'command': 'migrate-incoming', + 'data': {'*uri': 'str', + '*channels': [ 'MigrationChannel' ] } } ## # @xen-save-devices-state: diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..d811f3f878 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2651,7 +2651,7 @@ void qmp_x_exit_preconfig(Error **errp) if (incoming) { Error *local_err = NULL; if (strcmp(incoming, "defer") != 0) { - qmp_migrate_incoming(incoming, &local_err); + qmp_migrate_incoming(incoming, false, NULL, &local_err); if (local_err) { error_reportf_err(local_err, "-incoming %s: ", incoming); exit(1); From patchwork Fri Jul 21 14:49:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322105 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 60AD4EB64DC for ; Fri, 21 Jul 2023 14:51:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRu-0003CR-76; Fri, 21 Jul 2023 10:49:42 -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 1qMrRs-00033v-Cv for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:40 -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 1qMrRo-0004nh-ET for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:38 -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 36LBsHB5004497; Fri, 21 Jul 2023 07:49:35 -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-id:content-transfer-encoding:mime-version; s=proofpoint20171006; bh=+6llMYzHdp3fRPNmOAVlmXSqEzZSuuZRAKvWho 1eZlY=; b=UQEIgVPLh4MZD2g/2FsKwHbB6fvcmtf9zyuvz3W0AbyJf3M0lD58lH fMmb9Edm0wasP6WELesSfYVFUnFGnywfMQAFF7+5CEmAFDnu6kqB3ZCbAxDLrfrb +j34KYb+bctKIjBn4hLB9hfOBhpLeVjr2dF0enID8zpnHisFwzHI8/UqWGxqepN6 Ug2b3ZzfRiVHFyn34MXar4eftnw+7USYITNEc5tmn2ECeIRGLiZnsyiTi7JZr73w etIJsFcTGAB0sw4XsPO5njUojnfZgawBuB0t+XfHcTMqgkRMLyTPoIyyHlRzDEkM iLaC732GPIDSz7iZeY/iRv3p+Ndm6B9Q== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2107.outbound.protection.outlook.com [104.47.55.107]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx2jdejxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B9euuYND5wJXb/54Km7hif6LC/TYdLQ0JtJbpMEx/v2g/fRcTbYCTkk0U+2F+2vPHgkiciBOa1UwCluVlRWKh73Jg8BARehDZQePci6ZLbJhCZdOCin8ntO+USBPlxtYNIiMVl4viRsatg7BukTtVOTu71hPNgb8+fSU2xvk0myROcJrqPWhmnLfnehqmG38nhDA5uK9KC6XNL8/rlZP86F1+M5S1vtvBdMRGBGEp7uA9JDmA7XLTOwdSZPdArmK1mV/3lj8rbXAQxT/kdckPpMV7FQvKQVhbDisykMwMd8ntIJ95IXZUK4dR+/aXz4sXYNEKJ6so3dCEwhsuuD23A== 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=+6llMYzHdp3fRPNmOAVlmXSqEzZSuuZRAKvWho1eZlY=; b=m77bM4PT7CZHeCR1ChlzJeAL4U1NhSNrlPHVQS+1fceMZbWkYVmEQ/Lzg2YBc4l6NT/QGl+Y/wa3jWMPxbmY2aaMn2knOdIE/KrmG+5q8XlevtgtwKRJmr7RVvaYee50tvVf4K9akb44sdBNrPWmoNiz6oYoAVIqIr/T4m47r7ZRp//jCNpF7Np7ByXk6Wjrz2IyD7uSypMjXoh6gJ4bAbCJGTZ37ye3DlK4NKdJHGMByq0JW2Haakx/4D8FUOdDmrSOmo51zf1Rgenq9XVIA3he5fqWqXkR7J3Uo0/3SLva4lhQKPFZQ5rosd7Yk3pP1LObCv4MBR0/Rw4Lyz2QRQ== 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=+6llMYzHdp3fRPNmOAVlmXSqEzZSuuZRAKvWho1eZlY=; b=YtsBwLijOoreVGjyyhmcCyQYt0BDMuB00n7kZexUQ/WYh4At5Jq/U/mAB2P6PXLYQAzSKTIfBHr2aApolIbUPnLJnd1Mm58INz9naKNQ+t265MVA44Y3eSGJb/8oYkTULkuPuTQOo/WHUwiaXkVgziFWpx2jkaeKyq7+yhTu/8TuT44gSl9R1k2KhdxIxnoj+IJW6/+58sX5iELk1My2/4/CiEg7mulnuCOEGvao27JpzsJiihq5KMgrOtkVz9Swizwr7q5ubrnkpJcGWXwaCFtQRz4Ey7bYW3mJTNPMqgHNJZKSozNS2kihBjQzcBMwEdCpx9Nw4OZkohesu/CKQQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:32 +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:32 +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 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Thread-Topic: [PATCH v9 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Thread-Index: Adm74o9RITolK2NQX0i65VwVxFZA3A== Date: Fri, 21 Jul 2023 14:49:32 +0000 Message-ID: <20230721144914.170991-8-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_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: d016f1aa-8665-479d-bbf8-08db89f9b1d1 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: GsPet6oerRMtPDK4rhhJxVJu+OdI9dBsPVr8cW7Fcl0Etar1ygupeJtjSzMqk0gCca6RIMzQR2et+6V87YHOI7XFK8/YURl8pdRqnHI/rYnvPJro7sqjuIb5j+VrAhcariwYK0yec/hEIItGheDOqlnGar1SkZ6fruvXwYmyAL9Nne5p2OIKtYE6RJj6VGrkn2qsetPFXFc/JfbPYZUn9DfV0IgANU1EDRIFa4LePQ+WywcdLorIEkb8sQs0j4x3PoVLAFzpUDbQ0QvuJeMebXsJypBkluaQpXdrtMcdkZK2esSqPmU1qHZAgIw0wvAIPzxKaCZC/FjJsxBiiFho5HQEdwp+1rMD+sBhZdyemYWAMdJrO4wRRof0NfGC+GsFiiotw+N2xCGhqprWwYrZfElzmXOlaQM/q/4xZ4Y7w7sTW9SpKHDMRMpzAdeDFVJrvhvM6hYc4kQ3V4hz9bFMWu8zn8dHcEem3fOcJ6PjQDxBweHyefCqxRhtMpcQVsRnkZdsJsyyjnXJw91TDz9jIw2J5CRh4akjWjRoxqoA5B2eE6UCHFsdiYsDk1cZLgmLMS1+xSp6yrg5rSY0oflF5L/9rpVmwdKgijla6LDBta+iwZbKhA9LGkRIWe6/bQZ4 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)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?MTK8nE2E/3atZJV0Ww1/uL2CeWUl?= =?utf-8?q?jluOfvPolr1CLvVHWEuhzdrJEtwKPZhV+HlMq4UV9ouTbTttO8Be3e5/ThROZ2T5a?= =?utf-8?q?nwW5W2HVh3ItHkT4iPHGb8NGculS9G2xWCm4HImZtE/lfwSEpjhPaDKEJyHCSzv6r?= =?utf-8?q?y5gU7KE9QWGMzf6xYPYCiRjSu4VFu4HobI91Nfb4oPNhAVG17zkVzgIBoEllEQGQY?= =?utf-8?q?wdGjRaTIE9jtXZISlTBMb1xvZwUW8qoFRyxrASbf5wxPo5XiMqc2srsNzdXgNZ/c9?= =?utf-8?q?dK5fksK0Ng52kxKauubNAHrxcnjc9rcuc7bWSsvx+m7dAO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lGqkMlR9R+a?= =?utf-8?q?OMw6wXxUNLZCxb5sIf/Ghjj9drx2U2PZT/uy62fw5d5OFOg1E6Pl2vnbwdb0w6gsb?= =?utf-8?q?FDSBlz8w2oG1fsfHlLknPB7vUI01WtEg24dj9HOvSZpkbJXJHQli7OOUdQMD9O9f0?= =?utf-8?q?Gqrn9m5RrpnemFbN5ehocWdDxFxkv9DCw34y1TFGuQO1mok1nZuDtQq4wdp+ynb7b?= =?utf-8?q?FT/XL9uVzjGXDtwYYnT+FYkhTDQnMAbVdjJ25+1LkaXZVlGQiawQ6hwQ9ehjOjw3I?= =?utf-8?q?5VNLuDAJnnXJ2bqGp/lIeuOTP1QZzm38LwIGLoK1iyaKE3GwHaPUz4gqjvXPJfSAf?= =?utf-8?q?fCv9lzAVpg2k7Ccb9DX/McjsnRb/0FIDgQ=3D=3D?= Content-ID: <56BEF17733B02443B5D22A66FA38514A@namprd02.prod.outlook.com> 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: d016f1aa-8665-479d-bbf8-08db89f9b1d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:32.5729 (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: 1FXAcWOIN+XhDTjgwEqr6+5jTpY40y5Rd2O07oLMyt5GGXQs8th7kuZXWSZnZO07bcshdf5SnkgsOl6nmei7kA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-GUID: iOEEb2QRFyG6VipJn9nsqwkI6usSDbyX X-Proofpoint-ORIG-GUID: iOEEb2QRFyG6VipJn9nsqwkI6usSDbyX 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.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, 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 migration_channels_and_uri_compatible() check for transport mechanism suitable for multifd migration gets executed when the caller calls old uri syntax. It needs it to be run when using the modern MigrateChannel QAPI syntax too. After URI -> 'MigrateChannel' : migration_channels_and_uri_compatible() -> migration_channels_and_transport_compatible() passes object as argument and check for valid transport mechanism. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index bd3a93fc8c..6e0a8beaf2 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -104,17 +104,20 @@ static bool migration_needs_multiple_sockets(void) return migrate_multifd() || migrate_postcopy_preempt(); } -static bool uri_supports_multi_channels(const char *uri) +static bool transport_supports_multi_channels(SocketAddress *saddr) { - return strstart(uri, "tcp:", NULL) || strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL); + return saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; } static bool -migration_channels_and_uri_compatible(const char *uri, Error **errp) +migration_channels_and_transport_compatible(MigrationAddress *addr, + Error **errp) { if (migration_needs_multiple_sockets() && - !uri_supports_multi_channels(uri)) { + (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) && + !transport_supports_multi_channels(&addr->u.socket)) { error_setg(errp, "Migration requires multi-channel URIs (e.g. tcp)"); return false; } @@ -482,12 +485,12 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, return; } - /* URI is not suitable for migration? */ - if (!migration_channels_and_uri_compatible(uri, errp)) { + if (uri && !migrate_uri_parse(uri, &channel, errp)) { return; } - if (uri && !migrate_uri_parse(uri, &channel, errp)) { + /* transport mechanism not suitable for migration? */ + if (!migration_channels_and_transport_compatible(channel, errp)) { return; } @@ -1718,12 +1721,12 @@ void qmp_migrate(const char *uri, bool has_channels, return; } - /* URI is not suitable for migration? */ - if (!migration_channels_and_uri_compatible(uri, errp)) { + if (!migrate_uri_parse(uri, &channel, errp)) { return; } - if (!migrate_uri_parse(uri, &channel, errp)) { + /* transport mechanism not suitable for migration? */ + if (!migration_channels_and_transport_compatible(channel, errp)) { return; } 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: 13322103 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 5CFDEEB64DC for ; Fri, 21 Jul 2023 14:50:55 +0000 (UTC) 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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WM4ZdYDADzHVuWMtI10FTvzE7U3UOoZ1SJS3Sk+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+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 --- 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); 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-chunkc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8?q?OBrgA+QbxtPZcFCRf/+MfSaISigKTgzygd3sFiFKUrVaCe7yiFcHiVEnQ9cYlOaFk?= =?utf-8?q?SkwfrSJDHdv//scJS9bVwixUIn/LBdwhyd3GKeKw3VWEenKvipqUpmlNRREZb6CIv?= =?utf-8?q?KkyctC+vRgi6pDRnIG1ltiXJCehPWUexrSskzdRihKyW5p9pn5gxp1NIf++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 \ From patchwork Fri Jul 21 14:49:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13322102 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 2E49BEB64DD for ; Fri, 21 Jul 2023 14:50:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrSL-0003ZX-6W; Fri, 21 Jul 2023 10:50:10 -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 1qMrS6-0003Na-6R for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:54 -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-0004oY-6g for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:43 -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 36LDgFEC003513; Fri, 21 Jul 2023 07:49:39 -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=vSqndeJjS5AH5gNpHzpeSwSHT4tT7TDFsVU9lRb8L 14=; b=LZkrqAr2WHWUFNY/CAfKTeLPyJJcvWjwwkROUYhtox15aGA3pwUxG4/Ht bHCn+VcwlkUiJbzdKQ7R4VYV8EaQrpBJPh+ZUE9v/eUXuCuu4FHcduYDxGpti2Kj 4BX3abXhg6vfyRbywyrGrMnith4bjJT3NkvRTMEYgKFwEL2qq0JXQBSgOsRbFpXF mQAlaGaBUqWD17/nks565q0Bu+YtKp3lX5NeVvQUEjRGqC3qP2lp9D8v4ElW85IE BiOLfwA/g1wlLg/zxRmy0r8YzzjxBiJRnFwKE2oCKksyr1vCEFihkr+lOJ7Fpjpz /ulUZiCk33Gs0sERWUsXL8pHTyywQ== 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-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dp01BCUUENDH6JYWuSZSt7Eue2rN9h9qCvaAMQKww5FcuI6jIReQMcIHLO9UCf6CVn4lG9ARAuo28yW9C8StQ+tJArmz7Bs6pyKnCX9fzGXYNbKANzl+kXOOw7Xk7yw1vlnhQkpQqUxAJ4vZXb2WawCs5LnVIcXjaP6mxD4LZ1I5Ht1t4TepdhTgRe1KJqgcqy0DFGpTUZ5EsR3rDp+Kg/WQMifWxx1TbWAjO9LZw3wIcLzzJhksEkkCiR3k2s/LlfWrtAaRwk2Vi+ZbsmAqgw7vNbzWRSJ0tKPIBkY34B8n10fzu7dYdI2FJWMUh1yIPEp3LFuDuIxe3TYx3bJjAw== 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=vSqndeJjS5AH5gNpHzpeSwSHT4tT7TDFsVU9lRb8L14=; b=ABCxic/xxf6eFjTSVQvHK/T8YDxc/tw6JkJDXI3FnhqqczZiD/I7F4oC59gxfbPfxZ2YuluPnkk8Aa+BrAMlyV1ATQvZPRRV3qTcgmmHDrgWyHcetERddKsqdmA2xWBBRzNWPox6/wgkpmWJsYCrcGgDE7Sj9tqe4/Yk2pY4YLvFjuq1sYAoXVlT/ACMnMeQN68GiM0XZ7hTEuJUIwK00032QXxBXXuLd/PqjpLtszVY4wXNau9nv22KfOMsFjpuPkMDd+M9ihfWF9YtSfInGuJmomZAj2BMQh7xdlU9mnZVCu+hd9wq+u6cBHquCWWM93v0VSusuu5G2B/AkhaXEw== 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=vSqndeJjS5AH5gNpHzpeSwSHT4tT7TDFsVU9lRb8L14=; b=AIE0si9OBlHviucsbw+5j+TohcAQ7t6QKqpaGUHJ1SFvLyXCnPf0+3OhmNuuk6XIm6V5Ys6+UIUHtgHGY/zCQ4T5j//AsgYRlzCRFk8MUZ2DkY6R/GOPuPJsPK12C9LYqOENm6+7wc09qFQ/T1EZoq8eWcREW+5EfeLIXg3Rlfz8vASp0jXZthEFUubkyBKnkLdR/m+o56bdLNzlPjn0JLg5uuyL/HxznW6dEoguMnBrou1EY4hZtzHKf2cp2vNmwoKKBfzJ0ieuNA+3WuPT2vMVazaUww/Wqmis20FkoCaHYWUbtA15hAZ3TzwSWMuOa8tKWxSR9Kp+ZcuBLNg2XQ== 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:37 +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:37 +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 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax. Thread-Topic: [PATCH v9 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax. Thread-Index: Adm74pIx2/PqSaZfq0yFFfjd+124IA== Date: Fri, 21 Jul 2023 14:49:37 +0000 Message-ID: <20230721144914.170991-11-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: 3e03c69f-2ba8-40fd-02ae-08db89f9b4b0 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: jU8XGSqK2RY96WejfZOaDWJM+Nd4P6pmf6Pt0Rj4M5jQJz0B78eOvoYWGsp6/rr5ee4iVsJD5NSFkdFqKgJv/GY4hGBrBrKTwjKAPDStVqYG396zAF1uHKmRuDxonrT80zvCxtfcWZgUwdZH2q2M0pIBK4EZ55sgc/bdYd800Jz6/3cIBlJ0ugo3e+D7Ub5Bk5Vqc4IBUx3JzLUPVAvzT0cpU7sDoCQrnB8SKpisIhFpK2zZ1PvZkbXy0pj/GqR+5TWl/6ecCesU39Z2LrprCNILi3nVclqLGq56ujYqU1C8Gb2T6WG9svBYwVCwUX32TyNYOhHcx/B3w8D4eL5fPeFcYlFelTPlprlfgcMtTxYPynfsH+NGMFZ2pQktGqkaMoFSASupjklLNhwcwf7T3SnjLjrNeFJO1Rp9Q67a38DzI/ATq+ZNjrE/I4tXmVPuW3ALbyXuAQEQ9+zcYkUcWLlsTnNTZIr9LXtgSMtIh7Dm6t6EZ+GdwwK7Z6IunYo1ZtZ/Qj4z9uUx8FJZPa8TwABLTRSXkv8mCQj/TKrjY3oFMe1WdF3EhzJT9+byzAX6S5yLW1VIEHqvTdUevvGM7AGmVHhhUpqAZVWDqZy/4QmN/AyvDCSGb+FJleDUm25x 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)(4744005)(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?ybYS944BBNiNbc4DV+CmUxqA6f6Y?= =?utf-8?q?cxPc2elizzyMnj6UQpUQDArEwUZzJ2ScoFRQmfUsE8EB2x2aUbz6sspFBDP9UhvcU?= =?utf-8?q?2t4KMLO0lcJUUpGaqG0uczRrraQJXb7nRgVY/uEyXBMsSQ4gt0RsZ1aRsvYPkIpNY?= =?utf-8?q?/pB4n9rl/DRupRXeRLKZXID8Duz95Ltf1oJVVKABF7S68wckIgh8DHmtZZvh8mUDb?= =?utf-8?q?bGOkgb2f5M9DDPJqBFfzxdIzgBEOm1HC8f4aNhybZY7gf3TjfCsRwzDwNBqaSHrRT?= =?utf-8?q?XxjD3lJS6KosGOnFQGs5E4RtBF98sENSoLqZemIg2i2ofOy/6BcwXHMbyysRyZBIJ?= =?utf-8?q?bfVdy57z9GKJhWS4p3/aXxgqmKx6G5Dev04VBXVMO9talfTK4aosFPOFD2xSGjOSm?= =?utf-8?q?kBv80Gt+K56YDrZPW+LMz9gxbTr+ja7+0Y6zUy/AMR2GfOXbFh8bwhwyYrJsdmeL5?= =?utf-8?q?N1zva2M78QtE9i7W2ukYkUsXvat+v/Z7uX9QBKYXLPgOFMtnMtTKYQQSPTVGed7i1?= =?utf-8?q?V/3O53dVrLcNN2qdsMMd35Lg3zhu+XAw0YC+tzAKFfz5zrK+lMd/qGSk3h8La8Gc3?= =?utf-8?q?aTTpr8jU5w7UYXrpaHSmTQBZPOh/R/sT83CHswIuh4dMVJyfPHeW0AfAMJGezwVw9?= =?utf-8?q?eopLUtelwqwu6ARLU6d49aE6v0pkVvVql0BHT9ZSYCOOUn0JMxx4dT8L4N2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orOrg: 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: 3e03c69f-2ba8-40fd-02ae-08db89f9b4b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:37.3967 (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: sSVzHWtA2gUcj7LLna6WepWPLUD0+FM+OfQ8GOH5eJXZvJ2qNWjqVICRlDsriw4MlA44rRjoi+wJ908CAs9ydg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR02MB8020 X-Proofpoint-GUID: R1m6A6kpxuiVsoeiYzw_8EEjtCbhwhmF X-Proofpoint-ORIG-GUID: R1m6A6kpxuiVsoeiYzw_8EEjtCbhwhmF 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 modify multifd tcp common test to incorporate the new QAPI syntax defined. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- tests/qtest/migration-test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index e256da1216..376fad8311 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2185,7 +2185,12 @@ test_migrate_precopy_tcp_multifd_start_common(QTestState *from, /* Start incoming migration from the 1st socket */ qtest_qmp_assert_success(to, "{ 'execute': 'migrate-incoming'," - " 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}"); + " 'arguments': { " + " 'channels': [ { 'channeltype': 'main'," + " 'addr': { 'transport': 'socket'," + " 'type': 'inet'," + " 'host': '127.0.0.1'," + " 'port': '0' } } ] } }"); return NULL; }