From patchwork Wed Oct 4 07:58:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408314 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 284D6E8FDD1 for ; Wed, 4 Oct 2023 08:01:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwmh-00051S-3Z; Wed, 04 Oct 2023 03:59:07 -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 1qnwmf-00050q-4r for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:05 -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 1qnwmd-0006Hu-AM for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:04 -0400 Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 393JT4lS010676; Wed, 4 Oct 2023 00:59:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=wdphVivksPcEpzXgwxtfmuc5muVTRJbgLjSKlm3eT 9s=; b=B+CMe9HubAOgfuDBPJXGKyfS3W1mQHot5vhXIMuXJn6aNXqc9xvJ4Csb/ lvXgOV3KR2+Gj1uDuF7lXljt6SoS9b5DDihPkyfiF0TqRyeiYAcxePtmc/p5ZLPg g64hBikMg2s8BZZ/04z9WkeRBa7PMUEEa5RMJHA9kSsOvVBzb0yvqCTMVOZw8ZQ/ jviGglFdkIjR5NQXD1WNJJi7s3xE5v03kiJf/O4Dv1jMD9mZJ4JAdXmIxC9/ErBU Fw+0hGZ8lko1qoYKEWiTq5+/du61T70/0s6BxBBlN5c+BRg5xSgP/EUBXaGPbqPg 8FMgVZSakbFYsqOLdO74AHhSigrrA== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3teh77031s-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kuneG/ZuEDIvVFmdlk4Hdpb31qknmN24qQCfnPVe1i5UxAgTCyC04NIsnLncGBXPOndP8dQuWA8MmHfnB8h+7W1N4522uzoaF30JHsPCGo21HBO0RxYJ99yBf5H1Um9hOJCIS+RDj/A2thSkR9TE4YCAzkmJBJ39kuesm1V7DXLz9zNWOarUholyQcsX3hLJRTtm0QBSZ6ahCVDWGnL+FTtFSTFzOXYfNXEVzAAQcq1E3h8ch8J3E1ZCirObj18L5GJMruKN6aX8s06cCBPSqfaIERFBVmz/j1piNsN8vha+erOCDSAvx07RHlD/Jwfpd5PvvH9aA5H9MXHGunZNQg== 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=wdphVivksPcEpzXgwxtfmuc5muVTRJbgLjSKlm3eT9s=; b=QmDlwEbsxT5jMNu5a1H/4wyOZO7OJm4ZokvB3l0TDBPLSzVz+E+Zd9P6cJGD1+IRSyIXh2iAxkjS9K7qEULHu3jOWl45aHtK3MrmJg29qqRvFFBfstTb9JKX1rtoMaGlO0afmiDggKcweaBSPlDjDTKOvp+Z+hPI3KvKns6PFcGp0mBj8XCNF5jfN+MAFuvp50E9ztxaRQoo9cu7uHHmqlyFPO+0jQ8GF8yiK3jaZSJXs5Vnm9PYhKKp/OeZDHDQ/UG4S+bnsXAiicGF2bNStHAVdEc020FrmVAKx7OY7yRLM3Ooa5bwFn6y/Yxeo/4tIU0hWLR+siCNJ830NfEH4A== 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=wdphVivksPcEpzXgwxtfmuc5muVTRJbgLjSKlm3eT9s=; b=A7dxpeU5/Ts02zIDsKI8Gc70rvqg/p/MH4blRUp9yTVhj8FzYXkdaAdy4eR1ZjTB4nfSLgla+s6g8/54gB+bO3QStdzUDrDdCPYUZ6wIIJTtJNhhB4oFXnYgHhx7a6bdcH3iH+O14BfgnFSse2d0CAGE0rD/zWAM6zqli7tEUH2sa3uXeGHUR4nMij1hZfg0pANBadqSsg5AilYeohTxo+Be8HTl/E0hIskpqs/t1gEz1G2GD1p01cNOg5pCwt81NkS9DwvvTgkD7Idn15QNv5dYq/fvXNPwtqcFEu44K10m4APOof02drNfzC4b37tDAK4eKPlqOQ8CrtI1bPrLqA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:00 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:00 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 01/10] migration: New QAPI type 'MigrateAddress' Date: Wed, 4 Oct 2023 07:58:42 +0000 Message-Id: <20231004075851.219173-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 20cb6efa-103a-4f86-94da-08dbc4afc4b8 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: At9ZXcn+FjE3bfIJdXLQN3V6hR6GGtj/vl3Tuse+pXMw4bjCH0oN2g4LSum9iqW+7Bk6TvJTbh+c03ISdIzrKooV0G/OdXFzhlv8wYxdvnQJBg0Pi0/pWLXiNxx1ID9CCfZ0vTDNiLjkqjWvHyjRLNkdD2Ql6BD41Lld63U5/TTb0mFm9BkrFxxI/nKKHyPhjjro38w/8TA0x9SaBPpc6xoUJlqKtNVcUS3OGde0qfj+U4gT3ub83GTRz3MIf8fGZsdySnuO/B9r6rbuzBAOeXz4ATeVBSzwS/8Rkvq9xLkJ3y/tNwTPCceM69/0VOHcqOJDip8TpKrNRIO+R7zStxG2PcheEGyNI2/3bxbH51wmkunUBKNxbVF6n1My4YS59bRlQRc0i0Oh7IULPpe+lJ+mjjMkdacRNUgVZ+RJJVurStohf+0/gEJ9SWzJJKUGsJHlHc3CHeJmCiCTQ3fKBuQpsHrBsSlzsMV8B5NT+Rwmy3MZfBDFSJryp9mbc5W9NEuBhYMr6wvGMDieCZ7N/384qcbnye3u8vYjZ1FbFdtJarxwLj/dw/PI6+TlNzCAy3ZPgKOvyrmH9kIo5nZ6xnshLkzAm/ErMd3Rip7zt+C6FjSUE6mkzqqgZyaHHdDV X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(66899024)(2906002)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Yg45Pq1WE8eRUsGEUyIisy2I+wV8?= =?utf-8?q?ihR7sB6YDTZK36/mkOCB/1efN1NF5DExEDo+iPDO4ESMZe7CLV0wDK/uiaUCMmT2g?= =?utf-8?q?nDA1Fa9zjPFYt6NgwyDo3GxLvehMnbQRDkdNUSpxTN23A/1zkjhYBNvLWlXTFSptv?= =?utf-8?q?lJowecg5EP0RsAXzIBSqL9XISrfR5zLi7Bht6eAzeZcbWwx99rtcYMIlvmasUzJhX?= =?utf-8?q?9til+LU7rtZ/Jn0KjFt8XHKSzd6/ru8YWxSkwjUeg9YgtfYdjFfmm9g2j5egHwOKU?= =?utf-8?q?3VmlLKu9vhUK6uem8H4W/ZYxHqh+GGeAhROXjaa/y7PYPgvjtlbP+h3kVIdQ59HHB?= =?utf-8?q?2oV5GP4lispDW6VOru0sbfF7B4TA0xdwqZMu2tSGUVifiZnbi3pS9uBn2OPcKDl/L?= =?utf-8?q?dslHtRUivGgGNi/QBm7kg0u6BxrX8n32ukPgjUz9kRDETknKdKhOaIT6W2rorSneY?= =?utf-8?q?Z1IvtaISXlQ7jajBtGmZeFCSxknQbwFVBEuW23qqvlCTkEUMiuO+0m5etHAmFBwYm?= =?utf-8?q?v3fsSZfhmjbYtagXyTJH88GKGIHJWrAPdbjCObShYUze1ohanus1ghIW7OlMDkgwj?= =?utf-8?q?6/hi2GU5M90g6zYfjqkXAAuLE92aTTWQpTatteAwM1dClHFF6hIxT56FD+aU5qWtj?= =?utf-8?q?2nImWGrC8o8+M2Tpcsgd5PrHfdBnanzRV9ZAjHvEEJuHJur3XdA5f4XD3UrR1SSm5?= =?utf-8?q?og6L8WgYAVVmVqO2+FFkVmyzOw6aWgLv8HzQDrYdbHCVJFH6fTSR6NZ/CFMV39rER?= =?utf-8?q?GBoh1jTz1n1ToeQRRbwBwXG8Cp5g8EyEsVMag5tE1iFbQ3X1v3Cafk7sARQwbc0fW?= =?utf-8?q?LUADNbCWnzU/n732ZqYm7C7cXZWpVAkM/TsnirR2IBlbvUrzsy+RUEBA3RmVn8Oac?= =?utf-8?q?aAM3dxFlme5sz/poArEpk2bRQNvs4l18Q9v6nXRfXIgujAelGFiRpy0mZcw+7ueYu?= =?utf-8?q?TPTthHF+G7rN7Lmehm/n6eGcbIjtdVSZOkAoZY509yQZ9mP6QZx5BvFzPYHxBzl5u?= =?utf-8?q?i0TGqn7Z3VV6YhBAabt3NXw80YososcKFRltSFItvYYYuAlJNw+8WqxkxtWj0vrJs?= =?utf-8?q?AcdFMdWzlIn97kJm3vN1CfiolDy53liebbTyhyQiKURnwUrgQ00OFLssHGtBDBV7s?= =?utf-8?q?YcioCLV4a9dNgpZUaC51mqd08WqT+skZLZcSGXR+JiR+XASYJjsvrzTyRGiXHeLv/?= =?utf-8?q?XfpLq0UQAsPcp+YKVlCAYgicEJhnv3cjEkxfUNKtCrokMQqFOdIasDrjflCJNmU2Y?= =?utf-8?q?lXMs7mgIfHZF009e9JOLBc7JCwP61gJXXhpZz7EVPvYZSyeAmO7znZ7Quv3susdc8?= =?utf-8?q?AOPgQHQoVdIbwl4MyotMWvYACeLZa+ySV3VWbPTOCKJgEqOZDewUftTh3y5f+79Ko?= =?utf-8?q?ciPEg1XYEhvoYurVQbyXx5ajGyxsLJ0tR3AqrJCntMWkAjpH8GDbKmmJevSPt4zfK?= =?utf-8?q?H/DO2HPHcVKV6w/Sg98t9GjpWX4xw7wAtYIIc13vP/cB6PPqvKOKujZ7FMloC/Gvs?= =?utf-8?q?YT1TgdnmXwWr?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20cb6efa-103a-4f86-94da-08dbc4afc4b8 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:00.3102 (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: wLkUtkfQpQYOx14XxzTiEI8BbLxgHxtTt6DOjOJ/R4e+7iyG/nqzEMJYfJzuCS0FZblt4+5sXJQXLFUpxmD8jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: g0KlTxBfsw3CcRoxUm7OPm5ec1WVxIkZ X-Proofpoint-GUID: g0KlTxBfsw3CcRoxUm7OPm5ec1WVxIkZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.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 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 8843e74b59..4e4c39a9bd 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1478,6 +1478,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 Wed Oct 4 07:58:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408306 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 DD1C4E8FDD9 for ; Wed, 4 Oct 2023 07:59:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwmi-00051s-8w; Wed, 04 Oct 2023 03:59:08 -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 1qnwmh-00051T-91 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:07 -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 1qnwmf-0006IG-Eq for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:07 -0400 Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3941oatD003447; Wed, 4 Oct 2023 00:59:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=fLO6hk3Roz9vgt2MaQo+AnpyTmcwF5smrc9idFflU pE=; b=Li/W4ANHlRx0VbpExoimXQw3SDb57uozxc3999jGp7tZ96LkQiJUwETuJ HW3jhphCNgRVW/7JcUtj8rhlYKjJPvhtUEANYx4nvK9g8HEn++EZrCFbQ/PAClWb Nj+ecN4kMvyOdqhacocBAJC5pdzKio8gYpskX1ofNg3uILpjxhCWjAH7o8MhgNMV ec+n7x70/xt8tZx8FhwHTQZbTjddPfzMbIYo42MgCM0MeUw6suuC9B2mIm7ErHbB 4imhtX8unxh6DRzDuQVjDN092s6fIZrob8omxWCKBsGPgkSPYz6UjpTGG47Uq9HG STYn1CLJtAsDcX6IVFRrjdtmEiuIw== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3teh77031v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NyRxTVk4PTeNAlLB7+pnu+lMjMUXfwyibyKtM7I8XZ46WAWmRYrmVqjwl1GBojykfkhysM3wojbVdcuyf1alhgANmB76INs6Tg5OkPpOp42UuXN84YYN/FEzYkDn/HTCGWURFmtUMux2sXV6d7g85F9C3bWapR6rkM0r0bkMOBr4x5E1Hm/tS3KRbXuwBfMEbDXUAkWMjHxg2mWzeRScM2rPPKtVTagsXTklW+V8Rrp7sreQGFvQtNVfXFRVH33YcRSysH4vBNqH5r4tsHGT7jUZ24xgmiamIkhxcamsD2O4OQlFXAuxu6k8qXPmqczI0+/zM3Id7IvTgaulWYWEGQ== 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=fLO6hk3Roz9vgt2MaQo+AnpyTmcwF5smrc9idFflUpE=; b=frp9NHXgGM68Vqt4oNYAnEfy5WNqoX5nA89h3Jekb9ZJldjYoWcJcbnaXc7hHxorehrjiZw2Y14I0tS010foq+7wuAG/3CHk6C4jl70/0uEnGfT0UIZikQzhlh1VUbvO6GYmF4fddmLmLDrw40I7czkl90ZzFJzQzxBUiD17RIqlMxwrnrG5TAgaC9WUFPhDe2Iby+M99KqurGIqC4iAtM6GsDZrPueNGZPOkoPp0kUQRtxUe3YQOpCwx2Ua185T0Z7MdSOA3NtBLDElnRRxE3/vlaVWBQSNfQvKRqSXyPCkgVNdn/+KPCjcD/iwNb2/5b99lyidnl+nu8jGXc0bnA== 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=fLO6hk3Roz9vgt2MaQo+AnpyTmcwF5smrc9idFflUpE=; b=v1Ltlos6J9BGdbXNT+B+1oQgiw8DiechdXkE9L8mBs4cPi/8/18SXytYI1QBY1RO+n3aePnY3WMDGV0I4/woAHw4DCBznDnn3wgJglaLh03tq8qJbt11yXjUM6OmzfMVDhi3eX2V6IjMRTkNGyg902ZocCZpM2zVSC0wzT5WtCOiZdz4rKc/6qNWZGtrWgElSPNxP3/NGoXIVIgD+/iYQmctrOxbiFKmwIFs1iFGjka4ZEyWtmFBq4odMRVtwiSJGf+ktLtBXYhS8jd9kJqF7a027aNGF7RCwHhRQ9RNJVbAF7l7dh+ifkbZ0oGTa6siWh9gQ5uEdKSMpMTPThEF/A== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:01 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:01 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 02/10] migration: convert migration 'uri' into 'MigrateAddress' Date: Wed, 4 Oct 2023 07:58:43 +0000 Message-Id: <20231004075851.219173-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 956a8589-b8c1-49d0-05b6-08dbc4afc5a7 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: 2fF8hmporsD126NtWOeat5COla4SudvdiLSYwM4CIDMryrGox4BhOv4BKpIdDjyJd/JYUzi/nISOLwO9JeWqak+WHW3lJUe3V1qrI9506w0x00m09glaaeFmGXhz5WW14gTIE6x4+ORdDaCscgln7J5rST7nuhQxxaNl5gRRy2pwP4ATprv6jpp0bW8xMKiYqT33HTggu9c3x3Bf07NlNzuE1Xdfw0A2/pGP7g9B9QkU6fJUCWxcY9+S0yfC0yObFEdWbQM0Mn0/tGf1un99or8Nq321DBJ6mHKSjYkjVC1sd7pBojqFmIaWnsxA08KoudtwXpGBG5vEcDBa4M3Izk9vy8MBObYyKCZQwRcVBnEHf2D/2ZZHbzCoHQKHCNFOWgap0uSN0/vIovYKGOR9m10fIt91RShTj/BsUUnzi4AclZIrJ5nKV+pF0lQ1+zA9tshPzBqexYh+SdmjkbukaZlcmQ7DrDQ/XuzgxnKrvQO/vZaz9fU0IyQmVzEj8Cl21pjBHDg4Pdm/TXYvmRY1mP59OeAEM93rUq0ZK+jlGP3QwzysiCFE3ebr0pIBugUSykkHP6Z+VzvqhKYu5iquLYPQ2eZcZwzBnFgPKAp3Y0XPPJEiyvbIFAIq38GxPRt+ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sN+6Gn7MLIR+/kfqUzDIrRROauFf?= =?utf-8?q?7YwaRnKKftOYGJ2I4S4HFze4uo4Pl/5L9JL6draJefT2589iqk4ZwWC9lETR3nBVL?= =?utf-8?q?kREgE9HGZNPJpwHPOGjiiXef9vXLpFPGt7k/6hToxszVNk0YgglPXJKGvqVwxcaCJ?= =?utf-8?q?8suPTjhSDucKWmDtZc7O7uJjfmqlhO8pMPLG09yo6Z3ds/Mkv7T6HdolR6Lzt1Whh?= =?utf-8?q?PEXv3ryUVIWB4hBzzDGqqLVmTCCfb1xrTSOSqEcMxAOi3rv20Ky9eHcSBmuv4i0qw?= =?utf-8?q?xMEga9HBacMZfFBdUJXtXltVE9zZwA0ym1K+lNhpcKNKbVfPfbppJsk+QIibOsqIv?= =?utf-8?q?JlmPxvcUgivLCsUv8zqG8UcW4cvcDOHPJqNNH0Am8iryEb5bwyb8f/NRwyLbAsOgG?= =?utf-8?q?CibZKxAqITvBCV8xY8BMApmVsw63qZBeMFgbBofbJAFeNz3YxPRgTIqR3dz5hPNbK?= =?utf-8?q?zCum5lT8++1Cq6QEm/vUp21Sfm0wBGY2whMlRvX7Mi4l8HBLC1EiIxzuYlrvje/O4?= =?utf-8?q?1M9FljEEeaNUrsRcisQ0x9UzVZVlQY9Zfaqs//CPmSeY67nvkmXVL1NE81nKONKhY?= =?utf-8?q?BFX/3+so7bngGFEvHNFyfItSH7HywLNQ/+84xAu0ti5FhsryIksGe6vpbAKhFu1wP?= =?utf-8?q?rtIanartc6jWoBxr/WUKo45cr5iAJ8dmY8dGASVkrc71HmPpl1pbYG8O0bAL4HhkG?= =?utf-8?q?+1jrptjUHBlMgOo56AoDVjjyHNahzk8zd0zXwn/OZ3J0AWjOuoktn49Hb1ey356dG?= =?utf-8?q?VrzwbmHL/chhl4Md3FdOyt0ulltKEQHUwe3pTMNKkTClXe7+vuZie6CW1t0twQqi4?= =?utf-8?q?0CnXiDiqCpAHBzdrvdh8+VGL7TRro5qXTCSWadAVoSPhEShYFr0HhjakwdbHx42os?= =?utf-8?q?dXzQsgn1C71oc5nVMhQpEI2o4YMldCj02EgwxFBg1UwxKXSRO6vMEwVt6kY2yKp7P?= =?utf-8?q?1atkn1Uirojh/Ojn7UZDzocASAUU1X3jokx4t50ggpNDBEXGGW4CpiWhdoPXz8Ehk?= =?utf-8?q?8Cv+HeqaFHnHAw6iqvw1JOBHw1K+ZktDrMCULTWaJ7XJ10UAj/1F/k27m/P05TQ6W?= =?utf-8?q?lwZqOpbDlb7p+8H5j2F98xx7FhqVmTkaKzTQP+tuM0E0rxAFIhhgy0Vx+KSefXY3c?= =?utf-8?q?GDxg0SYgwKjeFZMwF4M4MiKXNbzZr7qG7bNs74nEV67Za/TZsmDu3gngP9UwBlddz?= =?utf-8?q?0qTGS8scROC/7TXf97ko9VmjYBEEUfsfloYvMWPXLXy16c7s5u8hIoADXXGVfRBgG?= =?utf-8?q?x9o5CglOcSIykTdCx3JtKTHDbbruIUt7cgynpHzxzKPZUmi1XVOci73f7wMnGP68+?= =?utf-8?q?UquDaxhdAb4IAx7ELz5LIvK2H0JVs5TgeKOmNyrcAn9nsbn1dpXW5fgl6ejk4VZAi?= =?utf-8?q?0BJ1nKFNeeFx09H076hiKlHM5Etst53TCVBTDUYq07gOiqzeSTjlLUcMN/3KvpHBT?= =?utf-8?q?aH1K8i8NnfRGwTbKfaLWhk4O1iqEIpQKyMyqhE2dBKV9nc/1mKJGwM6F+2CdRGvMG?= =?utf-8?q?/gcTs/RkeYTY?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 956a8589-b8c1-49d0-05b6-08dbc4afc5a7 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:01.8623 (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: aRJtg0c7NpNrDeqLzn2tO3BVMYNh16QiL+REQjjLEadCXS5/P9ITTV7JNQXealGsYxLDEJJE913AnL6BYN2nWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: HzRDUnkURFhqGB5QnAyk_QJ1G_wewo7h X-Proofpoint-GUID: HzRDUnkURFhqGB5QnAyk_QJ1G_wewo7h X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.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 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é Reviewed-by: Juan Quintela Reviewed-by: Juan Quintela --- 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 6d3cf5d5cd..dcbd509d56 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -65,6 +65,7 @@ #include "sysemu/qtest.h" #include "options.h" #include "sysemu/dirtylimit.h" +#include "qemu/sockets.h" static NotifierList migration_state_notifiers = NOTIFIER_LIST_INITIALIZER(migration_state_notifiers); @@ -427,15 +428,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) || @@ -1671,12 +1721,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 Wed Oct 4 07:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408305 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 3C470E8FDD1 for ; Wed, 4 Oct 2023 07:59:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwmk-00052Q-6G; Wed, 04 Oct 2023 03:59: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 1qnwmj-00052A-8a for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:09 -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 1qnwmh-0006KA-6i for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:09 -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 393Kj15r026467; Wed, 4 Oct 2023 00:59:05 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=SsXnl8g0BI9yYvYiCQb7gTsJQhOjoTiy/CerWusjg /w=; b=V+418kBX0UPfLc61PHZgLUFDhbr9OQYkMzIbewLnU/qsJdNUcMM9JDpW0 guBLfLgt5i9WwDdTMafmVdMLooj/PMV04DWy4aGbEaKxQuUxXHCZ/llc3yxQ03zp xf5v8IOmQKV5QvUhhcPjNDDFMTWBWfYdOELGI9DCrT+b+MnKyNMsDFDJC60d/Rzo 9ya2MArc6hqG9io47IhwkUE3aF2xDw2OPMyNKD6sT74hVwH7e360MBrR3AEw2qwg yOwqPg84o1VsbByD7BRLp0YdqSBFZN3GGyq54WmM4MsawRNXzaD2ehDGVXuNbZBU JYvu62cRxC76Bj0Rg09hygC67EHLw== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2176.outbound.protection.outlook.com [104.47.59.176]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3teg0rpr8g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bS37nVEIMv8Er/2nhK+oLOSuGG3j4MIVJXdflEQ6b8/luSLS14HDuw9eJibFn8eQWwWAuVdIAo6TUSrPi9iJ4apPLF5VzNMgv7l131xFiFWVhlRzDjjqisJNiEORquxTGlbvd5cVYKuuUaPmlg5C2uxhvi9jRyhdy2PZWh0tM7jEKqYmrDKx8ltFZGUg76cYpA037i1oaF7wQWU6b8T1tcdNu6uAWFZplsZAq7e1dB4+cutxcx9FMWEON3UXxCAlo9Bq/CUMTS9wncXu7EOWLxqJPGaklaKavntBPSKHwF/yWZvvEWA2SjEu+eVADbjZIBTzrupJGnhjFcMQnbudeQ== 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=SsXnl8g0BI9yYvYiCQb7gTsJQhOjoTiy/CerWusjg/w=; b=gPQuz7Vg4ja7nRfVDjP7XRgu3t6LdA0qjTwmem6JdLb0ojIJ3+kpb3xvBdKmHjfLQsZCX47H10b65Tnz5KVdi8rZBvQGPL2d4ty2AV+iuIG0AyNBkjhdkhSFTJJcHos50uGWhwSYMeVAe1A5MShik3gTVKDszOp7wlfKhFpqN4L6QPkmHns43ZPqg7DrC2G2hMGcHzQjWKSnAAFOP5/wnrCHSkgLbKGT/ZK5EFPEEuv8lnpgl+ZuDEO14dygLGICQL8mS28YdjFONvi66sounIT9I0q8jbFY5x7iT+sFzCn4yW9Pp1SUo838VjP9xQ1gqXxdR9KxFE+aUj8KuZ5VFw== 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=SsXnl8g0BI9yYvYiCQb7gTsJQhOjoTiy/CerWusjg/w=; b=hh4LJZHvHCTas05yXsnh1Dzw3hR2ayjEfIJoJYJhczr6nB92/4l85kHXG9YX5tysUs+JB6WhKwGmIyN0rLBdCgjLzvTOAgvXGhTmNeunGsxiYsm/bT6OQQq+m7c/VVjanIIs9x15wvNkjSGjDLaDdiaFi0IT5FQwnk7fPDIFljwVfrnzkDFDpUAZ0y4aCuWqHW3TGl8aG4xoNyBXI6bUZQEcrMa1NuNJWpNX4PdTMQ691VHtS5fYlSEhEdodWA2/LvJobNp3GKsD0GIVGrlUH0IYJ5pFwPCLWJ1ib2kWvYjrH+gNu9w+zZXlzXXc+dHmpOGWyElLaTkIcUM9Hj0ISQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:03 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:03 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 03/10] migration: convert socket backend to accept MigrateAddress Date: Wed, 4 Oct 2023 07:58:44 +0000 Message-Id: <20231004075851.219173-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 26b3e0fe-3ffc-4f81-9e84-08dbc4afc67d 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: RXbLVDzt+40lG6N9OOg49hsdTZAFsnWZDkY2bE39j5didLYp7prWFzXevo3kGT96zg45PzIwaCzR0yYxkUaSLrAF9ZwsBaZEujtgvMYny91736Ybbu2GQZqKUx2e7D6HmAW+XMv0fk6cGUSfimrIC2vlG0mAhOOAhNnvNMk6HVTm0zZCej+0eoBEfx5ikL43c+kOhdl/uxbj3EQ3wsDKnHyTJShepzebDrWpSsFmkza+Wdc9w+x1/S7EWIlRnAO1LWZe+my54jtXtiVNfrhjc57dEE4lRnpDCXZpZO11LUygwd79KOb4B1l3PDAx+pn7Gqy/q7SvZGYnEwGsHdYrgT5bHIuyN1dvTRFIqXJZ3yuDa+dFVOq03mOEgWN/7GfM7mDOa23XuKQ9kC0offem2H8jjZ3ETo2YyigyWvIMwkQe4l9TJTOqQavdov/oDAH6+Y9s70OrlYPshPQr9lRlF+sdlGjteQAb0YOWyJ7HsrGdeyTdCkN/Z1lxYgDn33sExLH/soYaX37hhvamBGhWYYz8kiYtlXZ1LH+5ZV4CLwwB3v2nImWQKeAqgAzxx150bEWxSXzB9sZ2gQhR7J4q1+ryUEBhg8NuylAhF4ENsqtlWKprxkx93gnlzmfIUJKu X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?F+7uSFFX0Om9PX4A03Fd3gt2ATEw?= =?utf-8?q?OplegwSwgG3+RVLbyqTGfJwYf1sAdrfQd2hlm8unXbGh65eRjE9mEtflzZTl7iKMo?= =?utf-8?q?1zMRgwxMK9XI5jQvHHriSd4qjeoBw4/rLQMm2H5c/5dl0G+SxGZIIedEPZH5IzjRu?= =?utf-8?q?RNPJbnHbgRJ0AYG54e3d5VeMQIDg17/1TIJCwllilm/SPC2zx93zS4c2uEtkprTku?= =?utf-8?q?6meqUTLtJeP1h4eyEOHnEnlFBS6+wgDbPawNFL8FREyNMJ1WjFjm86khnjjopmXw2?= =?utf-8?q?IOF4ab2a4lR9lDO8tmKUANpFPAIVjdpua05XMuKBZyAriKwy5BCO6GCIyfyheOpby?= =?utf-8?q?nT5VIJCdE+d8VkvnH7XazZ+TDqKctTMwZTfdbVbZTfac0DAVo3fmrm+LXpEExu1Xu?= =?utf-8?q?84qwWE7HXKmTTZ8FucBe6a9cVMu/3swVOV4lw7cb414KfUaZ9S7SsgYGqZDcIauyC?= =?utf-8?q?39JLiI1N9N5gVL8sVoQbz4J55xVvSurIvLs4c8mqelmxolX4m7nqPS8aZEtyFxRNY?= =?utf-8?q?EbMM/RWC+4PipYZIhircuczn5kfXt2NnpOajoCNTaoF+Wjv1NRz4Auizxq0yFcs8d?= =?utf-8?q?l/9pDUrarUtTkjXS+kN6fjv6hJ7JjofogtwfrzRgD0tHEJMMxcKVGq3g14CiOVB4c?= =?utf-8?q?bZpbtmvYz9rTbaP9tZE4fFaUpF1yS+rZkSQyFc8uxTMcIWCDmxGIEm2OaUGrcW3kY?= =?utf-8?q?vPS1pSurCH2aQSJywKED7+s8ML79oVj5v5iagIIwwWGfysNbCIMhbvBhXAZd41q+j?= =?utf-8?q?rL1T/sVHnHgtXegN4j3AjRLqtvZQwCA1NNVRHV5AXoQ30DU0WIEjSB9lCWzn5h727?= =?utf-8?q?gpJt6JKe9wI2aF3FkYOANqxiYwk2gaRo8oWltEd/zdN4KYfaZ4tjq/3WDlGWfSOtL?= =?utf-8?q?m06ZmrQqUvhqkCEEzb0kdPaTB9D57bInyvWQi2G5h1jK3SbU07ze6hfjGmdtLfEhW?= =?utf-8?q?bwLws0BcSPCTMHHhQxcUGYzD4AUoZFnWXofdgyuUMXPM+l8f8zv1V3O3Mk2q24dPH?= =?utf-8?q?5oJQzXB4a2uydFweannLpFtbN6U5wscMwKUh8KRTs45VzE0R+D9Q31J7yGywQTmx7?= =?utf-8?q?KnU5q/CTROk288RU9I+kgwR0xyioXIc+Qx+N+m/tg+4AMxB47bs8oXSKCQmCIPbve?= =?utf-8?q?Plu3LDXGxvVP+KZr9ieENPf2zMl5q4M3IRGAbT8Wz88Q88/djfh4FFqyLEpXrGJmO?= =?utf-8?q?O3F2Bj+CKRtIMPi5mU0XmTbzue3DuqLjY63huvoVWq1haVJT3pRPtUg/YTZi4iO57?= =?utf-8?q?WSEZ/7GwIT3sWyOpXSfeQG2kg5vReneKIFZH6DC/L5JeqALBsQtaYRnyeIy3Etxpi?= =?utf-8?q?E+VACcUbBDBMrJ0c6CCoXnIEPZTdNww88YgxWES9lLfI44RlRLNJPRMTgB3ONn4nA?= =?utf-8?q?XFk1VpmFcXQextA7mwhiI1Inp/7j1aqKAWxHEojDXK2wfR/yd5x1uFPQjK6YaORCd?= =?utf-8?q?YxU1KE+uQ1vnZrh9dUcQVrJ5mG52yecNdZNEKH3ltXlYsShKPNPV8VDapCMjE+Mvh?= =?utf-8?q?8oZVl/wgT34o?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26b3e0fe-3ffc-4f81-9e84-08dbc4afc67d X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:03.2865 (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: CEJRgVJ27inEka72bQe/BkTyaATvAtdAerE9GroDoSmIipWxNqMaQqx7mcj9wNUp2C6vOtCaC/L8cm9/mBlkXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: c7cMzN2RxaSr11LhZbn9Wfd59G2EQXYM X-Proofpoint-GUID: c7cMzN2RxaSr11LhZbn9Wfd59G2EQXYM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 dcbd509d56..b773f0110f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -487,18 +487,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); } @@ -1745,18 +1748,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 { error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); 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 Wed Oct 4 07:58:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408310 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 65DD6E8FDDA for ; Wed, 4 Oct 2023 08:00:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwmk-00052V-Oe; Wed, 04 Oct 2023 03:59: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 1qnwmj-00052I-Ls for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:09 -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 1qnwmh-0006LT-QS for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:09 -0400 Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 393LGSKU032747; Wed, 4 Oct 2023 00:59:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=c6oFabAP+wYuvMZdL/Z+T9S66JD22JQTB27gciVbI Mc=; b=nbBKzxNmsNkRLK3th5XS22Unq2wvGElhKqoq5Kx5wzoOnkYPhTCgDJtoP EGBkm9zU9hMZvYark2mWpuDzB5BlF0xbOPKu4UlMna/WBNE8BYyLSiq2X9cXiGYR k8zH6ecSNPHc50hPnNHkBeIDzikKPBv6dC/76FuV4QTtixYuwJHcIyAC2AmYTrej NuJZvohttnEEhlwwFtITPlzt6Z22qTiYzkPixrCERiA2rk5oqSUPqLahmzLDg0up XkuESL9bpm2by/1qKXs+VH5lv9akEA7x/6OVDocfQu6QjS1QTaIijQKFJiaX0INv zu91x9yg27EWRmi6/Bq5S4lFAEvdw== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3teh77031x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gm0/Yl6uNMrhCnSL6sJ1Oh2Au8HJkRf5P223icJXiTZ6i0QvgBDZO/c/dWSgYP11r0TUj/qJWL3kLBPIF14IohQ6r7bZshW8JRdXTYBOteq/TT2lXsEztt/YudK8Ka4Q/m2fw9DB07EXpOBkdAStzegNwzpIxmvAbFrOpsG6WbJiwa6Dge7feNcTRwG37h3hU1lsWZ+OUmZQ/pn/PzV6EvaoqcOQXSxL2qC6LlAM70pjkrm3tSAw7CtS6dAk7uSdPBDhpgKURh3N1lhkM6okc+pxaLLswndcGdhdgaxyFebZScUZ7MgXaZqwxxYWLklue9q5FiG2agbToAtApZkwCw== 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=c6oFabAP+wYuvMZdL/Z+T9S66JD22JQTB27gciVbIMc=; b=O1U4LCY9/VA0pQGptR6fnW6h58uZ6roUvt4YGTa2NKFhuPx84C3jXxJaq3xqLDneoToU2YuY68phlM3NOcwuAYYXW020hKQNTrOMggCwKiU1ofZ2d9g7qHCdKVL+6qIXdVFBGJSa7Ou8R1MxWiI63yxWIlXZ1Apel7I1+eTi3puOgk5RvrqoiM3ytjs4R3IKCkI3tFGCMOBOXUj5tsczRMY2DHcscNNIwGKrulc3L35eyv0FTwyAxExIsi6xE1G3YuEmvM1KrMaccoHax8kJIj6LSEom6WoYpKRf9GKhqR6XcVeIsx3BUn9Qmjn/YaM7SXbaiI9eTxk8YnElF8/Htg== 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=c6oFabAP+wYuvMZdL/Z+T9S66JD22JQTB27gciVbIMc=; b=dNaizy8cDrfAsjdLNwbCcb18+jEjz6VkLRZQ+ER1VQgUM2vIqYGEFIt77Kf3oRuVF8XWIe1IhpJbpLmWTABBBvEz8mzgU87GBwPK6qxzcK6dWIazwfBtD2i6KMZ1hjS9obkdOzPMUAX15YFNSK8Iy+BLGvacFTcYEVSHiwp+XE28CXDENy6AvbbdXC1NAPBmuuhAyBxr6qybOLYXDRM170eRM/5d6SlJ+rxtpBZYdubZ9ANAXO8JzzkPp1fQAMFy07yh69dNunz5/ORbvAc9BlTO8wFWlwImrjC+S6kekT9jmOq+7JYsA31QPqtla0ugIt/kOzi4R9MLAhGtZyFebA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:05 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:05 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 04/10] migration: convert rdma backend to accept MigrateAddress Date: Wed, 4 Oct 2023 07:58:45 +0000 Message-Id: <20231004075851.219173-5-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: ad309b01-52b5-4482-2270-08dbc4afc77f 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: Q/bOCQPlkbz/iXJ3ibCJRKYxWJ47F0r+aRuGwz0aIh/8ZNJ+Qs9305+kmboAuXQ/5hpGyz1HKuKt8DjrLMfXjExcA+MJ1zXZhHnKf6WPp2XByNFhicLvNHcHsm20oF2bupygUJWBNWqfPFPEbLHQ4ArbNwW9vDSJuBaMcdzibu+LjFklvUfSoNG7zeMDKp15yduoVc0Uadl1Q+7lX8PNE6FfBqvh0iomvEjZ8cKcX6m+jHMMCFDPMH8LcHHyDwyDuKp7C8ieIuL+1FEbObaPLbKnXi49tGy0HTQGAhZIofVC+nakzmUePQil96E2kzMmCiIasjdVjua0hHoWsper+oF1+GAvyo8Qg6ws42uLrY0tCvYk/BKZsjQoKGXEljz2W4wi0jIYYsEzsRPc3tLIEg3wyv9jC87IvEDmUiu+KfjY08MtVq3xl5dShjjNZzlDg+h93ZxNDGlCZ6Uu3bnn59eLYQtBbgGMXSEdQpYMbsMGArAft8vyqCI5PvrTyhjQ32kmIZmRXfa2XNdPH7w1iJhmgGsxN5WEfutIhnZlDT/6Q6wwzH1NQ7KlCUDooyMJJ+iM5pa6q+YvuJmC6Nyl0svQUyBwMgdB+k6GH9aFVrdXJrZ+4PaiKjZ4cRJ2IUMC X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?euyF45rgOlLPLIzvsPm03btnF4L9?= =?utf-8?q?b4MV0zsV2igOfBFpcHGRs5nU/Qs8Q2fSinPa3HdAm+3fBfRFTS4KXf+Fm2nWkIqF6?= =?utf-8?q?XZL/igswQaqVyPAxIcQ1YgqU3Nzql5dbpccEYaBG7dtKLUp+Ci6e/MaRAKhN/GnvR?= =?utf-8?q?CNbgKx+hX3C7jzDYQupUpHm8FLtTxHkvRPj7n/6VS7mH9PYPfSkRO9M6O4uR0B/ZD?= =?utf-8?q?lpkRaNJCRoSAtP9dpqCOWgXQ80aTUvg5oHsF/ecr7oCZz5BfGTLIrX9w6e/pMciiB?= =?utf-8?q?5rAgi+Arwr0tbkO1biE6CZP5lu4fq2nH74fRWzivVCr8E47m6/Nsp8mR4RPQZCo5q?= =?utf-8?q?pRSYyT36KnSMvqWOGQamoJveQ+a45KfYPLe2P39qFqPKf2uQtKcfN7ZwfiHwPT+/8?= =?utf-8?q?uOa36iVjChu/76EKGYSAYg+aF4FEZyuCa+oBMw2ADaSXVvo8yo1cBS1MX9wBbnC0+?= =?utf-8?q?FDmekJT9UFNY4bSDjlJzp4bNjE7hx/4dpuhjGqzRuSt1NwZbHb7OmsRtzaZbXGZXs?= =?utf-8?q?AJy/Jv9+xn+V9/fv/5KSFCAMWs9lfykwzKWABGFmoRuRlf6qyqHO+UcmOnXkewu7r?= =?utf-8?q?x1SCngbTCYnwFmoF9+e4Rd+x9TCuRc+qBA1q4zINRAGKnQvSbtWOflcVmM4XBlNzG?= =?utf-8?q?yYLWo/zhlLtO5pu7Dnu5uif+PoXC54NZvgdARr8f6jvCzjwKnpFiwaWH+cGCFvPcH?= =?utf-8?q?aUFjBoI+Cuw7/LMHJJx4vAMffQiYeBVCA/gbL80ljMMehX6jNtjnlc7ypnBmeXe+3?= =?utf-8?q?CaOl+dYU8guzjQomhacBdZYP9GsKpzJFr5KsUGvQjGyyPX5UZoWfYgDp0E0IeHMoX?= =?utf-8?q?QvpKyrkdEkvr8mkMsgxMrPvBi9f+6BBhrDcRhSGFs+SbvUfqVl0HrskImz7lsLpcY?= =?utf-8?q?ly6aEKrMT8lzw47NnH8xPnUx/gd+GK58g56RlnYqP9o455570j7ytJy9qaKz6rh3Y?= =?utf-8?q?JcOtx0tExrOB+99hTdcdbkgSCvzopyxvi0h0XT3oUm48oIfCNfgz6SnVIl4zh1KMN?= =?utf-8?q?Yrkn5zeWix4HVJvbU0YuOfCjMfnn8iTP4hbMBAUmgDpGbzf2qOIpA0brfGvBvNpd2?= =?utf-8?q?i3zJI8Iq0jU45gHeoVkmGOLR6LRByHv6KCsgP0uruSb5t4ukjEfU3sK1sqcjr7eZT?= =?utf-8?q?bS18s65MD6/GLX4Htkr4xdN1di69nn7lLZDRMV55CVZ5uMeIntcDUiAJPlGaiAF1D?= =?utf-8?q?knpN2zn6grGo+LrByZlF/O8Eu0hnTvfs8ppCd66N98xr/Ju/r4UDBcliwTm3uBV0j?= =?utf-8?q?M4f9LkWua9447VF7ctjuqSpWWwULjx8yTLffO5DMDO8ZpG2qi2hUYO1B4sqSb9sup?= =?utf-8?q?0NuG8UywiLAd0lUJnLkK6Y+7xYsVBStqu0Q/T5855lLErSp4C2ERyW9amkoefZaBB?= =?utf-8?q?WMxPClwoppMgqkLw5pzTPk3ZD7EenxnEE2vDZ482VYieVN/K5PaU4Wo/0TT3SuH05?= =?utf-8?q?LdN91JNSbs2m70UtDcBwPeqmt9m5JY4joutTjuPI4vXsuv8T2Nvk3fEOn71/6YURL?= =?utf-8?q?8cm5RbMegAY2?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad309b01-52b5-4482-2270-08dbc4afc77f X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:04.9579 (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: +uBigKuPtdGDxLL5uSMAp3RCJlkdxA/JSasbhN7qm9V8l6r9qkYr5DmCrveVC42XgM8THdqtv7jomXcRWZ3Abw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: B7J4qe_bF_9uTxcaAbEtRj5KVF8jPifj X-Proofpoint-GUID: B7J4qe_bF_9uTxcaAbEtRj5KVF8jPifj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.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 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 b773f0110f..b41fda6f80 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -497,8 +497,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); @@ -1758,8 +1758,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 7d2726d5b6..8bbf0b4c67 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]; @@ -2475,9 +2474,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; } @@ -2759,28 +2756,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; @@ -3368,6 +3354,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; @@ -3383,13 +3370,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; @@ -4121,7 +4111,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; @@ -4167,13 +4158,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 Wed Oct 4 07:58:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408307 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 DB0B8E8FDD1 for ; Wed, 4 Oct 2023 08:00:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwmn-00053F-TV; Wed, 04 Oct 2023 03:59:13 -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 1qnwmm-000534-Fo for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:12 -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 1qnwmk-0006MK-Jz for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:12 -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 393Kj15s026467; Wed, 4 Oct 2023 00:59:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=uZEQUvCp6ZUJ3uSVxFQGDncnxyD9KRWF12/PPLuXE EA=; b=F/M8UQcfCeU9LBKWnlxkgrt4/BQ3vndL78cmg0wgYGdYu7CmeQLAWTw91 tCu8gdX36+Ke+VG0ov5H6WsOEXkf53V9DGEtzm9iZKWCo7VAGJIZOnpcwDd0zseQ E54cu6+xuT2zIWqUvNzXw/OeY3AGShZj2OAzsVyrzxGr9KVZvg/pzJFXB5EYl/d8 GSZsUbiET3hlkL7N46L52s8DrJvMBfSSCxtXgS2wMBMebsmkRzZKQKvXIpz9O7Bs Go1qKhb1e20js2lZnvHbUNxgaBtfWTGHT4fOd+CiRl1VkXvyy6vmf41yEkxc9lpI QrFtCfyvcN+LWK2omXpzQpTizYN7g== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3teg0rpr8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K46dHdyS4MmpbyIo3fSIm5/jAx2k48+rzrnVvYjgV5odHidp6D5VOJKkWg+KVwl+n65rpK+TLHY7Dorh6RNwDAaSquXwSOpjSFQKj4tBuXhng1CZ9JF3mafZdTi7WMVPD+NJF3OlXxpB1MnY0PW0A+rpBgNjIZGC0yXLlmP54U0DaJaAo27b0jIweOGUewVZiQO8FDAMfyiRgC6sKTEHtOnJ6DsZ6wBQo6ulMCpCvftWEW38Jxpdkqmch+gg6FAZ5piLVuXyfrvPIuyhFUi1X3DAoeBaO1XuTRuLbvVwLG615oIwApKljRgVw8LXQJMXhsR9pUmwvIRQZ439BrFBMQ== 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=uZEQUvCp6ZUJ3uSVxFQGDncnxyD9KRWF12/PPLuXEEA=; b=m6QilbEsVWODdo0TaMFOS+PUZUUlgHdRCBE/LyybtIoMJtH57nzYkm9qgYlXCx+hC2PvPbV87A30x8Sc1Ry1pGACSFMXzTPpMcqqNW8FUkt7yYhwvQ1sffoTVtKfP1Y0igeoF0En7IMKV9maMR2o7B/Aw5w6LEBrgnPwxiheNO3qce1mDysiuKZGRYF8pYips+iGFX5mpiQxzwwBP7dpO4yNDZ07yqssDOdNbyZ51jJeGWtn/Y5FCIiqke1+zC1bAgUfbIx8KN0it24mgUVPXpcdE1SY1KIniXgv731BW5byq70oN8liYu8MiC1XukM05lxNMQfM8aY8XK0rlYPykA== 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=uZEQUvCp6ZUJ3uSVxFQGDncnxyD9KRWF12/PPLuXEEA=; b=Sn5J/nhCBJH3ntjPchbM+7haFSDVbK64D9DfhLvpAkENU3qQT1ovso/Xyap35x5CSEaHPtNiWO0rP+DX+pnaSuu8G4Q6XyvwKFTsvZrNOjVO6//PhZtcx5/V2Lx1i3nBYCN4Ee9v/BFWDM0WmzIAorkbtvgHhmLapkQySM/wQjbwJrdqpEJUoPXXuzyTN9iBbzlOXqwPAEeuDXgxRyB/N9gBHDHBLTEcw59KVgyiTd1t+R0Nzbr0ODdxZYXeebN1gVtv74BzjdsaDvVOax6ZcZriE9RgsuNnxs/KaebM7ZWfEcW1yGDfCmS5aTpo/RL4i6hO6Be4LXVfKewWH9capw== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:06 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:06 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 05/10] migration: convert exec backend to accept MigrateAddress. Date: Wed, 4 Oct 2023 07:58:46 +0000 Message-Id: <20231004075851.219173-6-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 0673e0ab-2309-46c2-4418-08dbc4afc87e 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: HC/QEjpTlKa6GW/o0EmNU6J6XFESjO4erQwATgqd36/2/vmu5R0+po1Pp7Nt/eGIWLVIytGqozJE+38oi8jZND8MxIo+PxIkx6gmgBshhUfBS0vSfLnGHGQipFfj2sQ87WgNV8ksaEcYYNOYZi6rD003dq6v6++jhupe/uPTge3ysyVXgDF+PF8CDK1PCUk9rPUzjy9Gg7XV+JNdkA2azDfpl762nkGgoGumbhGC8diJ2Xd1oquOJ9mFEXfTGO4Iuto48R/wNK7s8NEPPOptHUZcKmpL4FzwRraEIT6PxHHVxp5IrEHuC4wYYwfndj0yAMw6E4Idy8AJ+es1/6BB07q1pH0pnT9Wk4GPZomln7Fu3ClNYDGx1UIG8QsR0rGCtNiZyWTMFC0S1+0pO8yXth0ncFCksPp900DkAONABdAv9Ns9yX15CQAM+9RUhDVPDnN6B8jnyJIMZ8ZFzVDnKp/0jPvMUsjl3PRybeq8UKc1CIddzvltmCaXqgKOnNp1fgy1oiKWb2S9r1Yqy2K96Fb8EzT/aC1dizEtLd57XrHWdVwWDI0kH+V8O6cqvGz+elMR5wGzFuufmapMr5hkOhpHtocSoaCbzJdTJfhJ0SZIGi+VWXG8wMZjlAU0jr673wj0rSVHJRwY+NjwQ28WHA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001)(218753002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?l3LJYnNX2GSywnpe4MYnd5jbW7Y9?= =?utf-8?q?jF8gT5w/tKLdp15FFog5rWCN7dOF+1Sw/n9YD5OUqJ9pHJMNRQdkSFR0zahFCQ8pT?= =?utf-8?q?jJqUdzSEQdUjqaMSi9ugqVJgoUVzqFSo4GDQOe/7Mqz/h8K3i5Gyq/ArED3k/Xer5?= =?utf-8?q?qceiigFsG9Vd92DAgr/z0OQXpBjz062eVUIHw2mW14lhQhWT4XsIJ/78MwmqrOSvk?= =?utf-8?q?WDJnVEYAc15rgqvdNiPzga52tjzhjxkoiuVgmaoBmIiQSe5QMmiGXKuPwKp/K5/oY?= =?utf-8?q?Vm7vqV+YEbDYCfjaTzGJ0qB0YXoNH/JaETFw3+vFCRP8sImyoUyfrPcY/JRKjFPb8?= =?utf-8?q?lqARpDoCaKOA1ov6yqgZGq8suxycJ3wJHrqUpO1j5E4z3wjexF+a3/ITZXuuf+h+F?= =?utf-8?q?SitzkgY00LcgaDTnNFfL3UlkdNvmPUmh5054K68CxYkfQ8qXILeAQG6APhKdxAGVP?= =?utf-8?q?dRkVSKSxNw2L/WmVYC8bo/5rd44Uhb9Z9hFTz3OfpD6fZWDJLh4siew0zPXtjXlI/?= =?utf-8?q?VD0nzvagKdoK7oTQeADJuQxGt3egaENOpsDa7dcj+K33jpoQJMjRzb5BtwXQRUvOd?= =?utf-8?q?Vf54x/AK6cVJ4traiiTlsxOiRfS1cyQQneJsGIBBb2y89f31SZCUOppt1ag8rmMoz?= =?utf-8?q?wERpEp0HzYOxRxCyIDHLViUAjWfDxon7w+9pnVWPbd3t/PASk1aaN9d1CmA+OZhJb?= =?utf-8?q?WCcRp0BMqg6r6AtEMKxVWGv43vb9jrkDQq5amga7SZXYIrn0/Tp5QH+jbkrlsC5iI?= =?utf-8?q?k1IPD6S+vUrOYbWXmnFDuumN22A1B+RoUbH38nEu1Dwr2u9BZ7HDoQQuswPrzgS7a?= =?utf-8?q?9dDGbLt3dOhLLEQ0A9PJyXTsiNGzVgXJ8/orpPzlEVk1VfUqKpc0xpgh7UfGo8Jdv?= =?utf-8?q?TnviKb6Ks9KBrz2QthQCP6PhYPVxBprqxvQngLYiFbFp/lJTRQ3Lfe1tYJl+m1otb?= =?utf-8?q?eNXqYa+Z5vrrg/V6gYhzCaKjDz+yWafCSQ5XKEcDyDrrlomTJV6vdUjdJUkpa9PdQ?= =?utf-8?q?z3hy4UWK9Px7DT+lrl+fixRDfja4y3hi3APruO2wUSU3wmu0qAfuOIGn6mdN72OBc?= =?utf-8?q?Fo6boWLFiYMgUSwwCsKhZll5wVvgNVsEuA7pWb/7X73SU7hxgMloW/TbgqNCNPZ+f?= =?utf-8?q?3Q+g7dIy0iXCLL+hIs6gloi/AzQ4BDZ5rUQINV1j0Enhv0dGkbgtXJab3AbAphxmU?= =?utf-8?q?f6IAWGF6g0p7rowTmQpuPBbEs5Vce9fJ3PqldCW/gb+PM4oouVFzQk3PH0aMA7uOX?= =?utf-8?q?a/WfMeae1aRdyTS3E1Fa+JeISjCiE+lU9fBTRkchTCRQKinFSUlnWb5LsKBzxJjx3?= =?utf-8?q?FM5LyzgkHd7bG0vkq2gvjDL3xwi1iUESdc9i6yFvimk/IPbR0ajjKFhY9VxR9Yi0P?= =?utf-8?q?JBJo1SkZUkUD+kHY33/+ujt00xuDC4gE1Evxs2RMKhg+DuaYl06Su6sdS1ptqZ2ag?= =?utf-8?q?TWBaSiAdSPXdGQSdLW2IDiMHZhSPO5T7i3FjSZEIDzP6NY/0Y7m4TnwBN7Zt7Q77Q?= =?utf-8?q?G0OmQgsWeUpt?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0673e0ab-2309-46c2-4418-08dbc4afc87e X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:06.6178 (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: 3NoBuqULmTr/io8WLYVMctUvRVUM0lvzL9HSSXxP1toSQbsgJXYzWnjylcZtOzvZgmVmSxrbCI0kKA1CRqgKog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: t8XMNuNOZzrWqaPjRImSAhqAaxb38993 X-Proofpoint-GUID: t8XMNuNOZzrWqaPjRImSAhqAaxb38993 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 b41fda6f80..ebe14b9c38 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -474,7 +474,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? */ @@ -500,8 +499,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); } @@ -1723,7 +1722,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? */ @@ -1761,8 +1759,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 { error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); From patchwork Wed Oct 4 07:58:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408312 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 67C35E8FDDA for ; Wed, 4 Oct 2023 08:01:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwmz-000560-VJ; Wed, 04 Oct 2023 03:59:25 -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 1qnwmy-00055d-JN for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:24 -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 1qnwml-0006MO-8f for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:24 -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 393Kj15t026467; Wed, 4 Oct 2023 00:59:10 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=SlDNdWpkBG/zIBO7IKoz82ydiJrHWoRrvG33lIeyL o8=; b=ONHee3KxR7W8xnM1lWd0FHItEIzIePJG8lrsGivGax2p3cvtOms6iAnA3 /lOYBdpPcLBtuVm311wVUesX6xlmvyBjc++xzy6auFP2r4PBsFIog3/d4MBw6dPq dpssPe3ED439QMdWbWDFiXYETZG7oRfHJiAvcr60MDF60+BXt+nGIogItNBscfeS 1/rWoqxSm6wlzbdrNvmyBaJIhuSp2tRSAXZm3zGjkY37DFWR5d9mVl/gemtlkRui 1gTuwIo29aztq9eS+7R6voEJuLH1wYA2OPqecAmcGq0KKBnNaAjwVoGrs5sofztB laxg9XDZwP+ssIu7FAEPUbuTIT+FA== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2049.outbound.protection.outlook.com [104.47.74.49]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3teg0rpr8m-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hYiicbxaXpmMJ9uGuZG8xAQbqFnh1ap5Mpe6u60uyOcwMDPn3D2IylceI+OIWQYK66PrcW2lN01CxleoB9lh5SLzUX1BMkAnLutjXrURmZIDukIs1xLy+cMh0Gr0yRRtT4B+eyy+6mbLRuTUW4JXyxAO19NRtXpWvDuG562v8TjnETgmYMRJPsAVjbob6PXiNvzef7GOX2S1jC+i2fJ6zavsS8Ijop/uFDXhCDmMVH3zQLeG1xBMMV7dT/bd+L8lYaY2nEI7/2GuJ1qFApE5gZ0DJ6hV6H7BCobEEc+2jSzf6LmPXbNFf6N8ffpN3WrdGiJ7keJ3XKJ0ki7PDRxFwQ== 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=SlDNdWpkBG/zIBO7IKoz82ydiJrHWoRrvG33lIeyLo8=; b=gxFz5C1adSiP02l9CPd2yxTqPtpdPQkURYP0DlN474naCZa1fRBmqgnm9HB8t79BCtUDob6Gx3n/Mql+q0OErMQ8cwYD4iSd55IWMmbIap4hNBPvlnxxJ2z1pVz3bkllcSj/Fm9xNODaqFz9Z8Mr7ji9vQJXRa3GAt/lL4BEG5DSDsVUS14uc0o2vWd77d2+oSeluJgAPVi59hfU1eMVa2TNeMlRMj/tlXmEqeuSYR6UBVnWG9RCY7YBibaIqKR4NDyPtexVoTFASRpz9mAbsCihz7asHxGW/ZKYsMAsoOPKW1SiYiLk7E7ADxtcQJ2s14vfnYh+LwlK0f6gF+ihhA== 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=SlDNdWpkBG/zIBO7IKoz82ydiJrHWoRrvG33lIeyLo8=; b=SD5cyABFmLvJOOlgjGwEKrROpfEhou0LH8LZyygHtgf0wRkD1DoGjEyyLQGAiBb2kBJxqL9MZZHO0T/Izh0KSQrXrunvWxwchW8MIBQOzTwJQ3chL+0MGRPTGohnqfiHxsS267AmuIv8xWh/9DKNJGppWCBy1DQZUxfsBBt+KGSzhM2lcCpe6lN9shonOwGY3UgeuhhgHri/qTodrdwMUQQIEwES29MX3+i3UxSE7BfudataCW9SY0qLmIeVq+honk6D78M+X4ZFGiF1hpm9F1/rSWymvFgF0GUGQ/MV+BI0iUndHxCRKyTY+cZb/b7oK/T+/s6yYYg9WXiKCG/KyQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:08 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:08 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 06/10] migration: New migrate and migrate-incoming argument 'channels' Date: Wed, 4 Oct 2023 07:58:47 +0000 Message-Id: <20231004075851.219173-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 86153627-5814-4f43-3f3c-08dbc4afc957 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: 2wEWN3kxMtsr/OMJc/xL8Vqb/ZQI8Uvr3cg5FFW5NrFwCBohK3OlOLtAxZcAN584iju+9Sffgl50UAnLigegK3/f68F2RjT+ZiX90C30OuN84wnofvzxdIVReVxA4SGHKvzngCY4kCBPyq7TgWquUcBEP/k/qnVl2Q629WBrwLOK2eBUmAwGDPlQtNHGOQFKqNPtbLzI20ht20BF3R12cDn6G0LM+oWosyHubvIlYBweKAk0W3HkckQpdIisu1UF9lmuYRSSvQtYOVK6jnrOZr4tzdPLeeluplOZgz1DjtbBT9wK/svrt6KRBmlL9Cte5eJGtS3RIo1mPr19GihIABj7Q0b6fqf86xYIgtDRjLxmOcry+JsAewMWWkSiNvuw4CrFB064D5O9bSKcClY0ueloRbYHhZOISceothTwUdV3usUtHHq4w8mKxZX3motlxnS1TP0OGTdMisP8xv7FUicAv2IhA8s44H/6VudxEgFRldr91BVcoFZJyUOG0tuXen3gTijUqIuTmEjbpSjhYge7Tu7gE3HJzeRZ80futWAhEMdhld7WS5ERElVTYZ6Ioctwmq+AhX5wUjmBQINvQHDyjnWvQkpoitF7UQ8DV5QLuLWsdq3Fi2+uPCwcRrIeLDtafeZsMTQk4WVpKqq1IA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9dIGZ6EGo9M6GrFXiGDK+bYdTfLq?= =?utf-8?q?ZPcGheXDqC704KWiRKfqU3jdcOlxy3f4GSBfGFxxxxP3iavB7Dd1RmB5tZdX7Y3lq?= =?utf-8?q?SV/OxV+XvlGiVLVmWRgGF2CibXN8EAZTaBPuXcMQ7hApvnU65Ffdemhji7BVnK7q2?= =?utf-8?q?HizwbSYHThd5gcxtJ2iAjIFWrxJw2vtOHWA3XSuT5BvQMXVMCU3rLT4RWRQUNcDmO?= =?utf-8?q?daWuC4APseFEOFRXHK0nO/liZJAB+5F9ADggKf3/jl9WMPQEdysyKUAlHffOyjxtm?= =?utf-8?q?33bh9CToqY+r+eXT4AAf+4DQjUNv/KUcRzliJ7FdtKQA+3zTDY70Ju9EC/1OGjLz/?= =?utf-8?q?TzgkjpbU+r6GF7fU0MuL3CnsfkEEhqkKXLVAAu8tGKyT+wkx172IkdH5WIlNRSJRo?= =?utf-8?q?LJltWaAWZxxf1vEhLHYfXrXVXv7x6/H03bVASbcfAFGe7jN20AeelkIjhSSWGOrOu?= =?utf-8?q?MKLF080WwTphWlPzSS5K20eN2AgUrL1AAAJSRRfDiIoKWfhaVPm+vZ+4B4asj26wE?= =?utf-8?q?yYqRV4aJI9BMcBWDElTNWL6lB+g/5qb8uP35C1GVnH9BTEbVFKS8/pByFOJNMcNLi?= =?utf-8?q?p2C4F+YLDMzFL+I6aQN/+ID09BLqQ5Rja20y6GqyzRfBNiQ9c3ouIj97xh+3ctj4d?= =?utf-8?q?lCIXTNEW9sxkLjas6CFfJo2pfybsXhkkUfaWwSHQ1H1Vlv79duC9QYxXniQP85lWd?= =?utf-8?q?AZtm71j4hkNgG0syC/GYjAxk5BPlUjB21wR7YgSJXqDN/XeUQJy3s+qqv6LPbBILd?= =?utf-8?q?gkLXWetOYiNk78nsCAuiod5JjGGpDH/iVnoZUz1/f1biku+Mmp+2MFsRZcX6o04qa?= =?utf-8?q?Wf+B52VJTHaefHSQd7PHV6spLQKbfhoDJ6NT6m2H6a4vyCRLiTKlyFevdtLm9+ZHR?= =?utf-8?q?FX9Mw3HREyjmtFQ7d3Hig6lxpbD6V/73OH//9stE7B5gzDzgFBmLeaWDgZVvb/Bbz?= =?utf-8?q?WPl7bkSdMlpzVgyE5wX2BFpQ3BWeyKGWVWjv+OnMRe0oLOjzdxIsl1KZhxsebg+0D?= =?utf-8?q?Co8HdiWtL2msaj+qUFdkpDTmS1PndNiOaqWIBQ4rOJixFJ4KCVdV85c6d+sCZQest?= =?utf-8?q?17OalkCUCX866s7XHM1ectNuQ4PlSYEL9f01rvOzAXg77U9xi6kEINAesgVwMfume?= =?utf-8?q?UBydwct6jkz2LUbvcjtrJzmbG9IKbANcxdvkNCn2SFti+K9J/zZPeJTiuUOZ7+xjY?= =?utf-8?q?2PM8u/ijS6PZ4bYemvUmCt3RtkLLQvkwVNr6iemDJEK4l/9CtdbvCJQgSa6XVBYtP?= =?utf-8?q?lpdbjQ8s41+XrGBNDGtkuCfRaAO+YEsSQrjNIgTiLiVlYr2rVPvqqPDARXhVCIl0k?= =?utf-8?q?SFd4Lq7NPuex1sLQyjGgEXoGzAmLMYc/FC4Pn8NafbQHdFR48RgPnoDJnyiFk0wZ0?= =?utf-8?q?MTcJzDU7Z42w3avilUynYvDlrRaoVZhFreqg5ISsluwf7Z9hApExyG2St7FT8RaD4?= =?utf-8?q?QSsOR0zFukTfnk5BkPhLO/pmZswAdtjwtrsaw31nIMb687cfnxiq8GxaVGlI/ljsC?= =?utf-8?q?nkd2seIx2mxD?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86153627-5814-4f43-3f3c-08dbc4afc957 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:08.0670 (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: kqMOYyjMcwaetHIaYK5UC591w5YvJ8+hIqckmipMsfUgDeXyZ1TKrUYUqwrsTKnEcqnP4veTA2yVPeD8H5JHGw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: Ab4y1qwN3-iqxnxLj3whW50dLqj7HXuF X-Proofpoint-GUID: Ab4y1qwN3-iqxnxLj3whW50dLqj7HXuF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 Reviewed-by: Daniel P. Berrangé --- migration/migration-hmp-cmds.c | 6 +- migration/migration.c | 56 +++++++++++++++-- qapi/migration.json | 109 ++++++++++++++++++++++++++++++++- softmmu/vl.c | 2 +- 4 files changed, 161 insertions(+), 12 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index c115ef2d23..a2e6a5c51e 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -442,7 +442,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); } @@ -731,8 +731,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 ebe14b9c38..825bf70e7a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -472,10 +472,33 @@ 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 (has_channels) { + error_setg(errp, "'channels' argument should not be set yet."); + return; + } + + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in " + "'migrate-incoming' qmp command "); + return; + } + + if (!uri && !has_channels) { + error_setg(errp, "neither 'uri' or 'channels' argument are " + "specified in 'migrate-incoming' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; @@ -1530,7 +1553,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; @@ -1548,7 +1572,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); @@ -1584,7 +1608,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) @@ -1715,7 +1739,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) { @@ -1724,6 +1749,27 @@ 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 (has_channels) { + error_setg(errp, "'channels' argument should not be set yet."); + return; + } + + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in " + "'migrate' qmp command "); + return; + } + + if (!uri && !has_channels) { + error_setg(errp, "neither 'uri' or 'channels' argument are " + "specified 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 4e4c39a9bd..7b84c04617 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1519,6 +1519,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: # @@ -1526,6 +1554,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 @@ -1550,14 +1581,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: @@ -1568,6 +1635,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 @@ -1583,13 +1653,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 98e071e63b..99ab0d3a51 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2690,7 +2690,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 Wed Oct 4 07:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408311 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 94CF6E8FDD1 for ; Wed, 4 Oct 2023 08:01:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwn3-00057Z-Rr; Wed, 04 Oct 2023 03:59:29 -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 1qnwn2-000575-DN for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59: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 1qnwmn-0006MW-0K for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:28 -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 3943QcFf008519; Wed, 4 Oct 2023 00:59:11 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=I5bVtNtwqHFqWlEPif4/mT7sfe032SRa5RQijey0d +w=; b=O2fSMMGuJhmgfOxo3OVIJuBr8Y94acqoICyuz9mmG28U668aVhZbY2b0o pxFPxX1Bwj0AdW8C7pvSHE+pO56Dg5NnC4qYrPn6uWS5sSQ1RoLWPp5q/wkOWbfd yCNbsXHdmwOufn0U5sFdSR667jvjiF1qeNfMRfyqNTis5E/uOzNQh70kZmqBELuk U0GrA9pLlGo8AmHE7TCjWooajO6CcuJlZSJ8/5p7ido9WRS4G7a4Cb7pRKdQQxst qAnCdJGWvkzeDK7fir/5MjId3wRRGqd0SMkOK+tCg1WpwkwbEsz7t919gQexqKfu BNuDUwa8Z3YR1kFd5z9u0H72H7DAA== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2048.outbound.protection.outlook.com [104.47.74.48]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3teg0rpr8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m7t71wu1fKDjlag+j1hKBn30q8KAHT1FPCVJJBgPJWCGWju4hgJ1diQ1NI/rTGbdkl60XDschhovwKUnRwuUIdcdyIAdQeR9hRkBXJH62B8O49ChB3Txkfw0vy1zUHOX96EVz2GNRGlTQgbC2kNmzK8Hs4HD1/C8V5OZIVS35nDV9PIpH1Phu3AHRn7cREo42pg0mdcM3J9TRV2crBmz7nluKZjcksv3iesm5NOZvuCpy1OJXKrRjf5iglS6mtWKWS8nfiAITVpD/kFyQFJFTMikLVgwG0vds4iDDGzZR4JenHJsU8XlNnAnqCr51OSjp5pbd6CNU7L23TtzrgdNHA== 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=I5bVtNtwqHFqWlEPif4/mT7sfe032SRa5RQijey0d+w=; b=H6eUEhSStWFXJFwLzc8neTAh8TtFH3A52xmvG6dxsm8Xh7IWGHczRRcI+Gulue7fHFfYKFvulv3eq9BnKdJUoLHgzeqYHQYXAxlzPYAnq0Dw98mgT/tMsXy8BQtgJ3D8ti8A2fG2/zgZfY16aH8QTyXwN5tuWWU08SmTSSGQPIPW8FJU5mIBasj1suZOd93mbFrNZEY7wKZj35vm6D55ktBz9pjeKbMPSO1mBKebF5bhi7/pEIlcxaa72jT4xcjv0rnEzJKSzVww+SBcwGI7uLOphiGUa7XfANnrUjvTEZF67rSJQwnLkZ/O0gCVcvDfhGPheVkhVhamDgpTTkiwbw== 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=I5bVtNtwqHFqWlEPif4/mT7sfe032SRa5RQijey0d+w=; b=dl1BtOiH3Ff/3gnXRyBG5157XrKQFAiEV5PAS+dVWxDljZaMyNBjZ5VBOBKWA/3QtJ59RaB7AradBtF33KJTjDybosIVNvwpD1iQjOR1TLWLgjTrO2zBHXXUpaP6mTzzCpi0nvXBf3CDjRdJyAyqr2wwMJDuqAIxcy9zgBbjGlAHEcU8CV+1OsYj73UMj/kj59R6oAhR3RglEl+jWjs4Itpy76/DsAuVdewfnBM6+otdG+eM7MkvzolvtBkNQVDUVHG07PmoT8ydy2/QksUBD5HqtElRQLLdikyjeVRITduBld98p8qGlXiLgAsmwlWuul9Caqgej+3iNURkIyAz3Q== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:09 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:09 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Date: Wed, 4 Oct 2023 07:58:48 +0000 Message-Id: <20231004075851.219173-8-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: ce49a536-f24f-4ca1-2673-08dbc4afca3c 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: Mir6Fw75W8udhhizQCc2aKVD6elJT1ksgKr4aADPdr1PNitZnjFgLIDkt5ZLUyT3G3iQbKCRQg1nA/7eSNoaoJup2aGAkIh5nPqwfKdKDCUqyvZ8B0wAd6HJIhxaeTmsueGpNrzsjy2r4YBzofVhheC774x/3xranwr5WMtlp2kUA6RiL1x9ZEhP5j8E4dxftVL9B0NoMyZ0TeaqR6kiud4cDI+mHK0NLrc5zoe3UHshNC0BBZTo8nst7EmnAeLz7AbyfqbKHSVBi0RU4Mqm6isKVaeRdzrfOGtGHWvptu+i3MpTjfTiBSr712d+75AKeOXdZlkxSb6ERi4vO/dU/15egStugm8AqCvpxHF39gztzBPmLA+W8ah3stLl2SMqoZtr7+69xfcMbpZebWERY97e/30rB9iVYB6l+//QwvMfPTPXWQGldeDuclmp8GA2z/i8VmO4aQ+85A0RZzXAUVbXovoWOAQWxXdTbd5lCGkLn58Q+Y46VzGQnscEbnPfPmH56IJKygjz60g13rPfxSYAetupR6Y/7I2BMABrR9P5pvF94PWfX+oIUEE6AN3QhYhJ7SQx68sz3vvSIIaQyUYhS6KZ3SAeoO6cGqZMLUccjTNne4jgwKWeNMEOvexZ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?7ok9s0OQPNgFov7pg6Js9EhRRd6F?= =?utf-8?q?Icq4iJCBWYnSPS1lOvO3lR39kbTtj4wtEVRZkqDKfIqnGAohY3q7CPoNr/kWV7QNS?= =?utf-8?q?j+aLwLv80rbasW/QfXWPtEABhxKvKNq6ywrPyAaLd79qpaJAXdkjprtY6zjshb/N+?= =?utf-8?q?cznEW6jwVFmiejHGME+ZrZn1dgbfh5R/BU8Nyqho0457YNEkG2HmXzVhGNgJiY4u7?= =?utf-8?q?6TxSmdcQVpoSupd1uYPBy706+ntgTO+Gqs1RseMIJNtwnqx/K+RCZpGwzx57U0Rvb?= =?utf-8?q?B4oESBRwO7KrIo5V04knOAuYicx/+3axMhdb8LGijXNK1jds36pCtrJAiK1MjLfqS?= =?utf-8?q?bY/fIz4JsZgKkySPRHXmpxqTyFLtwyn+1b5GOnVCKHe9tZVs4Bug1pr7qUpAqaCJD?= =?utf-8?q?0TdnjCYeNs0TBhs4CAPCjUd9ruH4ARJ2OeSY9cStHgAasi9ySntfGeQWuj2vAwSr+?= =?utf-8?q?k3e2QExfmXnNDjFn+/jNIBkNRnJdO5gf1+pTDph0qHCj/iAhf2KdZh9YECYtn6EAF?= =?utf-8?q?twxkX4O4aEZ5hv0xgc8UIHQM0vfHquoRLgJQZI3j0b2LTacfbLGR2vASSM4fpGSvV?= =?utf-8?q?++7DDKJ1OEQkchWw05A0wVo2XZm+jJx71mr9ncvDs4UrEAuQIoZvziS53jDgk98rG?= =?utf-8?q?Tl/vFJFHQPPWAR2mwAxrrKdcRH5PxDEo6+Addx8pQTgiH4BgOnBQ+EvrUerJFVRDo?= =?utf-8?q?j84tO7JPrYaCCYXgW8GgX48stLIWmlZoQK/1rAeDo20YHpzrrsXc4uUisbCxyXa4j?= =?utf-8?q?V/yoQnGqawiu+Jmj146IC94h6Vg6qH7kPY3ikO8dIRCrwbVtTBdSIJBth9bmqMGPQ?= =?utf-8?q?wygt/pQB0mWEgxxyIBMvSAEKXEyyn24MtZbwr9O2TKf5iGcH0ZRChTAQzvFgTxeMF?= =?utf-8?q?syJ0O06rJXT6Te/beniQUUK38o3YJKoqqSrco3TLFpvFi4/C4NErvM15iozpwoMip?= =?utf-8?q?kOq1P+84xDrFpNLF2x8R8NO6eRJ9Eid53L3R4+S+5t8zX1PCaZb6fro3+dSF4IsFj?= =?utf-8?q?Zt6JAsY8cX5tsBIvHpZsLWXN4ZIF+lzRnGYM6Db0vTyMP8lM+UI2+zCaVTwvHLfjG?= =?utf-8?q?NOC42LlKzFFCn16fbDQUDMAe+9P88I3SpudCcFDPIRw1jFw884Ae4cYpxVXWmUUbN?= =?utf-8?q?gdO+8hyJmIfo2tx0qiwTOX5sHlnOX1atnsTTiQBi1N22HMb12r/NegC0aJWJ4xTkj?= =?utf-8?q?CbiSWxnX8WX0/zfbofENbxG1K7kzXh/JljjsLz1+7nFiy7xIAHug9hzsHLf8AO2n4?= =?utf-8?q?KzVvReWZn8isbHwATHYDv9BYVBTPyBOfJsskCdDr93W6B1ocxfN14INg72Y5aZypl?= =?utf-8?q?NKLQDmIkQHMPA6pWFTPUWd7EXQfhpWKeADwTrTSTrm2hxsyij7OPCbAWCyO5VEkqy?= =?utf-8?q?Q2YCJKYEshtnsOiDmkBPpHIVaqMMg2DL17U4RXT8DFdYSet8lwGjz88GBC1fdxap6?= =?utf-8?q?O5IeVtm6JnSXX7y06Tv5X162HyJ7ISEcq/KChOFClED1zDI6oPedsS1G7SfQPZytt?= =?utf-8?q?63nC7NN5HHg7?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce49a536-f24f-4ca1-2673-08dbc4afca3c X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:09.5569 (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: p4fbQqt8kENJb794cD00M/j759fVLjqT7twSiOr1nshGDvLiNY91FqP+2VkzV6sPSCcjOVrr0bZc8mmhgYD7Ng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-ORIG-GUID: dtYckEwRBbdFKysxtMwSV4PeoHbqX4G1 X-Proofpoint-GUID: dtYckEwRBbdFKysxtMwSV4PeoHbqX4G1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 825bf70e7a..6f948988ec 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -106,17 +106,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; } @@ -499,12 +502,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; } @@ -1770,12 +1773,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 Wed Oct 4 07:58:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408308 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80803E8FDD9 for ; Wed, 4 Oct 2023 08:00:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwn5-0005Bt-FC; Wed, 04 Oct 2023 03:59:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnwn3-00057Y-R6 for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:29 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qnwmo-0006Mg-TF for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:29 -0400 Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 39418rdg001163; Wed, 4 Oct 2023 00:59:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=oJ5EX9EKG0HkvFwRHhF2aiRbWcNp9jX3HMH++lQaC iQ=; b=mBa6fe5RsN8/VUsJfuMJKtZ+dsqiHfO1tF9jHvVnaypzM6HEyWhM8U/iK vGJg03w1pu2uxWj8dtxe+tTgzmxItLMhi3c8/0jvofoQhoVup+KKBtIm4TrjExsG LHq6ErHWDnL42GRHSbNk9RnVqUQtQasRN96nUa7RwfeiN6otTMjFYvdltC8duyNT TpYU1nSPdrQlJuD9nlXafN2OULFS0A1AoMtyYtJepnFvTMQ760USOdwT+h/jYKlm gerBGnRQJ/dBRIZPBBqqcBjRaezSaq6yj+/BX6VbmGDawz1dFKCXop8oW0SNOLn+ F8A2RLmrW/1/YWc/ZTeSyw4d7hTMw== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3tejrdeh9y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PnEOJOgV4caIqhTm0WZODRCgTZodlQP667xZoz55xdhdtjhvcoKUtgVd6qY3lDLbxYenf7VfzUAiMWeBktyli2Fo8XIupcDVjqrglpUnU9R/uZk4fjf9UuiOV8fbNg5zEBwpKHj6UWDnG2tu2NwE4273OUhuUVT4qujPUw/HtRJAu0PKoHej/pP0yt4jiLbjdtW1rBPlnbG0rndRA2EvkxjSg1R7DXuLp75oXsJC+cSCgSaxeMNP7kxl7IbySd/wt7Ww/sspPtDA4j7qIqTSTqI6vgDSboonczeCsjDkGnSCSjte68cDr1W/uEckRa/hBSQAiovPtrqB7+fwu46ZMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oJ5EX9EKG0HkvFwRHhF2aiRbWcNp9jX3HMH++lQaCiQ=; b=AsIvnxkHR7K354j5vmj8n0MDK555y8wuRYo4Ph1i5w5jdw83JyNeHT/Lf1DCPR2NxufO5kI2FcmE82PKPuMaH+zxhts1tiB4SbT0ywbgklz0ykmCMcJdTwHNz4NBC5uVuL2Uoxk5gnMFFDfEmuFs1eWwUymq1ZQx+u5oqh6msB+qvSDtZIbxkMfngEsN7Ln7ASjUOr4bZmF3JI/GdAVCBj67/r3y2CHZowUw+E6JSUe2ccxjofKjx508YGScvZgIG0zjH1lJqCycMQ82+0H6Mxtkq652FV8JIfCXzv5213Wm8v3a8ArcDaNtLvBEQx3OIIk4oHGs2fc9t0HnrnBmsw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oJ5EX9EKG0HkvFwRHhF2aiRbWcNp9jX3HMH++lQaCiQ=; b=mmI0xGMPApSBKzzZsa9U7sVSp3xAZPTC6gtxZgVRgM0jqqfvFNV4/UWA9AHiAPE1EnnyOiUygx9F9AUqO81fs7eCz1Ox6544dN6Uy8aclszLP+BfT+FPFPsx9a9+a8eVqSEpIr+BPTD9xnjSsIazOh0tnjbdPJHfnHRBIcvCuHVjmpzMVuF+4/4ev/yAa08GjihSlfHxeSiw9e8e6aDiAxsglIBrtcnmFdBAy5ezcIcqX30S7oUAxjcKiD/3X2YS1xcQ9D2YewpKiwC3ApAFGZMBnBRvhRtiJId7ggWbjnpeWcQPsWfp5N+z/d7zZRekTaMTwtRZsLb5hHmtrVelTA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:11 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:11 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 08/10] migration: Implement MigrateChannelList to qmp migration flow. Date: Wed, 4 Oct 2023 07:58:49 +0000 Message-Id: <20231004075851.219173-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 593a0a56-7db5-4143-e5aa-08dbc4afcb38 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jq7cCV7sPvmKJk9b983VPur9Dp0e0ycJqVxYsxp4LfeT6jBnLrEuXYWlsqttLMo1/SKWzeDiTBsMYjN7BjtStAPVvALkrSQGjb00suSlwDZEU7v+naN/eHg6/PCc60/yEXvRy4TW3b9qkCWk76tCGZ8x4T72UhtYMfafSxljy2Y6GTKwCMIqpOtwEGp4k5eAL1+lW8L9RlRgHlRHjXB7zFZfK6fZqVPvKquK6WVo+BkNpFxf/EPntxfJaKnagRrjyuyP0KtJ7aS2VMdSTAWah4+jTIl9SohGr+2dTcgLHiP6fh873mFeKeB15xt14A1spMXzO9N9dWrJeDAwVBkH2CRNlzQTjAgoi05vyqnkkGv27ikcYYhisxH7E+y1Fg8DMeNoHN1CVNcVA9qWYB/anZfZ4uB1YDWxrtBTKWHY+yNV2Nf/EWHB+2aoIHjSJrDnob1svPYmPXUr8CoBhDKjtVxz0A++uoeFulh+bIZPpy5diGCiNmO66FybuWNPYkO5fgKtfFSxFdKv9o0T3lqW+JUraFnpVFudavO9K1xf98ei98YgKdsasjgQnWw1M461/RHbLj/zHKAkK6uG5JhSdaAVtsuBHntVXi0pNypn6xa6ti+ZBGrk7KyuwC3d3MUw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IEhJDbzHkaTjFC1wCi4iEt43tawL?= =?utf-8?q?WXTL07wwu+4NT9/0sdieVuHIJX/vaTjDH4LmJiRN0mrbe0a2BUZZ/6ADNvA7u8+FN?= =?utf-8?q?UJym5ikO4UlZcWr9KqCqMoRz/b59FnLGtvyzt1jeezWxcJ0vHzuNxmbqlk3FExZjV?= =?utf-8?q?rZDkalzqA3yyjn24cwiFnzEju5Z49v0tSa2BmHVlc4S7DrGzIoHzCoclviGsAibp7?= =?utf-8?q?FdhFL4QDZ5wX8fQO1FeolJErHhOAOfk91WL1tyyf5YUb3UbcSaShhiWGseV/sOSWT?= =?utf-8?q?IR6NFx0KjjLIWx3rMN+zxfwsA1ZvSLMf2yieJuybPwSlPdOnjYU+yZzn4RlBYzVec?= =?utf-8?q?emFL7eOFxHallK2Ka81Lakt8KIXjZPEPYCyj8OPRxl/sX1bwo8Km5OSupIR/P4Jts?= =?utf-8?q?asgAB3ltSIlJ9koECbLfUzHUbUQaSIHXmXRUjGrFfgvXxReqaulbFxzocozEFQP4N?= =?utf-8?q?7EYgDK6JNgMFAeXaTvEpOTbulohfErOYUM9hKhFSoQGrBgfMdH4BtQWqnHSI6gn9+?= =?utf-8?q?w9YFIk71hdTPCuy1LtkynY5EZjfYK98NqwReqQCMltK9HwLicrPc6MiOZ0rNYq1vO?= =?utf-8?q?FcN861S+auCn/uSJ+vdnyvc8zVDeVCMiTOGh1UUXERYdP+bO1mQDT4ZePtaM9cizH?= =?utf-8?q?Uam5i4EhWwF53aNMRUj8KuRu0fQ/eRMIHH0OxKFP199sxcHxAo1DL02fkGAdSEp7b?= =?utf-8?q?NBfIYX4N8072oPQ4U0/TwFikfrbPMmJrNEajAyF7KkrsCOsw9IKnHCc4fm7K9qV8B?= =?utf-8?q?+unLGZf545o3fo/Ltq8CYdBUWqp5/WOtIqM2A7f4l9nZEntxvnXFttUEnBeSNxo5A?= =?utf-8?q?unuPS4MyEKMVV9FcF5oT5EujwHpFIzpqCxOazUME2I4NP5112xsXkU0VQUSYAH0/3?= =?utf-8?q?+OQ9A5oWixEcI3j1Es1ZEj+/u9J8dorcguRRrYnHlIrYMdkQ3lpJdtdXbD/Tsx/6i?= =?utf-8?q?N6dsvSYturgkJidVHuMtOTOkFrJbl6IQq2FKN8jCXkPFH7EBFxgUsAb1UIbAjmaex?= =?utf-8?q?rd/RUTNueLMfYjNJUuNeedNzAxhnzaJbt7G5AL5jQZIANVKV9je+fm1NSY63Xeljj?= =?utf-8?q?NelAmeBHKKMpeZS06Er5K1ZKoG+xISJB5WahaOJK6SZaAcGH9rD+Kk2RQKa+CrdFy?= =?utf-8?q?D7o0BlVk2kzN855uapA/7uQ6j1shTHim0DZrVGErW57bzTkaTC4w0QTB9WwMSrYQz?= =?utf-8?q?NWzeJW4/qW2FDXW3HKvHswNg0Jv//OV11QP/7OGeGr1goO08lhvH/mycZST38zCDE?= =?utf-8?q?qA3R+sm9iYP8RVzQssM4/AONt09T7VhPtIVGk0W25lX2a8wq/OWCJP+kZcQnNXi7X?= =?utf-8?q?orNUa4jdvlVGS9VFfXAoew3yJtvJ1378yAv761VD6/QnDO48llR6JlcrCkAiI83X0?= =?utf-8?q?xw2v2oWMBQUwLX1sBmvVNHPwsQXvVp+gQs8R00hIRn+gJf/2gn+QWJfNbPBMERwLI?= =?utf-8?q?5Vy35X92kwJltiBOVKV0Q5cXQO2GJEVbVWiGZqbTtxbLc0kaK00It7A5P2j6eaDzr?= =?utf-8?q?5N86wK79GjLN9MGUJG92cqU13ujX0Xh5GQ=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 593a0a56-7db5-4143-e5aa-08dbc4afcb38 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:11.2399 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D4HdMRM+JYsiRScraTVJSfh6p45ow8SqOff+rq0YAey+MVbzxt++kJIa1zvCxc0O1+bbP0GIpHCLXaoCC0rrbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-GUID: ZDTYD-Op4AXSZBiJPgB8hnCkxy2fg-Fj X-Proofpoint-ORIG-GUID: ZDTYD-Op4AXSZBiJPgB8hnCkxy2fg-Fj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for qmp migration. For current series, limit the size of MigrateChannelList to single element (single interface) as runtime check. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 95 +++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 6f948988ec..3eae32e616 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -432,9 +432,10 @@ void migrate_add_address(SocketAddress *address) } static bool migrate_uri_parse(const char *uri, - MigrationAddress **channel, + MigrationChannel **channel, Error **errp) { + g_autoptr(MigrationChannel) val = g_new0(MigrationChannel, 1); g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); SocketAddress *saddr = &addr->u.socket; InetSocketAddress *isock = &addr->u.rdma; @@ -471,7 +472,9 @@ static bool migrate_uri_parse(const char *uri, return false; } - *channel = addr; + val->channel_type = MIGRATION_CHANNEL_TYPE_MAIN; + val->addr = addr; + *channel = val; return true; } @@ -479,41 +482,44 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, MigrationChannelList *channels, Error **errp) { - g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); /* * Having preliminary checks for uri and channel */ - if (has_channels) { - error_setg(errp, "'channels' argument should not be set yet."); - return; - } - if (uri && has_channels) { error_setg(errp, "'uri' and 'channels' arguments are mutually " "exclusive; exactly one of the two should be present in " "'migrate-incoming' qmp command "); return; - } - - if (!uri && !has_channels) { + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel = channels->value; + } else if (uri) { + /* caller uses the old URI syntax */ + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + } else { error_setg(errp, "neither 'uri' or 'channels' argument are " "specified in 'migrate-incoming' qmp command "); return; } - - if (uri && !migrate_uri_parse(uri, &channel, errp)) { - return; - } + addr = channel->addr; /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addr, errp)) { return; } qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { - SocketAddress *saddr = &channel->u.socket; + if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &addr->u.socket; if (saddr->type == SOCKET_ADDRESS_TYPE_INET || saddr->type == SOCKET_ADDRESS_TYPE_UNIX || saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { @@ -522,11 +528,11 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, fd_start_incoming_migration(saddr->u.fd.str, errp); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_incoming_migration(&channel->u.rdma, errp); -#endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_incoming_migration(channel->u.exec.args, errp); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_incoming_migration(&addr->u.rdma, errp); + #endif + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_incoming_migration(addr->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1750,35 +1756,38 @@ void qmp_migrate(const char *uri, bool has_channels, bool resume_requested; Error *local_err = NULL; MigrationState *s = migrate_get_current(); - g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); /* * Having preliminary checks for uri and channel */ - if (has_channels) { - error_setg(errp, "'channels' argument should not be set yet."); - return; - } - if (uri && has_channels) { error_setg(errp, "'uri' and 'channels' arguments are mutually " "exclusive; exactly one of the two should be present in " "'migrate' qmp command "); return; - } - - if (!uri && !has_channels) { + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel = channels->value; + } else if (uri) { + /* caller uses the old URI syntax */ + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + } else { error_setg(errp, "neither 'uri' or 'channels' argument are " "specified in 'migrate' qmp command "); return; } - - if (!migrate_uri_parse(uri, &channel, errp)) { - return; - } + addr = channel->addr; /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addr, errp)) { return; } @@ -1795,8 +1804,8 @@ void qmp_migrate(const char *uri, bool has_channels, } } - if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { - SocketAddress *saddr = &channel->u.socket; + if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &addr->u.socket; if (saddr->type == SOCKET_ADDRESS_TYPE_INET || saddr->type == SOCKET_ADDRESS_TYPE_UNIX || saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { @@ -1805,11 +1814,11 @@ void qmp_migrate(const char *uri, bool has_channels, fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_outgoing_migration(s, &addr->u.rdma, &local_err); #endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, addr->u.exec.args, &local_err); } else { error_setg(&local_err, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); From patchwork Wed Oct 4 07:58:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408313 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 CBD31E8FDD9 for ; Wed, 4 Oct 2023 08:01:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwn2-000579-Gx; Wed, 04 Oct 2023 03:59:28 -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 1qnwn0-00056J-5Y for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:26 -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 1qnwmp-0006Mk-Ew for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:25 -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 39418rdh001163; Wed, 4 Oct 2023 00:59:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=7fBEehkfsJojQa2VLWXEwZKghhAGXkBJc/3jqgJaQ cI=; b=KmJ8MofgLBFoQeQOSqVVjI6DPrWC4amlt7U3bAf+dmQhmEnWmipE0kMYF XRvZt5+CjeOxxUZSFfswzEcTgE3Qd8hBLTqA/joczn2N/U3FcLvovThtSvHkLqgD rIny3Bu8qfEBfUYFkZZVaVlKfFz8qahbdRxAwHCifYZbrQ9BE/XBuXiljvN2XlVC dzgJhHEe5fxgMVpq3d1a+hnw8QK4v95EUqivGklvTBtUGiyTrKy4oY9qHIjagXIf tB5mNLo/Vk/iUSa68uZEMahi2YRvL94WA7kEHymequV5OEiL44mBrh0jrDxo0z6a /k8yeKpyr+UEDLP926EevJJZ7xahg== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3tejrdeh9y-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YOqUa664IeJ49a5j51/13pP0/y46ieftZzckiFHF7VLmLXFn6VOldZ23223WmzG3tUR12iVINd0yVCafLEbWH2nX3xLzSJl5k7AkhSGXlfmRxlpbFuq7iLJTUP51tS5MCI4UI6hChpdtpz+5XlDDYR56WhftTdV8SGWGQbfHCJi1kIiY0IpArmYNkJomZu0W9SBxXNpGzWoYvxDoLcFG/60QERJlXzM0e9LO2DDPlOxBEl2UKoUNOwEBlGqMDUBFEe0qZU55UmKHa5N701Mmx3d6e2LY+/N4zWpWUycvSATTIM9yObYl4TMMAzsm1GnuEEzQxxNfBYX31D8ZNsIk9A== 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=7fBEehkfsJojQa2VLWXEwZKghhAGXkBJc/3jqgJaQcI=; b=JhUD+iFaYTRC1jIYdZ1zpRyOdJOKKbrD4d+a9N4TpFlyIB47Dx/HksDo3NqJJWl///gyXJmc7SAFBYnsP6vZMQfcJS99kb0DB+rKvxdETrYCM2JMckFyPSPZZOq30BQSYMhSSrJyPrv5kz3AGSVhKruy9mZsxv+NdmyF7mDtjQX8zg31cteKnD5dmu5/uCwkyBTpStuJahotnpYHiX7KulVXqlMJ2kLVh4k47KqXaF33+7Y2ZXBax04j+riHDoeW4v3hapnm0wYlh0byAl9JwJvFv/FIa7w/hl5VL2faebLULhXa6A4nMKlElOh1LSU6eeOfI9/3a8Y9deJunyh1mQ== 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=7fBEehkfsJojQa2VLWXEwZKghhAGXkBJc/3jqgJaQcI=; b=ktdiLZc68FiS+TVuSzjQdBYvw3KBX5yCVHPOXv4CFZMXznNSyiBbnOtK7d00vEfF//nmzFitG1ku4CmobDOzFD7ye2jSOnCCHwrmhSQvCeMKRXZm4E2n30YoqA9Cn/IvwsOJfboSAIHuTWppBOdkMWBLlYnpKZl1mYNZno7dFW5KAqlUSqImW0VEaUiuh4ouUk0sBN8+JADFXpeMWtPzPp1pMzbB8kCJivtMyZxD4hRG2q3oQi3ICDwzHjX4m/Vf35KNPawfWqFs+uVoXa1eTqJM6lpT7UqhOckjE5mDnDjx/3dPR1swwUV/h6pHEC4W8Wl31iwZENVbg4L41vSTaw== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:12 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:12 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 09/10] migration: Implement MigrateChannelList to hmp migration flow. Date: Wed, 4 Oct 2023 07:58:50 +0000 Message-Id: <20231004075851.219173-10-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 60a55999-e384-4dc1-5677-08dbc4afcc27 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: dzUHI6DH4ZNhJoX0RkHqWPtEaFlB5+3UuYqXIshfiLxU0kRL+w9hTTat7sufOu7Ute4HvmMQJiJJWMjmnkW7q/OZwxAdXDZps1uzSuuhx+m9kJ3R+O3tD2C9InsT6SvK8V4NUndBHkQjJK2qJtTRwg739HQO7z0P6+a7G9YHXU6eWSA2WAbpFBfjFG2t4VNaklv+D3rWjOQGVeVk5cJhDXboSvgqaXqsRQkcZWhvsCqk/vvbhGfUf+xgLBdJBlxdoT/jvWOdHr+zBNg9zMhVQZ+wkmfsFaUaLuNmi0qsoUFYvwYnYh5r8hXjN3/2fX7E/MV0xekbuRyw32L1hgAUZ+AN7i5SirgQLgCdURtBFOKlu9G6BKdy5oeNnBCXU9J9o5G7Q/lbhDcQvDg9hRVBf4qkldt+MGC8+PdcVg4CFGO5tD4kqmEiKkKNTZpfBJdhUhTn4PA53z1e/wmBlHZ7kOWl4eisRTlJwP/YpZOBeydVqjW6EkUkhYoDDgjObHC5CYA7wLT0bPQ1Uou9lwM/EThk4+fVDmwGPQkEhIIIVuIZr5uCQDeeBEz8PYpr8wx5Ss7jG22i0BzIw0QPfX88I74MKobj13kDCTgzX0LDOB2n5uhvDC3rV+4POQLjkHblEyUHdw1+NDFtb/3zE9fTqA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(66899024)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?rLhLV477gelg0CjibfTGW5G3RkmZ?= =?utf-8?q?Gt7tLmIR5RC/+Mrsj67EE7fkHIp8iwJwuuUOtEKEGwieIfrlOtmfZ+AfvYsmm2NXm?= =?utf-8?q?eUCEF5gEv/JETfRDZC+5uM74+6WcIdEIUtvfTdqy1+XWgl3fX90RuBSsgHKuEABYN?= =?utf-8?q?VNFPhF28BC/oBJli/THbt93smD7EBNKcTYNnPek/a79k6H0umhOT508d5Jv2r2Lvu?= =?utf-8?q?wHbdGseAMCh8ySE2BBDgzoDe3bmj+WR6HyUww+DrN/Pk4Hh76+hedyNF822OFCV1O?= =?utf-8?q?wsenxoIwAvouaf2JEiQ4P7NAYX1dlaNhkDuyEkeG1eYQwjzSzqF0uxP1ynTXUXxRb?= =?utf-8?q?Zj4j5PhYCj0+waBpHivZH1ynhzaTew4jKetr798mjHgSkNqjOPZ6al38PcI5P64fD?= =?utf-8?q?9U3m9HEd5QdTxGXqRTEpMPLHfvT77LKL/1Iq9dP4vBP9aOk8tSBnENcvwcOk6kwkW?= =?utf-8?q?/fVbLCBn3qiNB3Xjgp16gxUgEd67Acii9OlaRXLlFCc1PqsFtRDqic+tzhdfe/xqB?= =?utf-8?q?xViWKZD7EmN8t5iruuGXvmmt+qpotGMfBClxTsJxUsm+5jJ/Die5vDe2w4/7Ofrhj?= =?utf-8?q?PN8rBg5o7bgiKGvtGk8ALfrcfM6hcsWYGvIgSJJI2OMAU4PoeGyzbwgMW147Lb1kD?= =?utf-8?q?oPIi/Pt6yG5XnDAF7h4jyU2Oi7tMz2ejeM1jQGWscb/dmx8QNPgFckYs+8MvSnwmJ?= =?utf-8?q?gvzPvxkmnVzMRinQ9fepIBfertUf1enrgh6TZf0iM5WcUIU5/VJYAlIbAfCzyiUHm?= =?utf-8?q?Jic+RAOUdvyfZSezGfla5tpgZLIKKMf2PEOoyIs/S1gEzh2bNTP/XT27uaF1dViRH?= =?utf-8?q?rGvj+58grYzhkBlcsFsF4k+Gyju5ilas16i8wcI8/2O7gJ5zgTIZDJ58jTis0siZL?= =?utf-8?q?PFCOOLqh5Xqxp6gA0RuR6bWf3ggBn8FosgVbnRk5D6M5FY9p25gjBC7ZujY8jLr2b?= =?utf-8?q?Xem4vy+XeL52Y4WgEsICcM051ZCm9/peo0ytYY1eP3Yxj0fWya/0L0BX5LfdNIHmS?= =?utf-8?q?3+MEO0h3uFkezxhbINqqGx9WmhaNZNXZdDxTLFf2wGPeBVG2CvUt86nm/CohWFB5R?= =?utf-8?q?7bob952fEOOnCwo0jZZf3pxRRixiPoOce6u5S+jf6ERmZfYpPV0uRE4Y/ZH2Dk37t?= =?utf-8?q?uTnXbj3CxONwqg/Osed6i0UypqUSxcUjHKbsfw33Qt9cj8pQpXAi9Jh9SmmqGC0Pf?= =?utf-8?q?PxMG+CYKNr55uTl8ytHlOs5vCANclaRUc80mo1Lh8SK+IyS614VDiZukbKmth+0qC?= =?utf-8?q?7CYA/VKJ3607dZZSt895TzAJ06b9KMvJO8QAxiqZXphsK8jAyLijuEU/+lo1inXWj?= =?utf-8?q?+W1/FCXd0VKwRKKJhvCGroH4dKjqHsnhdAm4DYzKY/Aup0iF2exeF11w7LGbQr57J?= =?utf-8?q?EzPcl/dw6jjzHJ+6fQNTVVbTxW9Yb2erooojnW55Sy+dXLUIYREZLs7bap9YMuk/+?= =?utf-8?q?ziX8HSTMda4NDFp3PhwNYB8jtR8LzA9+ybG8aBw8ZMQ+I9WtAB11qushxrXQMmQRr?= =?utf-8?q?GzRp4I7rtXwNqnRhPXs1brwPxotxgoNreA=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60a55999-e384-4dc1-5677-08dbc4afcc27 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:12.7605 (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: cR9iijSMI11FJFolYlU63dd/mFjskiaNOUW34oUz/WatNvAluLQV/jkmIk5EMRH+qu8bMwE8ITzFTMaP1pOByQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-GUID: _9TMXQfM1E26ve2hD0El4SuO1LrC6Zve X-Proofpoint-ORIG-GUID: _9TMXQfM1E26ve2hD0El4SuO1LrC6Zve X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 Reviewed-by: Daniel P. Berrangé --- migration/migration-hmp-cmds.c | 15 +++++++++++++-- migration/migration.c | 5 ++--- migration/migration.h | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index a2e6a5c51e..a1657f3d37 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -441,9 +441,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); + qmp_migrate_incoming(NULL, true, caps, &err); + qapi_free_MigrationChannelList(caps); hmp_handle_error(mon, err); } @@ -730,9 +735,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); - qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + migrate_uri_parse(uri, &channel, &err); + QAPI_LIST_PREPEND(caps, channel); + + 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 3eae32e616..7d2d5ae329 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -431,9 +431,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 972597f4de..f9127707f5 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -511,7 +511,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 Wed Oct 4 07:58:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13408304 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 E7CEEE8FDD1 for ; Wed, 4 Oct 2023 07:59:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnwn1-00056n-SK; Wed, 04 Oct 2023 03:59:27 -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 1qnwn0-00056G-4v for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:26 -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 1qnwmr-0006Ms-Lv for qemu-devel@nongnu.org; Wed, 04 Oct 2023 03:59:25 -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 393N0W4d007255; Wed, 4 Oct 2023 00:59:16 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=sdwsvwvq8PgFIGU2TYiznDLqOA5CU0N5jhQBbHIPu P8=; b=Vwb4p5HJWnQjl0MqEnDIaEWrOJsSdTMIUnMTgsKZcnEbDNBDZA1M4KBWC qrr65otVahmQgXLXIU1pJBUL6+9bRwpb2EMaFRd/cPX73sZ7HnH/x0SM0Q+KvX+E PO2bUZ1Nj01EsgxFdTPIoaq6wW49QGzI5sccO29VrF8oeyVaWTwL3lotF8KjpJlY DQYi+oyBEDxt5RqIfpaY58aeZwn1a6dGA56jEZWqY2g3kOM9vn0nMilyIRp4zWv6 F/eHPq2hKHfjiL3vMk3h8GYEUcCLcLVJlTGDMdqt24if40ZCNnhws5sK5wnTKLaF 9HoXJxIbSjDABYhYx/NfetGimFq5g== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2046.outbound.protection.outlook.com [104.47.74.46]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3tejrdeha2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Oct 2023 00:59:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=avZ6L9LgbIRR0FIyfxRpkuUtRT1/GJw791uvNNndxzEJD88qDht6jCS2lyfKbqBTuyTymfZH0E0OnLuomG4JQ3XX5ib4RtvHiyxr8FS61AWDq9k1P2ho8323HOMOmNSeV8xJzq+vcSolmrpRNcj8/TCCbk0d6xflm9VJDDBJd/ED8Y6Rh5N7kYhIUODvem79iZ0/gosUC6MEHjHW0evc6HqqqDmZ8W9p6Uf9//aneFAiXcskuRDi6QjiK+xenJNkjZDHl/Iha5mDC3e1TO4MxG5B3b8mrF6QI8YzLAPuS3sskG3kqZGVhyJT/zFnT+QNgVljM4kv25FE+EWcRs8+HA== 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=sdwsvwvq8PgFIGU2TYiznDLqOA5CU0N5jhQBbHIPuP8=; b=P+HOVYNCLMlQYoGQ/GnIgWYEO1UBnGIiyuwCUPyTMReNXRCPC/0+JCpPyzV74CdMIyhUM6FXfRTlBwdq0FSKLsx4EwjK7drfMkJ7bbcnhQG2ok0+hwdWxPVSeNfhVxOG+kcRtAFVjyZ3nbQfEjNBUAUx9GJ89NIJo9j9YqsO30e6dpUKYDjnNoNt3Ubnt57/XRBe8sqp9BJvuyeD5SyZAKvFdBipucUeJ6QuVJTfgD2mPsCcuK9CTT6Svp0qjyefPi6YN5r46OgpQ4mrN7dIryh3chn7Pr2ztkvuHvEbuCkZMnNRvIlaIrqng5vzWpZOM/Gi6FOXgOeHN6ZdW2/jqA== 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=sdwsvwvq8PgFIGU2TYiznDLqOA5CU0N5jhQBbHIPuP8=; b=or5+U+rbxC4cpu/dA3aClOl/PJi9DPIajdEt4vC04eg++cBUimM6O2hhAbeFvTpg0jdYrq+tNexk/v9ztBa1QXRvzUvT7rLFICplWZ0idV+cFQUWCPundjOBvs83lPj8khzBFQQAwGJfVbZHA9KVwU5o3PTaGPxXmU/kuv/rUAdZfixFovT/DIKG8h9zgzYZNK5htPuKtscAlVy1ke8TyCgEqXUYMS3c+Ojpivq6+QiGuJKav0vYtoJ8enxHXgLcs8ZMsQTxue8aMo9SlDp3Z7nv9WRoFwN2QBv/5TaqbQLoLPX3KIUpP9muoS/yayyuxLcC/2nMWjR+HKGzTb/N5Q== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by DM8PR02MB8294.namprd02.prod.outlook.com (2603:10b6:8:9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.33; Wed, 4 Oct 2023 07:59:14 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6838.028; Wed, 4 Oct 2023 07:59:14 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v11 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax. Date: Wed, 4 Oct 2023 07:58:51 +0000 Message-Id: <20231004075851.219173-11-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231004075851.219173-1-het.gala@nutanix.com> References: <20231004075851.219173-1-het.gala@nutanix.com> X-ClientProxiedBy: PH8PR15CA0022.namprd15.prod.outlook.com (2603:10b6:510:2d2::19) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|DM8PR02MB8294:EE_ X-MS-Office365-Filtering-Correlation-Id: 402cb357-aa72-4451-ee7f-08dbc4afcd1c 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: yW04mcVAkXVE8Tb2dPY/cS8mIi77+bcsGnv/oi+Hmhu8sHhXfP5wOYkLLYPOhpBpgbXG1X+OHNmlylOVYQfHbgjMq1x4BJoq3P+b0V0EKmQWFOk4TPIAD2itEnlpLiUxLmbBQvZ4fZhxiuuzxNmCxlgDa5xc8ARoSPD9h8kTGEkPXBrvUxCG1AW+wWTrGr8reEErJuxQYgmllCFLg36nNQnA0+93x3VNvdUo9pfQl8jBbDWN0rEIbGmnOhnC4WxAGPJSJOfbFFfiRDagSrIAyKHFpAcTgyrO6dUajG+qxjRAHgwW52BHyOXiQ4UMPfrnJID5ZOLNwhOfHYP78MgJW+KWsY1hw84UHdz7o59Qw45Q5u5gPfKRjoHeiiCkvVN3mznPcfVLtPePXSJ/wI+f34fCrG7pSM+OE/utQjGmddkDLjXkZnrfxnSTVFEAv8MQB0YFxOdO8szo3OYTPV/9JBsnwhlpaonRt0uv2YxSYq1kHVTMe+JmROxmOkoNuFBW9Xe5Ke5oqnfddXrWF3FX2vatBvH6jB98xE9/9dgnoc9OIRLnHobok8ft5fc2ffDxvf85n742LtZE789eMSf6gxmIMQVJJkMq8qLUOPdE3LmZpsgC+X21MQzBALWdBOci X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(346002)(136003)(39860400002)(396003)(366004)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(1076003)(41300700001)(107886003)(6486002)(2616005)(52116002)(6916009)(66946007)(6506007)(6512007)(316002)(44832011)(66556008)(66476007)(8676002)(4326008)(5660300002)(8936002)(26005)(478600001)(6666004)(4744005)(2906002)(83380400001)(38100700002)(36756003)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SfxifWMY8nFRqHf1kChwL7smVvhT?= =?utf-8?q?2A40OcG1KUYl3UJwJfTv99nceRn8INzatKk+f/TrZPiTpaFeenlS7cPz8Dvcwd++p?= =?utf-8?q?S1SjIY5DUG75ZObxpvec4hWKJQX5SNKCVn69BE2JAy9Bph98zbo0L0q4cvb+Nx1RD?= =?utf-8?q?Yze5Irt3YVECx67jd1KkdYThBcceTgv1rZ64lrevYsJmafUSoyEbPP/UzRyW2xzQd?= =?utf-8?q?Bi+OZRQR+oo1UhQTgX9VsXprcWu51rqF0D7LWmIAp9AUo9mMRdL3ZD2uZTmJE0BCk?= =?utf-8?q?4V+mf0LcvDPLbzULkvXUG6fD9MZ3bMIX+iYSQIvpTwOcXpIVcgjXepeu2y1+Wc/mE?= =?utf-8?q?lblyhTjYRycBPGOz9XVjIEyaD1uorBDxOhEAxbvADbuSFUfn46ns7XUm2yqaMTPp5?= =?utf-8?q?UYG/YzmlUQtIqTJcy4L31hoThbPJs+fdUWzq7Y8cc2b+re/czYOsJzXBJZ6sf02hK?= =?utf-8?q?gts+pjQbB77gSxD8s1+Mj0UHWzMBohpdRS/CjFWvNkBy9GEnXeuM+ji7zh7lsxG9K?= =?utf-8?q?C3DEIapgCAGDKXrhFA+jANX+HxbolAFueNUFRVFmDLcmDFq0E3ivDq6GPmtdOOsxz?= =?utf-8?q?xicYCP0L8QjPlkuJefl7qaRqEFJMmx7ZbcHA7ITBQZun7+GwNP58A3CzzpGSCC985?= =?utf-8?q?mVH6R8QWfRpBE4NYNNpXFnOwc5b/LjY0ErKB7Itv5r+tOWc3t53u8M0lo0V2t9buM?= =?utf-8?q?5YIYDG+WrebTd5tFvJLxR8sjqTQiJoBxRBCYQ+7kNziYHH8c1jCBoQbwEvtTY0DFy?= =?utf-8?q?q7Kq355u2g7aI5z0h3vEslNJdCHkduVpYOUcFJLskRdbsVWkYeeaZqZ/lbsCY/R7U?= =?utf-8?q?U8GyBaJDCOzFHvNzD2Y06libAChQlzgIv7H4rsZ+nYgzbG6khNxAQXe0k7l4A7Y7a?= =?utf-8?q?mK1wk5S+g4/3SMjQRrQEBG2NIQnzJ06efTV6gnaJ7tg+aVTgWEjh5I1tBPTc2S1+4?= =?utf-8?q?3/bOOWFtxpn73DurIfdhbt8oXex0kGHRSihK7bDFRqk9iouQbNcPqZ2MPbDfS2+tk?= =?utf-8?q?8+6CmoM1n+OdK28BiWTRO4xOkO3F0lAnexRtqklBEpmbjOnLV7uatLRc45NnZN26x?= =?utf-8?q?oR3zQFzAWeP3hepwtjlgsQwWg1RcYd8DqIVFdmqQPLMU1Lzn5tSSSbWdAivbQfbns?= =?utf-8?q?Iz+A8ATv/stX2chzZWcQnoZ+oNQQy1Vs0B6MAa0EGyaK8LvJRojaJ/8m04V2g1r0K?= =?utf-8?q?DRZD7ZJu0te1IpkmPIZC4vhTCJAh93TO6dJ5vlDNs+iQQYxF9OG4n+aYhb6ldNOcw?= =?utf-8?q?vmcgsaX7SqPqYk0UJP3zD+wN/AIj+3a6mcNohREcZ1oYm+UIm7/4P4eg4rd3hnjBg?= =?utf-8?q?f0Dslj2CWYnfcp62YnUWFELBkwtWcibbhDr4p28zRmZ9pJBVsDm2uK9791Q6Fqpkg?= =?utf-8?q?Lro5FMiSQQ9gm3GtNao0MSyFRBQCtdmkrTi5ozoHPzRLZorrLxurppPWZMgO204NQ?= =?utf-8?q?rzX5m79CUHI6n5lc+BXpROmFePgxwo/kJTPpCnmBih7+0SVfMdHqS4ewLmClhX9HF?= =?utf-8?q?Tanvwd/TxrBfb+f3Ndh6sMIK8fSXRUF1ag=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 402cb357-aa72-4451-ee7f-08dbc4afcd1c X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 07:59:14.4100 (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: Mqe6BM8EB1DLmoMMa1OOdZtLyIc/NI/qF16nqg/MMBLvVp+FF+afl/NhNsj2SPqUFm+A11QqR0wbifFr45OS8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB8294 X-Proofpoint-GUID: 88etrBOE_zbsFe9EeVAH3Gt3N6qQ3NkY X-Proofpoint-ORIG-GUID: 88etrBOE_zbsFe9EeVAH3Gt3N6qQ3NkY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_01,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 46f1c275a2..246cab6451 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2205,7 +2205,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; }