From patchwork Mon Oct 9 14:36:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413833 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 88522E95A91 for ; Mon, 9 Oct 2023 14:37:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNS-0003QI-3U; Mon, 09 Oct 2023 10:36:58 -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 1qprNO-0003HR-QH for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:54 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qprN9-00033M-Ng for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:54 -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 399DB8Lj008843; Mon, 9 Oct 2023 07:36:38 -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=lX4OlqmFUZARAFCZsr6Xmct7xiZc4CcjBzU8UYJB0abOpFchY6t9CI7Re x28YSvcAGR1LKJ4hqgjVj4tDrDJ4R2yK9zZVniy3PBxQtJ/zf7ROQBfJHVNUrUKt 6zEM/VM8+0eGGuCuK81G2FT67UQWPntIVnNwgfTEt/f0IA/EvPgvkKmchn6eoVXe evLpokOH0CwHsIyFai4T5s82mcl0mGkzbNic0cMxSquLNmXYq+Qc+47+mEOw1Zyv MdOFezCmaXiYGwzRFd7CFnckDNc7+lpTcEdRpiRi6Qp9tyqbXWvnp7DcCnudr81e cKfiQu5kGktfvYnIIX0+tJjJzakyg== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhtbtt3m-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YqYganDIDFzctMWbD9c1l/B4mlFlezkat1P+NOrRbX7l30MJhaNy39wGYSOlUmXs0ttDOGhK0Sq8Awuu08nFGRDcnc80ZcCfn08w5KYsT78nqokXdOhzdLZZoJHPmLJvIzOyAT4C/VnR6k6k6xXOklAxfYB2ckHBOYPll9rUubwnIZeRxtplwbpBD9bsaPK3kiqTB3tShZZPn7PQdtFUIl5kt7go+b7bCARlIIwlQz25jvyjenCd5oUedgNb1FmBSSzrex4Dp/bUtE3j2usFQXoziRAidKA5spnn6q9ceqL4YKZ8w+JJ8j3tGNLzLX0AwqofSc3/mb9Lny8B8q0e4Q== 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=iXVX4yf17pWdcPDcjNzmbPb3ZKG9AuUg9EoYRW/VNV5w84TzKwq9A4urG1C3PZ1ay75+ikjLnD1bAYsKax0E/NC5oGl0Eb8vgvUYU4cruoOgDnyCfMAG2a0JZQhQFtzppB80dc0vPTvsy11ay2QLSGKljlu+QGhRQz+LnRHDjSk4fWQMHCKTDPvmVVME/WE5nqor7QyXnfMC9MUOGIk21QCKaE4WtJYaTWI5h9c8NCKS6jQBXZFuHdBjFbvcAwFN0IowjCLLsL6Kwz491DMganzy/rEm/mT/32vfSbwWp5oJLURd8YlWUccDb4NpzZqqwoSLTmlRkL2am5m3f2CJ8Q== 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=I05YfBChjOmy59L9rl/fsiAUXSCqTOXfvIWfj/MDO0hwhChzWCbZFiKDDargCOYZfnajOZWjPbJo8rUxPdSNFWT3OAbhNHQoztVaaaQ66COxvI4To4O20P+bvCiZWhuZH2Wn3Jp5cSzPFT8Xccal2Rkqw42Md/5PhZQB2FRzukf9nhAZkpcqSLOIb11DPpKSyo5AoyRGNXD3eqGujcgoIzQ0rsRk4vi7iTzmtqNfFihrYtBOr0InCIIq9kbs8k7cIWGsNw0VaUEt//eNURNbFpXjvWMA/AVnqrAgDn7cTF+bdY/OfWgcLBL9uo5SAC+wN30NDMtAQMl57UV3FgIO1A== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:36:29 +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.6863.032; Mon, 9 Oct 2023 14:36:29 +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 v12 01/10] migration: New QAPI type 'MigrateAddress' Date: Mon, 9 Oct 2023 14:36:06 +0000 Message-Id: <20231009143615.86825-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 0646728a-3579-4e0b-e429-08dbc8d5202e 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: DCnYbOU343yKQ/NkWNEfuuGchrtRuxbWfwF3quJAaM5RqqMnfV2RQZoTIF+NUpoBymXfGKgTF2+dIZ2hHpgs3H9fhfzHKlo8gw2dZhejFzSXdjlm0biPPgoNiPjvTjI36wrO/CXEF/VPkqUD6DfXclF0Owm1Jgm0g0A7utg5zIqqw1Pi4DhhdW7ysx2kr/6J+PLyJKYU111OvJiOvMYbMb/znetwAiD+sbB/7sP9KowFCopdWVDTDVbBd2mvslOQEoliJ/uny1kyR+ffqA53IyrqZMrBZjwVISQ2MbzdrOeoACo/nUGI7s65v0Anvdl7fqHQUXlJ32AuFm5eBFAy5yhBb08LChF40pv6yRlHHad6Le9xkVQ/gtMa/PrD66yRd0URX/c0wjoQfLv6ulkNWTsGp1L6WOXEVKeOSQ8LT//oRQ4YO6LVxXQCMjhkTrS4QYo9MZ6JiIZOud+YooJ3GkNYyT1Mul6JbtI+EwiN6u+tD10+9sU8XFzML5m+WrcYPOIzhYfht0FD/gpB+gPtxzoFvJprMeCqQui315PbaVR/MWxchWZLDpitExw52vcTit5WnbzaEQZwVDXRO7wYaD9+LZTqdTwUSZ5pctNXIqdkYfDa3Sm+Nbo1Ufjml6ZP 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(66899024)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?B6OtN9Cx6ffyZCZHw+x0quUZoXNG?= =?utf-8?q?Yho++xpuNxTP9mjYpjOe18vfJXDO32OxHH1ydstUYVz9FSoitFRwf0INCpKtLGsmo?= =?utf-8?q?VYw+M++QZtyUpProlIBtssKdaDz2RtA5fi6//ZQRxkJn0amuy/RpJrUWulmtao8G7?= =?utf-8?q?jizxycLJ3bkUIwjoDLfeskfxSkQbh94//24Vt9TspUjzoM5DJDktJMxfL40G8Euk0?= =?utf-8?q?PS5HwBIGlqubX7kRze4Vuc/XR9liC+DJnwJwwclp9bIRm8SP3vVOlKx4GaKEvJ6sc?= =?utf-8?q?0WhUiBsfFa5jjeExdgZm6cE5qrX3jHEYtds3an/aGTWOnEA4m1dAIAcLuingog/Y5?= =?utf-8?q?WZODNxBiavMKOWGaUVYNFlKo3d1Ilr5g5HUw0vpSn2dm9A1pn5vNF7Hm1Gij+r76G?= =?utf-8?q?8YzJ0C8ChpHptyuyf6dfQacaH7YkH4sZTNCZDMnVRmKNBB3fgg88L0rdM630uTw4W?= =?utf-8?q?GuHAPgvzOudm8t+ordcXgVeVkD4ojMSmLE7KXtmOXertsOVz3S14QWECwWlnFNXUo?= =?utf-8?q?AcGefyWN17pb3BTzm9+8FAigE6qVyi74KxgaOeQUj7ZhAiGx4I6MhxxyVhMwYla8A?= =?utf-8?q?57IJENwgKSoPUgfeCAeebDosk/EEkCYrdQ6tYaf4JlrpTwo5h7bpUTb3K3dgpKn6Z?= =?utf-8?q?3tF1531UxK1UYzt2GAsk7gNyjyGMIbzC5nT6C+XoCMzVaGU03yq/Yv7Skf+PYp9Ff?= =?utf-8?q?/NWNpdNMkM1Vckx9wRGHph0Ghc6ck4cWxiaIY8nfqbetfC6OWUnj1r0+lSMnZlOEU?= =?utf-8?q?YI53y9VfU2KpSimZMQ/hl7QriXrB8kcjRhG2xP01AMzo2A6NiPtUQqbEYBKHq3YbZ?= =?utf-8?q?KYN4lnn+RjcJTSgXznYrR5D5zTlAAQOeFL323ddGW20SGHLOX7944nyWOt79/J1xZ?= =?utf-8?q?CpYuKSYCksPbqc8FkbrC42Vd75cwWjusREXBagl31E+T9qSEerBRSmvhRTDl4xffU?= =?utf-8?q?8bTIwKWRmr0RWuF54B1k8zFr5pL29oVKD3kXsSFBhIkqSi8NZtnStQSoCJVLVrCK5?= =?utf-8?q?i0wE3rzO1nPdF+3VR3E/APdK5DweZhgeby1aN9cLJ9KXskcx/8ZdK15NieKAm0COn?= =?utf-8?q?ds6yA9W3SVq7VCGiASOllADNRM5LcI0QAlIzWgx6RkxKEaBzjieNdFyYZO3yaEbpm?= =?utf-8?q?5M0RjMd9zxnXBla4Y32wMn7hdjX9rNcufHakfEBzHi43yA83QcpU63VwaH8z3yEyh?= =?utf-8?q?iGCs6Yr6vlqCPtTZlJ25GDQscilUrzOGtWZMFmzrxVtZitTgZrJYD2ojjJ6IE8GCw?= =?utf-8?q?hmoKkTwNu/zDLNn8zcDt7R0KmtL63gYCx+Ze1WbvyJ3G7VwhlqTe7fD5mCv9NYy88?= =?utf-8?q?Qp5gQmnI26DTr66F4xvBclGMd1frVvs2eV6gzETpKHjcZJGNh3YKSDl7LR0pWHD5P?= =?utf-8?q?0G6aql16uX0vu8LbgjurS1HyyYmqBw4+EIDLa024ZHuBzSfMbeP5VaWtGga3vddof?= =?utf-8?q?ySOe5Qu+K0CeuM9h0E8dhQEsX8h/5ONZIUsydVOQrlvGrWFAppL5JConvDElmtxnj?= =?utf-8?q?LBPIZJfB55wQ?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0646728a-3579-4e0b-e429-08dbc8d5202e X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:29.7999 (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: BlonAyVg9G1BYMQJF+4tAzeIaCqT6gD1QFhFPyPDffW5dqqwTu4GT8K0PuFysA9Ah1fBolkwrlSZfQDP7NFS6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-GUID: GaNs1nvG0jWSZ04eBLlR486ms0vOnVEY X-Proofpoint-ORIG-GUID: GaNs1nvG0jWSZ04eBLlR486ms0vOnVEY 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-09_12,2023-10-09_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, 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 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 Mon Oct 9 14:36:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413836 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 BCDE4E95A95 for ; Mon, 9 Oct 2023 14:38:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNS-0003S9-FI; Mon, 09 Oct 2023 10:36:58 -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 1qprNP-0003IS-Ol for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:56 -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 1qprND-00033T-LT for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:52 -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 399DB8Ll008843; Mon, 9 Oct 2023 07:36:39 -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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=VENpbSfQammIpGTwojJEVr1BWe+P+5Phz2sU5bf8L is=; b=H7iLe/ePdoRfeB7UCgSVyVJYvgWw6qAHfv8j2sjq6zY+na703rErytvkc M/e3LvylhLkXsvWfoWHs1DgGCuD8sk7saCf4Va2iiMBwBVvJTHXwrp/fjDdlX/f4 YZz5s2/6ffkR9tcWHEINgi2GztcM0+RyklVo+Qlj+laDWvLvt9TFWTUKG70CXxl/ BYeBLvEGd84kJiVHL4Nb73hisDweYXFnzaZoMNAZFjqVvRzsu+wf4vLkQS8BE/0r Cw6wDgS24RnkLvYrl92fMBjubHRYti7xZiCnuBDvjkBmvI50CnVkdwXnKSXXkfzX XATe3fWE0mZr7rktcczaC8yYwpl2g== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhtbtt3m-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7Ewn9QHUoe/zzeB1JYvwjEoiWJt1xvI+XX1BT1gBVwh1NzB2smUsrBb91A+tx4amelMe8nMTi7LcmVD6nOhsP+kUNHTZmDV1Yzt3oC1jNNM++kKsZSQk9djsAB51hAdrPe3qJeVqUsWJRXeZSRoDMN3uCQkXDEUi59nUXQZ8CeY7U97j3mWLtFrgw2VVN2IMwg0R+u/oLneyJGn/2QGrOlHOmB3kA3/i8FOUwJ/UhN38HTtDliLEvPpqjeIX5i0TpAZVfYrEK7AJOMapT4fBymyxvo7coqIjNX+vrrow6f+KxAK8TzeT3sVl1ao/54tTVmrXTMoQlOa6lZDvuyseg== 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=VENpbSfQammIpGTwojJEVr1BWe+P+5Phz2sU5bf8Lis=; b=NbzVk1/BfE1ONIb7icny+LpPySgLrqYLABDtxNFEtMftR51Oeskq9F3NLPBphaQwdu3jLFYPKsYV6mCG4raubtjQSW8yLBR7ApKNHtLYuux2BAbNiCTGJzCZyvJcnh2uvzcvx/gloQqAqNCwVMFQX6Iy9p3JFCIkY55YZQDcXbW+t9n03eCtDlaQ6EnlNfBp2F9HQB15EUlm8wC0MjMOhnAK0AeYaww/aPhXgh19yDQE5+jAetfLDZ6LO2FuhqYcwo6gQp16NB5fb82NOhjmqkvQP+taXZwK2nf9HGVhNQJs4QnAII+m1urrd3/EpbvvfBjG4U5UWnUsewmMQsOMwg== 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=VENpbSfQammIpGTwojJEVr1BWe+P+5Phz2sU5bf8Lis=; b=ZXjMo9cvhb97E+Cb6XqMKTdUg7ostJq8vjEqIYQumqHJXWI4gKfk0Rk2oOknqjf7BYfVN1bTOnIagO2vGxPbSz5j0DUouNQCI5fKeW5cW95BL5xQ1N37iQVu9dUddij2Pk//2mjdSPmb8qxD683ELjZsAJmrzezevpSn6OXnG9XoFrBZkiYV8dNUo6TyO1NaXzQ0zU0oiLyTQ9Nh6At/k8OUGfSiX7MggbrFiXgr1OYpld/BQ+kmmHMkmUfi+IwbyObkLDCl+NzB1XuQErpBP21m6rpItDb5XlIY1rcqtENmHY6ou1WYpJJP+xbAfQitDPuFykGey0NJyv0h9gbbrA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:36:32 +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.6863.032; Mon, 9 Oct 2023 14:36:32 +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 v12 02/10] migration: convert migration 'uri' into 'MigrateAddress' Date: Mon, 9 Oct 2023 14:36:07 +0000 Message-Id: <20231009143615.86825-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 429bfe30-b5b7-4684-2a08-08dbc8d52192 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: HFCQKwOmjm88GHlW/59hh+Y28CgCsu0r/wuvM8cvtUP2X4thK/9fkmN5E4yMfHNFErBeLYO+0tvJKXVp5Alneui+EZXCAJH0fllaXlZcHVR2I4jCfJKF8l/H5vw3SIOnZF5J4iub1utMh+9cIYPWfOLqycu0pcJc6cIOC/CiYOMlCuw4TYkA7KmP+xe3i6glvB0yeWjhJoJcV6bZXGBQMG4/7mh8yvlwDzp76uPP/N6wSVl8OJ1QG5YWzAbnrLFS4TKoL4PxTiF/BAuE7aPk7G3wDaoQ52TghFN8gt1Fe/Jp6VM8bh07VkKGwjGWD6W2NnBS9geAY+r7nE35HrR9XoIQF6LuwaoBbZMTSoCqi9qpF0DVJeJ/56TDZvYm18vGjgPqOjuQnQsttr/a+DbjpAt99UzRSX8JGZgZQljPyRAKCOFR6dj2Ih3WJsYvgby5EiI4eLtwxEww5OXz1YkRxltHiQJtY6y0HNfjXheE/Yd+l618PjK8gl0guVfIVt/AzjUD430LHeGnCtrM0RELGfcignFbNhz0lSrkk8u4AkAu+KOJ/R72QW90CPyhgqNX3EUIw+0IZcKIXdrMqre//CN/XmjgDGze/q6n7PGuk2J6LnBpJp/5KvskqDZKo9Cd 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(83380400001)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SVTyfH1KdUZtS5OxtsSgqtl3RKdoeti7ANRAMTM2w4XwHl8mxQFOd5fQio7u5ZCtz6M9Crtzoyt19gQIKBLbbIKuMvtaiKWAC9gDPer7N3+awwutEr5oF6+hlpzaJMviLp5wPaZC2VjP441KQzloyDstx3ToyaexcnUOKIxA2CiExVNfGff2tNnFqTovUzB6F8HD9aSJoPaYLVyLpPGS7AB1TOLF1byGmmsPyAJQfhxJ4iFWn0k0Ai7Z5gVdv/iagZlA6M6+XTYM7THKd9R7xMl6olS5epHnKSXBSnaqcetpG6PvuISIO43E3/HtnUegYD3J4HyMjvb3Q4FW+O6Ct4OBahtWYJrP57RrmPbSqQPVelU9H3Ya3PoB8+8Xj4fj3eHPrTVaM6pcbvKf5ZOIMamkSX/F+LCVOvtylBCkjZq92WrhbI/AVxK/QYLK6BpzmQDUxZNrJVSmdTsxtB2seSh+e+d7rGGrU7xUOBqO5y3K23RVyE2Z6bqULHRTo1SAjKmsNSECPo+WD8OHqCZBxOYlJGuErAfbk58DCnEoxt1hScwT1WqjIXaz8NGRPRVBkEgj4acSQelsmjJ4PfxpKtNWjePZTZpTpF4ZFhnYMM1jcWsB16uUPeRLTSJNOQJpO6MPz2lX6A3k2d4zSMAJD5UsHaNZtGueVVZ7nred+PKxXHUKvWO3UqPCYY5RFW7huiwsPdeKeapxEKp+VwcZ2h46xOhJaJgEvpZcIKL6jVOLUTI7gu015n5FLtsfQAv3m2zEH9qvZLq/55PAl+CMSqkf+B6+9luNPsyt9WcP9NuaZhm9F5Y6IHOdiZ3k0JpCSlRuEUlwiZOhBmzVwc0Yih1VG5O9kadw/610emRVxCAfsmC/Rf6V9DfSHH218Ty7sqZ7TDQWY0U72N0TfHzhnvMQ/C78TyKQWu0LzSY/fTs75H4eOekg0708LPW+3vkJ/FuenFDRpHOvKiKghep+vVXWO0Mqxw4uDI11g3FOjlamMR9+Z0ib6S9AScqNQkvuHLDN3vDRPnEq0lSwNYsydew2irj8JEaqkQALqTq03O3YK53iqkWfr7cWgF00Np40gtQCFI5o2hILdslQy5UxTlXsvEh05aZlNRDFqmaWZ3pSbNZVuqn36qghzWe5H4MK8T3luRfi3nXQ0KQOIWnoeNrj5GqKZ2nLh9vs0cUAqLCf5oFW+NtVZnwuvsKWnzuobqxJXpbZhJOkJIccgFycDKQjqD1q1+/b5v+t5zQNo0k5PIj3mJtX3FowCva8gVxJfxkvzxsXZyUNmc4csPMoylLNxlBkMOAuFuISmiAJyuNfRDpltQSBK+5heOzbdLoWZZJNCtSThlGIae2jecADaLCnmef9zD5RTe5w/FkrSLn2VA4LO2XNnP4/IqJ67Y9J+awvThNiEazQ4Fm4GrpzLqC0WGeUw2+22Ur9/ewH08F0g7fgc2flwQlij52DaiHDuOmw1BV+eakurjIMsUEQaK42n+lNucJ7BQPsL1Mv6BAcK5QPavTKhqyWqT02YzzTzqUa7O78XvIKCoyldx9NSQwhsvFH31mfRFh+aOwrHzscZZSwrfMCOAx9qq7+Dj+j X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 429bfe30-b5b7-4684-2a08-08dbc8d52192 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:32.1192 (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: /j1TAPMSoXV0BnLcF0zm75Zf0IHguQRhipbtEPpZx6vfbVeoQ5slefTshcsvTQC/WWs5sZfQciUsVRMLzur/TA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-GUID: oKrsl-y2d7ho-B1JPqxVpkA_SvYNHSzQ X-Proofpoint-ORIG-GUID: oKrsl-y2d7ho-B1JPqxVpkA_SvYNHSzQ 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-09_12,2023-10-09_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 --- migration/exec.c | 1 - migration/exec.h | 4 ++++ migration/migration.c | 56 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 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 585d3c8f55..89fa074e8c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -66,6 +66,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); @@ -428,15 +429,65 @@ 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 = NULL; + 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) { + return false; + } + addr->u.socket.type = saddr->type; + addr->u.socket.u = saddr->u; + } else { + error_setg(errp, "unknown migration protocol: %s", uri); + return false; + } + + *channel = g_steal_pointer(&addr); + return true; +} + static void qemu_start_incoming_migration(const char *uri, Error **errp) { const char *p = NULL; + g_autoptr(MigrationAddress) channel = NULL; /* 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) || @@ -1674,12 +1725,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 = NULL; /* 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 Mon Oct 9 14:36:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413831 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 94B60E95A91 for ; Mon, 9 Oct 2023 14:37:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNS-0003R5-Eq; Mon, 09 Oct 2023 10:36:58 -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 1qprNO-0003HQ-PA for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:54 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qprNE-00033X-Qa for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:53 -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 399DB8Lm008843; Mon, 9 Oct 2023 07:36:40 -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=8f91rP2Bu87ExwoL/rgre/SedVUjER2L6plSwKyqi 58=; b=csjO4uFu/FuBYg9KHey1y8zsoEE1+G5V2kSTuDJZERhXDUmFnfVKV1U97 bCYqntCdDff2u5mxNKY7ESSAqiRSFCGAKr/HVeLv2EJaBGfX06Od/6hLug3Bqq16 onETLWRbKOGfvM2NNIMS8CeMvZMn8OHNPYEGSmC/rEfumms8U290mzsWbmbau4c5 Sb15k/d+Xv9ZYsgEp890q6HKOHJD0j1mne9LMXKrPirlYoHsFCtL+Y/u19Tu+DSj iyoqfS5FvNxpaOHBzGCDrSrdycLRkLfb/Ed5M0VZLOMg7w1XxPIoyUYoZIBftkft 28g3lAryDDd4J8Sbs38j8xcylXGXA== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhtbtt3m-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hu6z3znLOhNfZtvHQKdMhFWalfjv2gS/gJEFp2XcbSfwGOwdjmxvLEE/F7mX2vdOC8DRUS+Hmn5l8ghMsyQA2K/cLuR6dXRJSZ+OLz3zWivBdQ25bAFTHDjpkx3yVDn1iNSm51SxMYGid3rrOJ9lsWaiKnGhTZiIDSUWLoIp2fAPdvKTESTpvZa3kdawbqMd+ppfmSGc6uMCZiwUvj9EW51qGbfkMnMNNkUqGVp89hnQaXKjswoeZK8/NCl/NsRuo3IJjIsWs0ncMYYIlxw5RWCKoBEKmRmTkR6cklE6oH0aej0ka6wHc+C4ryQIvK+1DfpJ/CD5+GYAlsf965MYkg== 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=8f91rP2Bu87ExwoL/rgre/SedVUjER2L6plSwKyqi58=; b=K4Lv0tI0CmcM1h/gcJnKMQEOC6CiX4B02T2KYHOfCSWl33vfUd3BiVJO5jfYzxTk9uyBXzpTODMJBTFGIhZhXGGrJMnddJL3MgRBzxmWC6ZcWLNoqCWkyTZfJvGa9Ljt3bFDX4AhKoExEVzcXdRxQqS/cjpfCfkiTSAHMHWnA4Ix/UgQUCXE1LkSjPAkVE1rWL3t+8HdhVGb0aR+RdNC0IV7/Z1LUTgne8WZmKGgcEkzhlmVgy3R/8HIaFOZFl+lbTfy4Sw7ZvgSojeLNlDzxNciTcra65lrTgm6v9n0kUwNlGObtBByMfUbfbukEaM6ZLtwOykz8S+88AjLGGjWZg== 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=8f91rP2Bu87ExwoL/rgre/SedVUjER2L6plSwKyqi58=; b=fSUC1tAUbG18dyFaSxUOYowlRhDTKoa7k7CTCeRL2I0iPgKEJzRlOLPRIyF//tak0XneZQ4bPYKzdRV5y1snVKs+o/gGB91amiz997aLPCaxVLc7R0ZBhhBvIawFgMskO/1LdEZOH7K96R7rp0xjPUueM2khfnZAu7rB+hZAqEMvOJbrZk7GwU0t/n+vsGkFxVeozZV6KNaJvIVwVXwnIy+svhnHJKkdCPZz1iBYaU6WgpBQA349AjGgwjKOtiaHbM0kSJL/pE2ATbc5so9T09HGWLY6hDWLGBCNE5PoOVclREa9s/8WuVivI646hYojmeNJy7KYsafuE/fl8zzamA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:36:36 +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.6863.032; Mon, 9 Oct 2023 14:36:35 +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 v12 03/10] migration: convert socket backend to accept MigrateAddress Date: Mon, 9 Oct 2023 14:36:08 +0000 Message-Id: <20231009143615.86825-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 749ba89d-b7b9-4fb2-080c-08dbc8d523cc 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: VSxKVe6z+q7ZUHnPjJzgYsWgRGpO9M07gF+zFpp+PSEydXToXQYS37JAb1ahzxzFNE+Q3E5qZjK1sGK6VQrioqznPT2evee6BQoWCL7W8EvW9ldyJS00ejt7RyEMSRGz+AlDhlCMPb9xz5tQ5NHXE/NnHv8sm6UvnCD83qkFDEa7K8do+m77Qbz+DmG82r91RVb2Q/yU/mQAj5gKknP12qEq7BOOKn2us+6Z1AWydqeq3dGyzEmE0nJ90bO3MUgUpaJEslZ00oUwN4XAr0eGTCnGwZVt0P0vyZ2fXsohHKM9y0B/WbGxkVE+2iMy8cO2SvoJC1bXKzvaYDENF0xUCQwEj8SU7JHJNjG8nAiwcYlLhmyAZqUgDwP/ZTzmiHBUoNn09ttlOkmAdNIlbYWnnppGLHu/m/LqmT46DMz/SboRw8sP4EO+7lfoxn5xRgO843hbJOwI6ZWDOs0q2HB35BndK9Flgonr76EfVNr1nEhOkguRozdZ06sX4KEilebTVcVRdlrUqL9KnW1PyvL40eVT5FKIpBODmJrDI8bBx5rMiJ3EY1f//MLLMngCIftT3f8CQ7yyefGK040ijtavJwdLO2Hm2+c8f5pXuVEiRuKbCEU3KIJPNekNR1PRpvgk 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(83380400001)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?+sWoTxbjy2B+bDE2CEZh0e7Jmgqk?= =?utf-8?q?52bYDGbfDtA6QCB8Ak99YUXQAxNek0wTkfJt5Kn3Bx6yNH/DP2SlHKFXPFRh/H8/U?= =?utf-8?q?/8StBZEUMzlKKMIRaTqsbuNbPdotQ4HF9HSmL+HGsmYAKx9ZLlOh1x0zZide5RTy5?= =?utf-8?q?KWzOxf4qhpRu8ZkYlYUqRmcAI3WDgG3WcplZTU7/J01m/M3Fch7vTtKPbqRjbRzti?= =?utf-8?q?L7VnMiOLVB4rfigWNbl/VYB7gimeAWPjAlJiqRjgHZndlJtZYGJFVF+kRiQiM6mWh?= =?utf-8?q?a8LXn26ZR6R5ugwEW0E/4/Z/AjDzJPbXvxM0mfbKWBRvbYLDAlxmBqHNL5GDyU2oR?= =?utf-8?q?N4h3TxiuaAR7sPk1iA+9e3rnHU9LtegE7W8OXlGFLPzvxc9P9kBw+HyF1bILveMiJ?= =?utf-8?q?2X3z63WuZuPCIJELLsxdxtDs/c7XXCOxKyjO8HYmpYE8YTVDOoE8S1ouCTx5/PcNX?= =?utf-8?q?lCT7/7N76Ybxb2jNfBf+JwMmoZvyUgOev4mJ6ucUGyHaY/CcDwHTUzhDzOH0jOjJ0?= =?utf-8?q?12T7QptI23c/jaqZjZQq0F9037m6020GNcvxIV8SA+AnW7IV0UQQCqXzHWeU3qE3n?= =?utf-8?q?5pUCd5BPTTLFcjUprRbrzcL8RVhuUsMZh9ZJQXA7ZzuRyi0SkeKHtvqx4PUXA22rR?= =?utf-8?q?NrpBeHT2ijMP8VsOTZm73qiNZa4a/4cVNLJ5tQ8YIIMngZCWLhFDfXLq4p5lgoBKq?= =?utf-8?q?I/13FsfxUGH07YUuBQfSOaQbB0FAU7u04Szy5B5DjKpT5Wmi6GxsE2WyY5EGzJvgG?= =?utf-8?q?B71yLdIly/tnENb/6+dYt9TCW/7XtyIC40iGpNi3HVROUQLx32WwDYfuXV4NfHat0?= =?utf-8?q?MY2DaPiZmP/+Bm08M6/TJp26dtRLj9R4ph2vv5VU1tAFtJyPT0NpaBzlUQaLxYV7f?= =?utf-8?q?0V49vHtLUrVbnEtIUCoIqkuM3uld2eCMLGvAzEIUI35ojXW7Wc8hDtIzK54KuAFfD?= =?utf-8?q?10xHDh9jTpXb7iGocAt924oK9JQySai8DScMCPQz3AAnkmdbTU+yyYsyVl7Iy2FeC?= =?utf-8?q?b7gRo8Ke5jRA8Bwv/TaxX7fNU/MFMKyb/nft/zkNzbsppVdGdUXqbtpxwEgspayf9?= =?utf-8?q?FldTuToSFs2eI7fppPHYLt6K1bZMQrTYNiKPN+7H/FrsOAOzZAS1jwYpP2QUJ+JIg?= =?utf-8?q?KkWhZ9XG3diCpcuPZQ14yPc6xQzFnqGTjltr8+/52AXl8b5kI8JrFG3lQN1rt03x3?= =?utf-8?q?O9Xu97LD0VBU4RI5MIzcB8pS64CGGTUKqtnYcEcibWQjykYb16FVpV8hhzNSb8DpR?= =?utf-8?q?tRSgvHDNZFGhk0B+ThCMT2puYqW5l77tPRWLkjyWS8FG9zpQJ0d3oww1RxtUf/Snq?= =?utf-8?q?hnf98ODEJ3p5OhVdDfM+cA9FgyPhe9Itz09JFCj77K+g7BUS02nwcikEtsrPypFj0?= =?utf-8?q?HMbcheLvVH4qKWiETf7B5yGg0mkJlP3/IK7MU+exKx4F7L1MYyXKEj/bSPTbmFE58?= =?utf-8?q?iJE7vUdOP5FH3dwX7+F7I4qL0H2WNIwRgU5qaCzpzKrqQsIqVR/49fZXK4sCPVzvo?= =?utf-8?q?bhfrLY8RRfwV?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 749ba89d-b7b9-4fb2-080c-08dbc8d523cc X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:35.8482 (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: IU/GnwBzPY8QcLdKZT+G9lCf6pS27pts/KISgaJYYl/P34CY8hFSLZI0227rYuV7UVhPkB1U+fLvATg06vJslg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-GUID: _E-Z0VxVKQjcBAqw7xzhgnNpCEJAjxz2 X-Proofpoint-ORIG-GUID: _E-Z0VxVKQjcBAqw7xzhgnNpCEJAjxz2 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-09_12,2023-10-09_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 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 89fa074e8c..c9961db1c9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -489,18 +489,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 if (strstart(uri, "file:", &p)) { file_start_incoming_migration(p, errp); } else { @@ -1749,18 +1752,21 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } } - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_outgoing_migration(s, p ? p : uri, &local_err); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_outgoing_migration(s, saddr, &local_err); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_outgoing_migration(s, p, &local_err); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); - } else if (strstart(uri, "fd:", &p)) { - fd_start_outgoing_migration(s, p, &local_err); } else if (strstart(uri, "file:", &p)) { file_start_outgoing_migration(s, p, &local_err); } else { 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 Mon Oct 9 14:36:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413835 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 5E44DE95A8E for ; Mon, 9 Oct 2023 14:38:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNR-0003K5-DD; Mon, 09 Oct 2023 10:36:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qprNP-0003Hn-7C for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:55 -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 1qprNH-00033s-Sh for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:36:54 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399C13qa029860; Mon, 9 Oct 2023 07:36:43 -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=bsWBSXmTl1Yolggc2d/gWdriopPvrWC5pOZnYIvIn 7g=; b=rhHvgqfky5rh1E+kuOzEDaEB4d8jQF5BvKuC7cT2pnIbzvMZ+DH1K4bGk 44s2nN9CS20yv1hADM7wgOe4TMmlCrFDmyBvfh4tfdaohbu93zgeWHm4/lRXopLM FWFWksC07SGjuYGl6GslfhP4ceCUktRDy2nYx+zjoKhWrNpwfOd7hNdoiWQmOuQT NlCKavo0Z+uN0qd65ZtpbUNZOtlZ9CGEDvUzyHYp+v4ScMb53M6BHkcb6fMdppe7 4q2Jdguhg55mOpj3dfviCvJ2V1YC/gar3vX29BBDDaCZIOg0ohfibmanDfqi2aoh lTfvS6RqzH/apWIzvX6Ea9wMVAZXw== Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv02tk9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uh53Vrm7Is8QkUcEpclH8of4J55ACt3GwpOfb0wtoAYuq4AC5jgvL9VuUXfNW/fx/Cp2PGoGyJyD0JUGi02xCfG5tHK3d90lmA628axHosGjyo0kHugaQRm66SjxcOiervJq6bnlmvOrhaz/lyfKCQlhctjQSyj0wfYvTVgIZUScOa8bYGFBCyY/qjej1CBPatl45mkOuTW+mZt2jE8hP7kz4l/sQq1s7BZRf0lS6FMatrGC6OWiMcSAIgKLCr2K1QDcMUQan4Bhve5VhZ/BOzSu7gitynNo3mLZ9Fmj1CjIFxKXRlDfv1YgMZ/kyQeI9ckDekBi6GxSsqMEDXC30A== 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=bsWBSXmTl1Yolggc2d/gWdriopPvrWC5pOZnYIvIn7g=; b=VZvc1SYK499vKldpJzhP0+KHXeD5lW4DzIYQR7HKDN6/e3A2lpsYaXGPBqnPhFt3//KX1QMpIn6Ncz3tYbmYCAUCOE9uOmrbjBmzMqrx7+VPAtwx/qsJoOQA8qDL0lk71aSaTl6JCH/GqjZ+9B1eHvtS9wRP14KeEn8lSABeZdibB3ZOJkqQyBXwZLgWiGd3HK6/LsxUrQyutTUpAmNNS4wNiLaJ3bJYEH0VXYcyceKVGGYpHKhtkZ+5yzY4kAJFyuVLqdJvq1qpu4jncguMAwJW6gUwXRTcJzlWKEVSRt4kTZtSMMdJqfsWGTo5JojUSGW21wVnhq1+PURSxHf4Cg== 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=bsWBSXmTl1Yolggc2d/gWdriopPvrWC5pOZnYIvIn7g=; b=do3A9DzZktgqLRqnWBN7ah9CM55Mn1Li64bs19Swb7+B8RaHsbGAcQ1pRelOR6O1f7DIQFQ7SUOLLXVjEf/zlvM3oG2bXfl1dAmyhO9/sg5hdN2FRKLuLGjCPJOXtRBOOtpk2aO4ELlpYgWBs+Blq4O4+fMYMFY0BLbcq5eJNzyewto4gKUfdBPDZZCl8WMvY5iz6OVosi2vdyIoij9JgBoR/xD7DDJYJx5GKq4ZObdp5rRe6knr/StxnM8poOYs8h/tvzdPa665Y8/n18dmlkff3ja8QneUHu6hNfY/bm4j29hz4ZOjknqexMEa7NdIynMJESKJRFVhff8B3dca4Q== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by MN2PR02MB6735.namprd02.prod.outlook.com (2603:10b6:208:1d7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 14:36:40 +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.6863.032; Mon, 9 Oct 2023 14:36:40 +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 v12 04/10] migration: convert rdma backend to accept MigrateAddress Date: Mon, 9 Oct 2023 14:36:09 +0000 Message-Id: <20231009143615.86825-5-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|MN2PR02MB6735:EE_ X-MS-Office365-Filtering-Correlation-Id: 84b487f2-bba7-4a96-1e3c-08dbc8d5267d 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: 49IaIdT0AHnhUjdZcgUDDxZChGe5QJ17ej2bJdAm7QmzINuAgZ4/AY1lX52Gzrxz0e0kikVdGimgwBP5li7F2pH7VIiS4oEnqO59KwGfoZNiocXEb+ukNglm+wqnHiVWBad+c+idTgp2I/cVYD2CE0rz4Vz5cEbgSmulwWihuTQSR0qK/jULWi//ZRP76uEeEhULbiXzNrtWFY/t83DLDBLgsFzDufBCcfbEIbsDtni+XjnVHhN7Hh0FMAUt8oVeJwT7zpqFC1t58HFKCGtSKjFZgffCiykDYMKRN9tFT0l+qq3Z/iCAV0R7tVFaCOceIYJh3Hr4yMF275rSuVxLVzcG/rzVEaPf4AtOAVxPgrgpZjw6W1dwW+KGW9K6m6gKRpe4mOCyPR0B9ASFq7nS4OGamsKryx0TrMvwb/ZG5wQLtFxgquV4/t+roEkYKAxG2lfEMk+aTBJBnoIMqiFACoVw9WJ4+M1L2zmTst3vXVO0/JTXkCSM0b6ks8krIccat5QtanNILTW6KoRZpayvJQHwiZmqMRRoLGruVsqOCP6o3q39ACnSw319/CjvpKLa7vrMTKjHBR4gE+ggL0JZDkMbrrXPe70vTFYeIdvSNA2BVBnZFEwXfGh5DpIHp7Rn 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)(346002)(366004)(396003)(136003)(376002)(39860400002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(52116002)(6506007)(2616005)(1076003)(107886003)(6512007)(6666004)(86362001)(38100700002)(38350700002)(36756003)(26005)(44832011)(83380400001)(2906002)(6486002)(478600001)(41300700001)(8676002)(316002)(4326008)(8936002)(5660300002)(66476007)(66556008)(66946007)(6916009); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?DLRRfpWhRKnNete9pTNVoK3bC+j9?= =?utf-8?q?C+NlLIHhw6xMHyoYhhPAXcgGG18osjcAqJX/S7Gcm8OqiMvsVH+b/cRMvdPokCRFx?= =?utf-8?q?uLlug2SBzvE+zVYEfsjKzM45s/bczd1gjemip7Wv86Pz1FXZzT9cW5rq5oIwELBqa?= =?utf-8?q?fQzOWFHMUG+30jdg30b806wxbNBf+F+D+cKBBVkeXnSF3cleds2NTZ1sg5NG1GDTD?= =?utf-8?q?T3XpLvKtnNC+TuCqKkqazITjGzkiE6gTgWfvXPPtFzkwIDn50QwDkeNyyblVC5qbB?= =?utf-8?q?AvKK96RACy9SE9roPKjZnvco8hnrkN3Eekz/KcjxoIffQazCLpv9VLuZ/9raqZd43?= =?utf-8?q?yeDe+Z+RaRz1Ip1gHvkeHwY8q70gaaplLVHLdcr289eNgXcmbgw+F4SSx5jolglmx?= =?utf-8?q?v7Z9GX9nKhSjZPKTQ13PS7JYFKQCbBexKZS66wPAxL+rl4qOHvWjSmi+7t3VJ5NWI?= =?utf-8?q?ijmbwCHiqrpZBbQeXIl6FDGzxaPzFhjmokYdD7SSTelXBW5YIEYK0ng28woNwmMBy?= =?utf-8?q?EeUvmnSh0rGE6Ad0eI61y6lqs61rfHu7Z7ub0n8U49430Ty9Xb0jisSOKwqJe5XCv?= =?utf-8?q?IC/RFJ9DnH4E3a7fDu5ejcOWbK2w/vfVUuvy2/ucJ64tfW9G1wRV0qYrnvdfGsimF?= =?utf-8?q?zQpYE2fdTDkQ9TKHZ3BpfGe/bEo9an54c+dLTxXU01UThaTNn52qufUcYmjSaxxdV?= =?utf-8?q?bf+zntdvHs+lAvK1alP1kKO60BWk4XLftwxnFaYKU1bhvAhDV9VahBSq31RyEHTE8?= =?utf-8?q?4WbQ4Gs3W8V73Qs1tchn1Lik4bs9lQW/g8GMSpBoS5LreaW2TvDRoUxjCZXHxQjfD?= =?utf-8?q?L5ydcKfYVK7ibxiF8FRf3RwWpMGANbWmm2BSCnuPcd4ENcUV6PoE+kXnrK8owKWV+?= =?utf-8?q?I7i7KgpnZrUNutDYDhBVFLazHQfgrDycPwJVii4hS0MgLDMMvP4CCWxn7f5VJRA1u?= =?utf-8?q?emWWQVNGHQfEtj3q6lTVtyYpFRIgREnuoeul4DM29jOSQK5NEqB9hTI0PeVN92gbJ?= =?utf-8?q?330dZwgJtbvjmuSLw/NFuixzg7fgpMLVahnLrvEKtLc+4ARQmG83JnukeeIxGfm6Y?= =?utf-8?q?gwJ8Pa/j/6lxV8B1Rzn+3KA36hwg8QEyqRDdQgJD5bl6W5D5nCbPX9Zx0BUYJT3Pw?= =?utf-8?q?C9kGhTqAxr/39x+Ohi3AOb4FSVMqCnwrVrGuIjAPpTy+rTNFrIUFYNUGJOEbFlRXt?= =?utf-8?q?H2IAgD4m4ZNBabc1eQBL5eOZxsza5mgfhIKgR76WJ3FMWPIRMwIx8YoIqK1Pc6iJo?= =?utf-8?q?bejCnZKnfDZZoiGh65AGn1ENm5MicfHWknWBh5NFlXfnc2cG/muorga7IDMjFUMkE?= =?utf-8?q?Wsn1w/Cljll4O9Pf6Gj2ClYmz543LPrRA5RNWSFJ0FLs9Tp6gISCAVvjeY0sSh6N2?= =?utf-8?q?DLll/B/14H1zE606ICrrvXQVYoj4FS03q8I4sX7KaReuFYOZSd+01/cceoblhxRfj?= =?utf-8?q?lMkdIzervKGPArYgsekV+EDB/8AkP18OI/8LeQjCR0iG2IrJM/iYOaFfIIVYA3i5+?= =?utf-8?q?5krxNHStRJtL?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84b487f2-bba7-4a96-1e3c-08dbc8d5267d X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:40.4064 (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: jwcpIZnpEal0RlhZyfdIEkDC8fOTV5C3FHhFOaXYv8xz3tG9KGB9SO3tG0RhWeBwdLXeRmkj4kkqjI1EyheMww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6735 X-Proofpoint-ORIG-GUID: y_LQto1zcIvMOOXbGcqFwyxCT-FQTDle X-Proofpoint-GUID: y_LQto1zcIvMOOXbGcqFwyxCT-FQTDle 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-09_12,2023-10-09_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 c9961db1c9..ac58b35d44 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -499,8 +499,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); @@ -1762,8 +1762,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 cd5e1afe60..ab1b86532b 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 Mon Oct 9 14:36:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413840 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 8E22BE95A8E for ; Mon, 9 Oct 2023 14:38:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNo-0004Tv-RK; Mon, 09 Oct 2023 10:37:20 -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 1qprNe-0003ux-70 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:10 -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 1qprNO-000343-Hs for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:09 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399DAJOP028050; Mon, 9 Oct 2023 07:36:45 -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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=vYb7vSAHnZ8jyjb93ujXuS7A8+FGhO2ozMJfCyfCU ck=; b=ntG/QjJrkLFls0vUQlTsFpS107lse/c+OoDheVZLQLoKGbaz20TClLDmM mAhxes6SiDsRBWnHE3CFEOVYrS3X9hGRS/4sLOfZHzIj4FTIZliDdBpLhy00GC6n mqKVprfu+5i++cJTY1m+9rZ3PyKAskiscrltlpAPbzR7F+2d5t3sr/d8b32o0i/d 36LtnztZqOBxq0QSwArU/8fANJJ8z/9EaZpm3Qr2QGPCIrfARGMKRTGIZTA1Mz5K ER3HmV9WY1m9wm+mRP5SioSuTVJ7z5GPM0aRHTMIYzbNpVlIG2+mXKOTvjEKRaSX DvJHwA6lKyThem41GeBuxlZgxds+Q== Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv02tkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YMJJfeXMySh0cSACd9aGmbToheNRASLBvfxKPltd7eX+BMObeacKGZITabrWHy5y3YhRo9IhRpPuMeGgFLRnA8RsgNfGVdlAR6hSbDfb9I9BbMtQQOwxZIng8B7umcKfs2d/nbMMZugMgFJPqNUffXba4psp9ItGkA7SYAc6Pz3i2i8Wpw2vQR4U3dKjBOCFejBMUVFaHiijFN5JdEr1FaTC9JwnfXj06MRNDGBKB4QOnuVuP8tfep7zf6BkJBbocyL2Aaks5s4p6ZZOu6Vh8zuZYR2DVOtlDkvM9eUrGQAWK9Vw0DFmnbaZHVDJyeQyyc/QFnKFGVJa40mBvC0FjQ== 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=vYb7vSAHnZ8jyjb93ujXuS7A8+FGhO2ozMJfCyfCUck=; b=Rh/VVjDeYudHhBjjOR+yTiICjXnjZwNgNfmwaP1erig2KuWlntgwbxRVe+04CyqBXElkP/WZddkqJxrnJvNRhH8XgLr/Z35YooIkKzxQaBeAayuUQr5kGqlSeXRZBq4SEIUbWmxHgeurgTI1VR/7RitgCBIeOzQICqicPXALWZaJYSnb0WGOCfGZFq5OtYAL/+KlDJflIkgAS3CUJYMBUtU/GDrEvGvPx3x5C3XOi8r51peAL1OyKOKYF4g38VL7APjTIzukCXG4sp1v3ANk9VB6Sj7xf5wL2p2nkEHUBxYIDzCQF2bUoJ+GegkyI9XDGXXc+v4MRiwPcm1FlGmzyQ== 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=vYb7vSAHnZ8jyjb93ujXuS7A8+FGhO2ozMJfCyfCUck=; b=ij/zsSU8p68yl+A3Ak0do9djxcEd6X3xcDqJhJ5lA3TKGuX6oVrCZARZ2V5MUU6jK2vcfizoqRvkhDs3URRDtwpaRfEsJ98xZc/Txk5Q4E2+WJLTmFFj9KMTD6yVEMcIiQUnUvJArl8Fzww3TS5JjxLLnYvgDCgk3DoIWmvnQadEdkhjYeHFCx1ZK6Prqc94PHWX3xTZMi2eKQ9Q7g6DdOiHhoB7F2S1e9gmfGZB3E1SWW+A22kqU5eZyHo53n5srAex0pTqKgB0jV0gV7d2KqnoVFNdDJf0sTVveWP2gl/LTQ7FyWGbFjzs3W1RyH8twf9rgPVvn7f0lSr1HiO1hQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by MN2PR02MB6735.namprd02.prod.outlook.com (2603:10b6:208:1d7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 14:36:43 +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.6863.032; Mon, 9 Oct 2023 14:36:42 +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 v12 05/10] migration: convert exec backend to accept MigrateAddress. Date: Mon, 9 Oct 2023 14:36:10 +0000 Message-Id: <20231009143615.86825-6-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|MN2PR02MB6735:EE_ X-MS-Office365-Filtering-Correlation-Id: 68f836ff-57b7-4c54-d9ad-08dbc8d527f5 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: ddnn8gPBxX4eCodbE9fOKGk0aGKGy2yoYoQzVCVnlaPWEttgfAWuP6+zPHVNLL704UTwCQh1D3BUoqkTsME6LEayif7CS4Ad/9lVA6glD1BQ6IhVIKUlH5GpRuaJhEQlGmj3RyL1Wtc9Pstx4vfB0hwboXWO/iHZtarNRkW+6j+ijQw9LOvJUFJI+yP6EhLKr3f/gMwQCUYzwjwhe6vBV8lA94jSLT2JShjXLdBOuACLCpdFG68eQ1qvYjYVpgonha1tZMDFQy261tZnmm0qk7pT9DoFeVQMDto+s8dAQIdiTs1S9c7d1zsmFTml1v2UDizFmocXnjqYNBUZ229MpCyRwx9/GO0D/QxKenhRyCr6Wd4s9bLA/0myeCtrqVI3suCEgC4h7T5FWYniMZq3VYcZP5eS0yKdwqzmGsGsk9MgYsq4CS91xddQC4sW9DJaqFLMsAVZEuSzdpjqxmNTzao6wihd+mNv4SH9kMAvRmrAzZku4Fns8H+RnTFHUQF5b/iQLQq/d+sAPus9KlR2gW2qQ5YKuIcSfLUsQBGCOhynUSaPCo7FinEsgM3AXcPJOi54NesENOzpYlAImD3C/e5cLXBbP1eetAKkrRemLeSN4bYWfPNzhyhwX5XmUxxwGkh83TxuLKOK25No9QAZKw== 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)(346002)(366004)(396003)(136003)(376002)(39860400002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(52116002)(6506007)(2616005)(1076003)(107886003)(6512007)(6666004)(86362001)(38100700002)(38350700002)(36756003)(26005)(44832011)(83380400001)(2906002)(6486002)(478600001)(41300700001)(8676002)(316002)(4326008)(8936002)(5660300002)(66476007)(66556008)(66946007)(6916009)(218753002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8UNo0Ue06G6goD3t1FszEtaB6SsvG0pas1jDXZvRBK9EnbMamGIRvvjZ21NKyevf1zyqN6BV0f0wGUWqBke5dU24IIdBdeoYg6GatIX0xF5gu0Ztz2Dn9adEnwjFNiIELGQAHzmkPbGSbC3X/ylcx4qsHOlGJG8ieZGa8XAnZY4gQ6In0M0GE3iPqVMVYhnWY7gfPdaYfPO/u7S/52bXFE13s74b7S4uqGghhKgXPIUwzIvZz0ww5yxnT2rDQbG1OQPhVe4wAiV80otkmG43Veg0AAu2nI/L731IqNiiSi8LE/AdaUcayzMZJ14VwGt8sL1i+kolktDKjGX0CwLS739SP2RT+psVoMjn6Yl9xeMSdkmnKxS5aRTxQ6B8KZEsDStOTGov7RHlXHaJWunzqHFHLK1jbANEmETzIHgItwaMDvlWvis/f2lvPeWZEayAyB4abEwY6CuN+3Sw9j+jpZSBrkKSb9KRKyGn6JGMkQTXBgCeXWau97y+ZNDeN4U2EUyJzi3vZ1snpaoZ54p+Mux0ZZnnqEx+P0WUPn2UCox/jwqiZzj3sssD+FN75mqzCFNXmMyy4KKIbH3VCONKP+L0/7qATs568vV2Y5vI7xwYE9rm6JEZAh7fFNrFGWOke/Op3r7U4r56LYBAP5BdbTrF5hmpH9sHNuEyZshpslWmPu/gqhrh59XdRbdL60OScGjaHNe7RLIJdNdJ2c6kzB1kGkztdux736vUUd7xGSdt7kibog5hqt5ZGn1ouxyq1iyqWYpJ2ICn77RjU29rjnMUlQVDnsDPFkFwmrM1tQ1ZSIyImDm7oL4Etyi9/zYSWlU9hfqjtK02C+S7/8319VCOGchSISWUeDt1hv3EQASDSQodQfn23vZIMGdCpelvyGTFE4icAvGsX8lk3MJjaNqewyhhLhjmWkoTa+glnCV4KPla8JxalL7yxvZLsHAJYDT01LaIcGu7lrGK9DzRwsRQf8QIA2TxD0X1q3zRaifCPrA4upMG14vyyhq/HjNrCzJj/xs+/53Cz9Y7ck+z5JxsekPlXtDmC/b+iGLUdq5x5r0gMofdEJZpY3hXGq3N0l1kCPU67AWak8jLFIrM2CLc0Oj5dwMOqbJuvSXldH6RbV3HwMpWHDsg+AWvf/3PN/NP/W28Gfnspc2NR/2mwKvGdh/ouShALlIS3HNlam0VwClN9cObL+mIpTVBvLDQGP9Z3NkCfGUCEAu489AntfWYRVQLiKfScCYfzvT30q5RRowXQ/el/pe+BZzuN157w6v2uaoRbzjONnL7/nco+zDxap6uMUbdU4yMUsFiwRWqKJlRa5W4AVHRLeT03Y6ln8eovjUIwddfaQbgVZ+s+At5p+KjcDyYw1KDsXgwkmtBiWFOkedvYNVfcq8qGtIPoe9k16yM/WvLUPwDJPbZSrEwfQ9S/H3cMY/VNg1+Pk25U5GHmD8VtY6sdToc01FAsQp7mLju3DfPL3COExhcD7nIVl5UV9WeVF1Nh+R/gYBIumDDGESkwkRBXQcku2dRFLn1G0Wn3W86ruH0nW4QW4JeispGqH3H4B8Q6MI8OvheFdkKoAfM51WtFuvBmNtM X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68f836ff-57b7-4c54-d9ad-08dbc8d527f5 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:42.8437 (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: 8wBJlM4N2gDBA3tIjmj/SJWRC02Kby7FOXDpamFV/1uYkja9jy6MT4Noq7kGEQ1wJzY21vSuzlu/Hm8zkHWy6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6735 X-Proofpoint-ORIG-GUID: _7zrL8W9vwm0WEoQmJAcLya1qOoqy70R X-Proofpoint-GUID: _7zrL8W9vwm0WEoQmJAcLya1qOoqy70R 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-09_12,2023-10-09_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 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 --- migration/exec.c | 73 +++++++++++++++++++++++++++++++------------ migration/exec.h | 4 +-- migration/migration.c | 8 ++--- 3 files changed, 59 insertions(+), 26 deletions(-) diff --git a/migration/exec.c b/migration/exec.c index 32f5143dfd..b5361abc75 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -39,20 +39,51 @@ 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 + 1); - 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 *) g_steal_pointer (&argv), + O_RDWR, + errp)); if (!ioc) { return; } @@ -71,20 +102,22 @@ 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 + 1); + + 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 *) g_steal_pointer (&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 ac58b35d44..732fdadb11 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -502,8 +502,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 if (strstart(uri, "file:", &p)) { file_start_incoming_migration(p, errp); } else { @@ -1765,8 +1765,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); #endif - } else if (strstart(uri, "exec:", &p)) { - exec_start_outgoing_migration(s, p, &local_err); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); } else if (strstart(uri, "file:", &p)) { file_start_outgoing_migration(s, p, &local_err); } else { From patchwork Mon Oct 9 14:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413838 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 EDB21E95A95 for ; Mon, 9 Oct 2023 14:38:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNY-0003pU-PU; Mon, 09 Oct 2023 10:37:04 -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 1qprNW-0003mV-3e for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:02 -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 1qprNO-00034I-Ff for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:01 -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 399CrZ5x022209; Mon, 9 Oct 2023 07:36:48 -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=45mKCOvA2OS/A1gpgMAkgbL/m1JsllaMMR0rfu3S4 TM=; b=qc4SGjReKmUaGy/mlBauusnkx39SpEdeYADjBTFpBOgp8bYWY8DKgjPAK wv+1qasci0HS/6i/wuZ9cTe0tZSOW03ypK7K5CFNpIH0umR/iL1VLlpVaYJIr9sM E2sJHPoIuFygV/37DWg2EAsAM59o+hZsvlJjnTVjxNtY7ptyrz+YaOQvR3pxjKIY Sknvu/StgoMkIdJuJEf9QI1/IymxaRwxR0QA7ZX3Gh3fjbX5DulhOkrwTwTW/Tsc /9x50tuKLBUk1mTWf/rPfcgZX9FGsKQDvUO0bGS22rUS+PRr3vsUJD9SO242OkbA 8AUqXk+vYMR2QD8TC9/bjP1ba7iLQ== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2169.outbound.protection.outlook.com [104.47.73.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhtbtt4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nYbIAM64IrWuhxjt3Yrwff5KN5w5XsB/SnoTurKd0T3KzrSf8qsPXpH9vZeJMCWgNqQG24I3CgkCyZzfH3tfg4SYp/X0ODDMH9OblNHv/A/criKFAgZG1Y44CLq8cykYtPuYWWCNutlqW6DsHYAah0gpWek0ucN8/ftHeEP9s5mg6PM4Ybrb3AkMteePbrafHoWaC4/f+AGZkRq/NM2RKbuu6YL3p0xJqv1ddhpzjvPEj+nEHgPviHFCCPdiKI3qsPi5MzcwXQLlROKSolAnGORpS9OsZBhX1iMiJNRXVOzIbEvMKqcQ7ni2XotL+wSTRPZhSDehrcElywCSuA6h2Q== 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=45mKCOvA2OS/A1gpgMAkgbL/m1JsllaMMR0rfu3S4TM=; b=FWcT6l3XwTdvOG6Q3Arf1KvAHTrdXqwOdMmyTLgyrzR/MpQOEZMKsFjQ7zCJvfN6C/XOc9zX7VCgrPZ+vZZgPf9pPKR7nNvwNe2c8H5dxa092XqKn6ajATz+XQHWEuX3a5k79+KdHoh6qhaNlHnk5p8Ja17GvMlavOid0QF+C/xW/tpM2a+CJss4fWlBYIojCfzxtv8k2+M1dpZBFXHjpA29/05/wZjr//mrreVFVCkOwJr/mrSlMmsiH5XZLES8b4iMrUGNXjd9wd3pQjc2iGdMfRr9AVyJ0K7mxchV6xlOPxAPQfrgjiIqPSLt7VaWs2/xH4t1YRBso4HaqpXFHQ== 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=45mKCOvA2OS/A1gpgMAkgbL/m1JsllaMMR0rfu3S4TM=; b=yHgEg27bqi2lGjHEniX6HOMNo0XD91JMqKzgrzClhA3hCeFEXuZU5gjY/rM3GVQVxbFyBtz8Pwg5j8ddye6RbtAygI6ePDQSZpYg/4MeT4MLEkSNJqUWoLb1uKCUkgZQoJ7CMsCepl1Fc8hg8sJJiRCwtjjhrdw5jOYql68SO+x7WTFJ8LhBsg+e+GeIwuvO5c7UwCZdLaoti+0PhQqJe44+9mdn9sYZ4On7HK8D0lA/p1/G1Q2imA6ez4+urfNMGTiC8hL62tZBz31ly4Zl+xSDtaAOqgKh0XZalSXL2e/7TLCHtubOeU8msOV6qGtO7CdKD04oNnJwU7qGX40Tcg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by MN2PR02MB6735.namprd02.prod.outlook.com (2603:10b6:208:1d7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 14:36:45 +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.6863.032; Mon, 9 Oct 2023 14:36:45 +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 v12 06/10] migration: New migrate and migrate-incoming argument 'channels' Date: Mon, 9 Oct 2023 14:36:11 +0000 Message-Id: <20231009143615.86825-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|MN2PR02MB6735:EE_ X-MS-Office365-Filtering-Correlation-Id: 69b125f3-0cfc-46c7-a9f1-08dbc8d52943 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: HLX1MRypFPmmdGK0dHMeLoVtYTnv6EqiU1zwXYzm0z7tWlYs6VIAuowS9V2OdV7b53Dqr2uADWyNvcWzktOTNDDsPST82QMyMOwSq82cFYherXTTim3FYZewcuOZ8aH3GlVNLh50BPoHbn6sr9x991eIxsOgP1bkr0kwp9ueEf6WZa/yf0gB7iyBNZ3MRTkx6rFPjxjsIFcsCaVIjch958A+9qZaOEV5Cu1pKCiHyUnG33M94AkJT2SwNRyfWsfHvBkYc4kKub0md4OGSih+7mvEVsFa8pFBR0PMeXCZwY7RavNWx6kHj7kULowTX4rVmuHAZVWG7l7xblrL2/LFElGfTcOZERJZyvnZxTLFGV2OdmX83BsLX/+8skl+kgaumFgg6upXU0Pcjlpm8tNz/QNfseq6rtlOcjaB8clxZmhW3lqmGWpC7wgLdcIz8KGNKIuCi8P+Befs/Ah5YGqJRYSC1b8W9SKLAUL0rD8+AvYQozyV/fpaN/e/T5jOqc5dkXr6GYuZjxVWR6t0gCCNBqlx17FH0y5dBjZP9+vI8PHBxdLvfRig54bLQQV8Kj9q58XOAjgg53YsZIx2QG7q8rWxHcUxkLufEG+JsbvryGfRCqFKQDX9Nwtyir6c0OAE2NlPr8wof863HpmSvZqqJA== 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)(346002)(366004)(396003)(136003)(376002)(39860400002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(52116002)(6506007)(2616005)(1076003)(107886003)(6512007)(6666004)(86362001)(38100700002)(38350700002)(36756003)(26005)(44832011)(83380400001)(2906002)(6486002)(478600001)(41300700001)(8676002)(316002)(4326008)(8936002)(5660300002)(66476007)(66556008)(66946007)(6916009)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HXzWh20GOC9khMwFixQoD3VIX/Fi?= =?utf-8?q?xPT+hZL1AH+w8xJe1Bz6aiViEhROr7bnc04sGoYMKsH9afT7btvm+wvSMm0kBi0vJ?= =?utf-8?q?EWgyerwQHAAJ8JW28a+OC8MY0bTVR9OMfZpbG/GxtpZWEyCYHp1dWiV0m2JY0Cp+/?= =?utf-8?q?II2Zf0x6W33VdDTtA6Q1/v93zIzOfcEMTAJNgyEdvLwypw+iA8rDhOQ86mjqFWd8J?= =?utf-8?q?0g5+XyM8SpawWNW0YgYcy5UILWEGbjdwJ6qwuYX2F99yk2zCLRpAfAzBNsafcbVUv?= =?utf-8?q?BjeqXOfUkQKO/9aHR4+vIZklSQ0Kt2f1CrZBD039GjyuFrTyLAUukzl554JBp/u7G?= =?utf-8?q?MFhoPpKGJZCob0BM1CNDe+66A+a9eCI+OG/YD0ABgycExCCE00io9AQjjVh3KIpCT?= =?utf-8?q?L0NN1TtwY5b1jzy65zAdknyaRGPjUfc77YboJ2jKhD2l81gPRv1IbgIsOpeGq7Jg8?= =?utf-8?q?qdaqeGiaZj3ryJwPjVJs9O3Of2n/Akk3AbPwN1Wvp8u6udpe5XhRmejocBNNFsEFc?= =?utf-8?q?J12tjCbf35gaX/nMnP9WHgMZK4qkwZKCGz9axZ0AiPmpa41eaNnktzFgSXuSE5X/T?= =?utf-8?q?9d62wJ575t/GZntrrVbF8NLtu+73WCoiRoS8kn64la5ddMyJfHmgnxgg6ZZTYe3T1?= =?utf-8?q?G4nLU4LMhpuHF9gO4KP6I5a5HRaVoY02uz0ykUhh79paH0FsgmcJ5jmFdBD/4OoQJ?= =?utf-8?q?LIDK8WSpV+qr1Yg8qYD1uLd+B1Ud8u2i3/jUv/3FMG1+vKtzLanG3MiT7/p6nAO14?= =?utf-8?q?Pe/dtJQ9lxcFuTTRtuNGEBMOgAmLMSBLcYKb+ctEPR3V9+HBDB7w76Va9rAn4cSq7?= =?utf-8?q?C/Oxu/nRzlV9CFiup5rnMXlMnz5VNH/t19+/QMgPYiddvZ0DVTFXM3V4Ou2fnyHGR?= =?utf-8?q?Bz5DeRQ3D/qOXC1nkCBZ6vBHnWI1JphBHo75aW/kO4OBFw7hLJnboMiVPqcFGSd6g?= =?utf-8?q?vGgM0CoC1GUWk7Y87UEIkm/s75dN4FKilMp8ekT2AJwfV78b5fiwKInFWPrjtTWll?= =?utf-8?q?bYcoPZCB8EhJ0fm4iAd4SUMthfUTE2XnqHKFxtqjoGBTrTUEw0JBr6i8i8z200vq9?= =?utf-8?q?WIQlrPD4ogsoGYwTFH9BSpFtVDlQYYOTSV4HBMOiQ9yGIFzKOdRhZMzJzmJNX5P2X?= =?utf-8?q?idPWNds9P5KXw7Ais0+Wsw7s+/yXlxNmmcRwZgFS2xLC7S07VEz/b+Vdq26Xyar4+?= =?utf-8?q?BjvNdZ479ee+daQl1IObgF0KcMbt10n+qqzzxcom/c9ATCQgJMvtYVMx4BVhV4cQ4?= =?utf-8?q?Uqz9CTvd2ZAhkAZsFKF1SxYU9rTYhtN8s/CZGbzZRpOQNhpAypfaQq5W4DLcpDjiT?= =?utf-8?q?K9lrqEz090ZlT4PKQI9ddPsZr7De/pjOsATi8XSo4nG+SAkfBo7ZfPoob/WFdTQ+f?= =?utf-8?q?ZL4ZK02kEuBEgXDGKiFN++wiQ8hPjY/5A6igSmgFuIgww7UTcFBv5SLrdJ4as0VaX?= =?utf-8?q?Za+3Avi36xo2X4e6Lgu/xfVYJ2p+lUo3EWOA30yd9+eAtlrNq4kAwJdxrp0sSW/bb?= =?utf-8?q?7kMar1T4Ud49?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69b125f3-0cfc-46c7-a9f1-08dbc8d52943 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:45.0312 (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: Qlj4nagSINdWColsHsce8frQV+td71Kr+Ts/DKeszRbVgOJo/ZE6yK3UbmuD8CmKjKD1lGkQhqB058N0GqsA9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6735 X-Proofpoint-GUID: kxtOmS8iwJbHrxaCRAlOS6hugaCj7-1t X-Proofpoint-ORIG-GUID: kxtOmS8iwJbHrxaCRAlOS6hugaCj7-1t 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-09_12,2023-10-09_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 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 732fdadb11..f3e7c338ec 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -474,11 +474,34 @@ 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) { const char *p = NULL; g_autoptr(MigrationAddress) channel = NULL; + /* + * 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; @@ -1535,7 +1558,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; @@ -1553,7 +1577,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); @@ -1589,7 +1613,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) @@ -1720,7 +1744,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) { @@ -1730,6 +1755,27 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, const char *p = NULL; g_autoptr(MigrationAddress) channel = NULL; + /* + * 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 Mon Oct 9 14:36:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413830 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 B9877E95A8E for ; Mon, 9 Oct 2023 14:37:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNV-0003lH-Tk; Mon, 09 Oct 2023 10:37:01 -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 1qprNU-0003bd-A8 for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:00 -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 1qprNR-000371-RQ for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:00 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399DaBN4001999; Mon, 9 Oct 2023 07:36:57 -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=hiagJbDxaOWw+mSoz4vuahAgX1fl4GCP5/vxSvd5Z zA=; b=nKSt4Ah3rrdt/oKJFPsvloYMTzMYPWyV85Arz0LTklmjNIDupSGw7Mq65 0Qaxt02iRG7l0IEbBRuTozRj65iG1KzVhGpK0bh35JXMQNoGFG0I9N/iegXc1p65 JJukZjZ6/6YC8bXmpgjrMhCE+uClc5NETg6UdvF07DPsQryfWfwq1xxFh0t7fMPx OS+hsVg3INikobhfF8tnceKBhW1wWfNuJN7udOP/fC73wGj6fmNgrVAg00jxh8fZ yMEVxEW3GVdfcNsOwFtw9WDL9eP5ln73S2EgET+d5kt7cyCgVnMoCkQtG0yZH1sL LBgEUrHOW0RhVhdTzeDz7OdgpAImg== 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 3tkhv02tkw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXc825U2pkGBbz/BlBD4mVha5hauxzKc1/ntF08zdcR8oLvTdre7hzTLlqeTGVReugwBYwuyNXonGU2jXK+FTg4f2iPc1tCzmzbFVQt9cwe6CXS1r78IIcUVmvjwPpAN59W9YrEFfTHUBV9fa1gJqJ5lihUnevEJZ5Igb8P9hYhA8m9dslDJ4Y6tWjZpSdF4CyuiSgwqHu7uKPslqQPMnyIdLcaH5vAk8uCc+z+xyuAfjxZvbYQs7/YRiUw+KgA6lgdyFe8kv5JuMXVvO2mw6xqe95Y6GL9FQ0jYwKrnVsOX+EdJEzP8o7hVdtHsB0PxK68mLHPMkN/W8+uybuZAug== 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=hiagJbDxaOWw+mSoz4vuahAgX1fl4GCP5/vxSvd5ZzA=; b=aTe5fq6xs8W1Zo0FOFZy+HUixrdlLJdHWqD8z/o7SJn+ZXyowDhx6mkRE7zkDAxT5egdaSFcG8YWjbOLcfmx5VVJ+F4j3FXagIUCq6sWgdJGjDNg+M92lhvJJmt2v9pDzUIIXTCySr3MvgFUf6QrR8EJyPV3+X4A/7gIrLCuHnBGebrlLgnwhpHVb+sTz9JDqvW/ycsK/YCrXha+Py6mDgDTql3WhMIKsaN1zuCbPB99o4tL7OlHz/NGDRowVxnwX9GK5QUgiYRoPKRvo937h4ANhUO1rActasnGIHWmgvdx3+l2sLXqxwyHVgRGeAnBCMPpco/4fpnBWJBXQizD8Q== 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=hiagJbDxaOWw+mSoz4vuahAgX1fl4GCP5/vxSvd5ZzA=; b=apRIAvhNJKFO8HwcTQftPmtjyGr7bi0r0VOroXzyP6dZjcOwJXCcytqcwTORGN4iktfGNCd2u9maRV3rh44YUkm47sFH3J3doEGX4atVUWu/NlnfZU7rt1c69UVj5JZJ9mZ0j1qO7LRzEoAszjeecPxZVyYKjUEAiI3XsDR0SbQRVq3cxSRZ1P/+HXy2qpQqGF1xFHR1r/+OK3gIwFURFPG5bO13FrIUm55WQRrihOn+p6JG9jCFZt1KZ7dD7+hecMWfGYMOh+sk62QlrmidWdCJYWCpzFFvImfep57mmk1eADm6fd7gsDYtkPhBIVWTtkcW8npIukdhAIT4jJnIFg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:36:53 +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.6863.032; Mon, 9 Oct 2023 14:36:53 +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 v12 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Date: Mon, 9 Oct 2023 14:36:12 +0000 Message-Id: <20231009143615.86825-8-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 99731c1b-dc94-48ce-123e-08dbc8d52e82 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: Is6JzNfYwCxBTKwQx+ViD5ss+8gh2eOlsFeYU503qDLCD0gN6M8l1VY6POOgsC3NMH0c6F/oIu9biuQ/Q44i6pHZbWZuy4hmYrm9G0HxOixj1CjkQH9WR9Wkl0Qg+ksgr8F8PsvJguSa7MdFfKQASHE7fh9vN1RVxuO04HEoEONc7TPkvEmPfJFFmT5y7KdJWN++wMf0B1o6pJoaMb2NPH/ayz78Cy+vhPsF++Nw4Oiklj+Tt8r5GiS3DSB60XoaCcYBFoj+QOYtCCoVmpJSrlq6sljwNijsVOdPbepjFRpgVotmEUT0OhsMYavY0zpbkRnIQrLcdd2dHDPqZYlwPCjZ4Nqb6A5kLHGoI8ydiahwfTMLD4OU2RdRY0z4E8hPaJ8xX5fYrDVDe8JOFRZXIEUdFxJRjQ9W9RV2T7qWZOPWdcsWBuAN0TOODvcny2aOFLWm8acyKmj5EWeRCKcJkRm1Gak6mPk9mYGENhwHpH25X4yPKHoveCtSzkI+31lpYn8Dsjk+4JIlBUylECF5qKOPDRMXzK1L3yawOYDO+hdXrWpSGljzdsRxCIdYHxXHDVT5UbwDXLJXVJcZQa5N6RnEUlp0QFUlTzHe5J4LDXt8rJdndvb9cDrobA/8Hwk9 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(83380400001)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Q+zc2IT2YguzPaixAPeidS9OMZc7?= =?utf-8?q?jAN4KUYs8Vc2pRkjoq4jvlmT2F5hquEZzMbk/ziU8/TPFG6eGhF9QsujDr+PXB0/f?= =?utf-8?q?5O+0aYcPPYZ2j4E+BdxdGQ1JM6C/ZeaVy5BhRo8FYwnkKlHK2uocSCvjOR9rFLskZ?= =?utf-8?q?48Pz3ZRwjFxIsDRl+qGq/1Nwc1PKzJxm3TwuDFnWG26qUBaqfLjqMP7invTGhQ9KO?= =?utf-8?q?sbzNppmdfs9I+8/buXZBRKiW7qxgr+qY4zCuxPY9c21SsStRaiTaUuY8o2cgbkQzG?= =?utf-8?q?VHpZdiEO5GgCq/4JTM/Tmt+upI/b7Pa6jwr2msx9hjKA24NA+UsyZkYXB4+t3OlcI?= =?utf-8?q?7KASiuvjYbCNpPwUIRrcr7Hb0e0PQdXuDUrAmiDP6C9V/mfOSfidTlFz+cX9oBsXO?= =?utf-8?q?NZbh1SB68/fpD/5wCt6BhgDmwnjGh0PoXiWYQHnueihPOZycovxK/s+3aK3VT9jFO?= =?utf-8?q?X1/7A63HZy5VAmTbj4ormS3gghUySTXYJk0QtpNhAPF3gPs9FaQBJ1AzSOv5XCHcf?= =?utf-8?q?wBVgzGW+/lfKbyd+Kt3YL0YEEOqDHvie0S7onn/cV7SlajOzTWOpp4qJ/05kYdqMK?= =?utf-8?q?BD3KDrxtQi9D4N3PMjB+qPMG72zWY8metmlRw+SNqybi699VRUdmknirytTT33UiG?= =?utf-8?q?t5AEuSAHip+OstG/MzvLJAvR0I1OrHRxGhzOS+jAmzhAGl5j4aG6PQdSn9qk0LFhy?= =?utf-8?q?lzKlpiAWDIjjxrlcJxsuzIvzfPY0PHkRED3wVN8bxp4gAiPznF0V53eSKtpbETV1a?= =?utf-8?q?bHRZWfdaFFP/IBHQp/XKSMTezTatGjBeE0CmQ+kthQZS7yKUxPXlSywxzbxBa5FoO?= =?utf-8?q?fgzMBWSS2616jc++46XxlrbhjjBJw4lPl3csk2FAaJBlZL49BrhLbALXeLTPQOTqx?= =?utf-8?q?bD0H4OyO3h8j1FfHuFoaYY8HQuFbd01l7KIbKEyNccU/ASSb1q8x1V4aQ6Nn+jGpg?= =?utf-8?q?4NO1uCP13ZPyPaLVdaY7aDLqmTJzTvjrRshV9B6T2YjVtjG5WN15AhpcLGm7hfR7e?= =?utf-8?q?iDx9keJFFZ1Rk8hHJcU+SxU/6lybNmA63EGLDMoeKjSsxG7/MHmZBPR9QWmPaXPDC?= =?utf-8?q?0bS/wB8i8VNivgF1NulS+KURfZBwNri6PHCu+sb2XySdoeULtK6wBAmaLzT68r0WI?= =?utf-8?q?MwboZW425CGRxxOL25anEO3c24QXcX56WfQ18I4AWd1YlSdbqBdfyMygKfJNiPrpZ?= =?utf-8?q?C9utXjpGreYgZgd9JaTfNUDbr/aJc2M8JKcnZ+RLKQrByUfa6O0tJ6hRSBd6wtTk1?= =?utf-8?q?YIptH/tMJ33f7r1L7kPYDJGgWGBy3taPnxX4ojt43kytJkzR6MBMMvv6zeReZny8O?= =?utf-8?q?o2593W+is2BB8BnfvkySpQ+KIUGVush+eimVNLCuyeeeQm7eYp86JVk40eu5OVjk7?= =?utf-8?q?dDws9kecIvYDomYHYwASvQY8IL+kaoNLiMrj0FORmxK9NYDnIo1kOUxPz55VlTazA?= =?utf-8?q?T7aKN5SBgOsZOiH0JFDUt/Co/5PF79s7A1goTQy78PDpz0Ro0YtY8koZcVwRaY8TK?= =?utf-8?q?NvxzqrnXzr2k?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99731c1b-dc94-48ce-123e-08dbc8d52e82 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:53.8144 (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: cvoiy8hpDBGSZNThRzeHfBTUS0NV6GoTHS00cNKf0kmKhJuWitwKnHxHB9hXTjM//T4VfN72jIBEfzsDaAfNnQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-ORIG-GUID: imv4NkUkQxT0ij93DHBCc71Ye9L7uO5Y X-Proofpoint-GUID: imv4NkUkQxT0ij93DHBCc71Ye9L7uO5Y 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-09_12,2023-10-09_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 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 f3e7c338ec..23c3a1079f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -107,17 +107,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; } @@ -502,12 +505,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; } @@ -1776,12 +1779,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 Mon Oct 9 14:36:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413839 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 D2E13E95A91 for ; Mon, 9 Oct 2023 14:38:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNe-0003uW-Fm; Mon, 09 Oct 2023 10:37: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 1qprNW-0003mX-6G for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:02 -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 1qprNU-00037J-5i for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:01 -0400 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399D9k9Y017510; Mon, 9 Oct 2023 07:36:59 -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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=Yw7fcRxpYZ9J6oJGkqyxkI3QVgfoAONYTfjVOGanx Vc=; b=DvADUsKTHd5A6fIRvaEnGJV1lrGW0ITAuD7Rq1eQ5A+AJvM+3fVPihQUR /78UMKj7TRGL2hqHVP5mNdkZhPvqPp2afKa1cNbeuCh5AAWo9epn0WhGMq6S5ckn rR7oL2RE1wUilBiFjtLYiMwclp0kyCueLzaju1bpiB4cdRrYrzoLmChGZHk1jsSZ vljeXuR+RTMkkQn7W7gx6Btoxi2qYAXW+ukLpMfrQYAT8bGUZxCsu8xt3TgIoAlz QcJ6EP1g0dch9NhqaNgdUiH5BEYrvZR3SCuSBAC+HPE++yh4BiSEeMh8QCkvPErT mRoBgXyDlkxnUjDP+akW18WWW2vow== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhu4jsx8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jBjjFN7S5GWFWra8G2LlrEFG1HRVFq58po+fzFamZQ046gy/kCFdK/Fk+MK/J+8H2VHX+oXKrpgMWUqGrPKpMxFkXEJxV9xABQYH/JlE976/nVHf4Rjp0h/RnuwTweHyk6zfgHBn0M55ywb6Y+lUjvk6idadqjXEUtN+1Lm8rB5mkFer66RTR6ChjK/ggY2Y1t4Xz7GXnRX/6FHt4K7iKYJk+UxNC+ZpFwS4QM6Q2bS/4q6vpxzZkjzE3AYzYSuR9bGyaQGpY+O/YPMuHTLRzudOORbKQRlMjHH9z8eV6KIhdf8ugRkvI9UEr3KjWRExaApSfywYCI+mTxW2p/V+ZQ== 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=Yw7fcRxpYZ9J6oJGkqyxkI3QVgfoAONYTfjVOGanxVc=; b=NpxaaUQ8AJ4qBt/3El1hBHQbkaFQJoqGY1McOAYwM05zQkZpVTbdiYuN4l8jnXvI89OMzqSfORyiw+6T2pLrrvzYidzggGhLXHqXdumGAfJ8ZOkV8T7POgtazrQccQIc2VEglNUoZuNFcfYDyxPe5QqTezjlEMQzd3NKq9MwyHBYg+dLiEcnt1AQCsDLm9fmvu2tPZpzUQS2bqY20ckzz2mNeUDemd2qaNdXzUiw4WJAN8Iy7gwZRGdumPqa95NtJWpXxQhrr1MvevSZpWWLXXw5OHdXfQ4dMaECLisjk6LuZb19zWBT/EPd1bBFMP3Q9zmx2KK1s5/mitijv5uZpw== 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=Yw7fcRxpYZ9J6oJGkqyxkI3QVgfoAONYTfjVOGanxVc=; b=apmptP5Qhv1/7OEvo5aHCSY/Q6NDUg0qoMdLF9suqIfu7GrGS+PAtgWitiZqaXwEqJH4A94zNyrc/YO29x2VTgnH+Tk4A0cqrRMAYwS3nG/y0scD6481henac67GPkN/3Eh+I+MvmVFpFu7lyvyxsDjA/jfYFzRNcxFiY28YVMD8NVeQTByR5iUQerVQbwJdkQa/ZVqbnowoU6/L4zw0Zgqwle+A0eRWMzTsu0cvpI0YkBXRH+HKgvrIlR48SUihYz4pBTNtWrN0PDKZQiUyIJ0MFrFpgqglP+k980TwEUaXH7wcu8g86iREvmgSHukZHqPZ5WtLaE0uqRntEAeIvQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:36:56 +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.6863.032; Mon, 9 Oct 2023 14:36:56 +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 v12 08/10] migration: Implement MigrateChannelList to qmp migration flow. Date: Mon, 9 Oct 2023 14:36:13 +0000 Message-Id: <20231009143615.86825-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b2a29b9-08cc-4ab6-6b58-08dbc8d52ff8 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: NRl9lpUPlZQJue1msb+JnSPhcZL8bXUvJKN6Tz/94cGoqu//DW38ofRiS9Uj3LnwmKcT2nRi1HKqLVf2YMSHD84N+det7ByCMTZjyhey48CJpbvgXTfHfNFfyMW0JFvHXFPo6xg4ippCkbTPyzNqxk7BD2So2xvguJjxzOqGFEczZD/PFBZc3I1TAwiHzs/Dotw7ESDdvveMd+gZnFKVBJPeg4akAFC1DSaDSAbnIeJZz2u6F6NSM41F4tD9BXpbc5aMH7uc4RHudRZj7gJy3PbujhYi/bF5rmchAHgX0SH52saaEL1fe6PIcon/qTSfM3dwNTyXteaB4cnq+Qnimt0nKLEEUd47T5k02tAF4RF9arPuV+1nG7IYBsQtSYoTkrPgcwJbrJ+RjZ4dW8X6uiYzDGJv4YfXE/mekhfY8vItq6am0Nnpezz6D0gSbpWS0PZIcv26UclqMJc3wjcTdxizYenHbgcnIHieUQ5F5y5HX7EnbO6xXco6EDRzQ0T+saB+vgz5VQE9jp6PEvOzwgzRcaN5gMXVYh5Q3vYLO4xLd4mdHwchHAhavcU3swAZUUA8l+cLLAjlEprR/dsQrxJXJ6iRrerhpMNusxnkqWASYaSF1maGtZbiVdV8n7d/ 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(83380400001)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g85EvweBomLvUviR29zP1q76jjy5fV8fDO9SWWSesE2Rp6VRqWAodlMDM+csKJb9+swJtyj7qeH8BXv/fzY4UxM0p5ThqXoP+hT8KOI9UjBxXn9Qlky9TiuGXtuaJTRtlw+MnSkG9gJuGEwcTUuY4e+xpZsjOFc45ULE86YbYvpgHBkID6h91H07okdKXdd1wBiLi4Z+oteyB0d7gEXKSiD7rCVCoOPKtFvRuzPXJSg4eULaqCfgpskXERNxCfTPEhzma6Q6dEnC/r5FKfd5OpOMUQPChqiDH1fN5ReWFbriG4cFfYrxe6VI1qeSYBqwYl8wXi5hzViJObDvHatc2/OcwGee/9XDRSYouXfrQCaPycFu1b1LLE+d3YoKJmYGAOzRsk9Dk8uD/2ayvReRQNvk6GJ1Vqs9mnT2115slh4syKy71Kxwod17G9Nw3ZOoRfejW4DYCXP3swI44SZ32Lv6PubidFm50IwJFMvYv3ZdRnNk23aoLHMPkm5sENjKCPhgLltzUb1jdK1nuaU6jW/9NvzbRttWNaAVBB3kRvQoARFJwgF4/iDaaD2//O+7Xgm9tEmxNWjHfguAwfGNPk9najfXEXQ1EcAPRpbx95/wcCenBfcGgS2aqFkkQ397LCvw42rIlLXxJlAyi//TTQ2woFQ+hRLz7WzR/CEDROwkC/xOlcDQyAcN8uapg+5x2Ee9P8ZGRCAqU/O3l0KgypvjG8OLSmYfvQZLIfaYVbpmQiTkIUwoXTirL9WvdYxNBnTNxzJ77UWtqZJ/n2rFhXyheNYFufIkANs4wznsgwHch8uKSxPT6IDJy+fxSW8MLxgsv/gwUIO/UyOfGw50lj/gIovObjCuf9LU9vya2G7ZTrLs8vtWXTv97XISNyc10wNB+oEzBDRTeYisGZoDjHZX+/7zSXvcVYwUx+YDdNrgy4SQbXb7V9BTvt1q9GisERk1yf+/nkg7qGWu2+UbORgKNJL4npB+C9Sst7Al1FfDImF6Q7Vdw91vvSiBaXKqcewOkjS/6xpwlAqp25RxwnN3P9hfyBiY8i+7kGE2BvlhCN94DOuzSV/dHDxnS57zXjTpcSM45Ld/h1sM54YgltQgWu3nU/ed2aYsAQKwiHhqmBwuRcIXYWgn8LQBSWxc1MRG+6/5+NLZ1pvdKrHpUjawhnt3kCZ63EbhIrj5Vj1pEbeMWLFUZo2V/UJncA+cUO47e10O5UTYw8zoWsFVjQE9pnuoO3L5zTOks5XOyOjKru1pO0eucv1wRBTCJod+rzha0prLm8JkcgRWYjTMSezypeaOKnYQLvwJQfJ+RrdQln/+FWZEoFasogOyUMUCPyY0Ku80wxr8c+0j4xW4cHZQZVZ4nzn6ao0yriVnUESQZTreXx0PO3ra1KikdnR9Eeaex3qHBNEgOOAjQqXAJiQOwZ/GNDKZ1mESeHlYANG7au4c7LzbP6J4auqaiIMysxlVzMu04Bfmdj7Ite8+4sddQz/E0W28+JPk0gW/Bdzw3dLdG4DtxgQwFdoaxnzq6hTzcOc2+5N4jnNGItPmKpfZ4MD4Gqk8HBGw2t1pcIc+GhtP5vvPj0MbuqF+3h5idRYvt9qNC3nLIAhHMvGHPA== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b2a29b9-08cc-4ab6-6b58-08dbc8d52ff8 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:56.6050 (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: dwpcIcDQQ6A2nKmzmxKvsL7MYif55DabUfx9y3aZjKZywCcgv4DL8bVUM+5XjU3/fbVL0NufmoZyyOF/8lltgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-ORIG-GUID: eg6uuh-CEHDZAFgb9jXPjdidTo85baP7 X-Proofpoint-GUID: eg6uuh-CEHDZAFgb9jXPjdidTo85baP7 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-09_12,2023-10-09_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 Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for qmp migration. For current series, limit the size of MigrateChannelList to single element (single interface) as runtime check. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration.c | 95 +++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 23c3a1079f..ff04728b33 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -433,9 +433,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 = NULL; InetSocketAddress *isock = &addr->u.rdma; @@ -473,7 +474,9 @@ static bool migrate_uri_parse(const char *uri, return false; } - *channel = g_steal_pointer(&addr); + val->channel_type = MIGRATION_CHANNEL_TYPE_MAIN; + val->addr = g_steal_pointer (&addr); + *channel = g_steal_pointer (&val); return true; } @@ -482,41 +485,44 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, Error **errp) { const char *p = NULL; - g_autoptr(MigrationAddress) channel = NULL; + MigrationChannel *channel = NULL; + MigrationAddress *addr = NULL; /* * 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) { @@ -525,11 +531,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 if (strstart(uri, "file:", &p)) { file_start_incoming_migration(p, errp); } else { @@ -1756,35 +1762,38 @@ void qmp_migrate(const char *uri, bool has_channels, Error *local_err = NULL; MigrationState *s = migrate_get_current(); const char *p = NULL; - g_autoptr(MigrationAddress) channel = NULL; + MigrationChannel *channel = NULL; + MigrationAddress *addr = NULL; /* * 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; } @@ -1801,8 +1810,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) { @@ -1811,11 +1820,11 @@ void qmp_migrate(const char *uri, bool has_channels, fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_outgoing_migration(s, &addr->u.rdma, &local_err); #endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, addr->u.exec.args, &local_err); } else if (strstart(uri, "file:", &p)) { file_start_outgoing_migration(s, p, &local_err); } else { From patchwork Mon Oct 9 14:36:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413832 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 DFFFCE95A8E for ; Mon, 9 Oct 2023 14:37:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNk-00044e-J2; Mon, 09 Oct 2023 10:37:16 -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 1qprNa-0003qY-0B for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:06 -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 1qprNY-000384-2U for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:05 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399DaBN6001999; Mon, 9 Oct 2023 07:37: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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=z4Iy9RE32w6Qfo9PK472vq9yuUMO8SFEiuW9Mk+9t 44=; b=XEfsjRXLrui5AdVRPqW3l0/lXyxqhKumMWNWdr3eGkiM8FS0ZEMvc66L8 AkS4bBDGzEATjjmw0+8j9JQf1YlnynpDOxn3EDuMph8/Ge3SIPDNdFbSSglZTpil 5qqACG2ndJGCQkKSa8a2c+J1fpci8XMXO9l1UNcSU+V000eFouhaS7zEsmcSyAGx dY7ljwNR/z6HCiuPZgSJ1IWzHG2wM41S+bPQAX9GNt++PZp775x/99HXqaMs/xLs u1Lu2n+P3nyXzal3tNbvc0opEeVrg90mDhuJwftY1Lt5yog5zICaiUz3x+YbzWH+ PXmbEZ/YQeBmyOU0DKInnmQsZCSEw== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv02tm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QvAavqr6CrKXT0IBX19q1kwiH5EPJDZqA9vcnTmj7cXIMj1Jrn60Ar6yfBElyftZEL9YYfkhmseXTWmqJxLylNndWP5/jGatFg6mC49axNScA63LL6vaqtAM7+wPC0qjz0Ai60ml1mZvM79ysVSynshXqzFYWf31kqm5vVjOol2YtR0p6oEu18FTkKPWMmeT9TFcppjROEBGJFnyjK9IiPxwvRICDTeECqMYsFdu9mgKUIxCHTysJfG/9cMfc6+O4fqQ2qWAAiCLmaZm0J09iAV2ZCClwn61x+ct/V98yTsdhdHrX5zG2l7bNeiSJDvBUgaz6pjkpLTr6akq0wRcxQ== 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=z4Iy9RE32w6Qfo9PK472vq9yuUMO8SFEiuW9Mk+9t44=; b=VBBKYp+RFVT1V/poGVvcenGnqeZP4oIVFIeUOaRKg16PU+Eu7Pajs+srKRCjZgYV8X7VNYdTlxh6mSKu+MQoZO5ML+SeKkzPmNmkMpJVL1cqMDxyr1vR3crIy5MrHhhaE3Pr9h/9Tn4Wi2R4QGfm8MMpXGL9EGj/tPz8ouIV0oI2oAwJfIJv30lDe81yX930OPX3goCFWr10ywhsTcFmF0V/ej84jeTx/WoH6n/gNh6UMJLF4ccW2hjoCieLEKq/eYq3Fj4oifh6PkR8fqFaqmUPcQkWEUj5gZdNqrzaTK6Xz5NIQK5H/dDVXNZb+JOAycZsggwBXp7Qtixs+nQ1VA== 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=z4Iy9RE32w6Qfo9PK472vq9yuUMO8SFEiuW9Mk+9t44=; b=Ak23RTf7gIuXKPZilRiWMZrr4hWa29hvOQWJs4STalf+WVjXhxRNeVvTVh2kq+FQGMAl2nNWFDdsD4qTkU08oMNNa42NFKd8H50HAyykCyb6dEs3DdcWR2LGe8UT789GsUEoMTMs3sygh6Rev3k2gdrAHkcr8/MG4TtYlziDBvTCY8lezx4hqZYM5a5Dgcaq4rjrEUUxHMHEvcOhDO3QYWyT0F33rSY5KQy/dfI8cme1Ajjd4/mP40sRNwNfgbLjhj/cvvhRkThUUKaYpwPAFXjyX0zvTc4xon+9McJc7PxbtJldgHv3RVP/xrN9DNOnv6fJf7Tb3MvqT27LBYe9KA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:36:59 +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.6863.032; Mon, 9 Oct 2023 14:36:59 +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 v12 09/10] migration: Implement MigrateChannelList to hmp migration flow. Date: Mon, 9 Oct 2023 14:36:14 +0000 Message-Id: <20231009143615.86825-10-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: b0ccb2b8-a8e0-4d05-fc57-08dbc8d531e5 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: JPi7ZVpB7uGzd2Op4xElZbWEnRGDd06wzpXRyGEsYdvz3xj8VPHYFP57vCaNsF+Lc3wOrXU1mGoBgxrXIwH1frqney8YDhYE9sEEVJ7soE2zGE5YM3WgcdxBkvrhHxRNt+cj0QUAXrDB/cmMY7CGR0NWJEM7SbE5v3ICjroaHPu2kxF/3dSpe2jhGmSFCjXVJN8xlRANsTuZ/euafkFMALCBrgcvTMRDlCRStgZwciT7BpX49koNDYGEdyivVgFqURCTG0YE3Uee1p2Hu234noz0qNagTBBVV0CGrJzRVZERbXSIfY1oudHh1MqNZV6GYK2Z6m1VIVOLdOiB2puYjYqr7S5PKE3aXbT9kBNDO/0SV9akCxntghW4zW1PltWmKaLvdpom6sLjSvBOMdWd+mLvzd91BRB5FS+ErEEKCpG2Fo2N5k9VU1NsJPcJXbhfyb/j4CCNEzSsCkxlp5yYXfLjgjsq60+dsZWMWvE0LgYzFCzyVMlqL4G+YaskphCYdfjyy0XvnGbc8iUOkND+ldaBd6/WO+D687XrqW1fFNMBXACBfvrCgBFfLyHkDcmaToseeRjROoI630LRur+JkUK3IbjDmhB8SuR7OIjX0ydUu0eZv9pYJTaccim+dha15HBObxs9VhUANvEDYeKvRw== 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(66899024)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(83380400001)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WdXTW/7XJTPptQ3o/OpZSagqXdCkYTHRCTwzYy/iCo4AalfVbjvqP2bg4cJQ3bQaOuoTKHZiePf7y9z+WVL0YJH1+4j3gu9Nk+A9YH/xjQKayecyxfo9FWneEJYWD6V57Dg720kTdlOQuBYbbTfAEDkXi2BqZYlEs5XpzYFAlNFTCl91O1SRwDp58dFn3T/2BiIWwCq+ON8xn6EAtg2JltabjS/XDhgBLpnOJkVu94ukBO/lkJT4BD9NSy+u5YM0VatR4C0p/jVlOJwvqVGitCsNrTGgpL7kyn6KWp1mQo24FNhBm6VWsP1cYPMVu0XTjUClMuLd6FX4m9fTiZtFai8Vceruwgoy4MCMS6W0QaEKlT21SCaWHj5hQ/JCP8e0erSCbdYlD+AgjcfSinvznr0eugMq1tH8apXv036Asv/x9u2gS3DnEwYpcWjF6fD8wg8Oa4XDOGzNZWlcVdfjlQH/V/uKTbAsy1gA299vpFN3+T9tR/KTsLpWSj3WC/BGNH9FsFfJiB6mN2nNbXuihI9yECtjIyZVVOigVN7v/pUqwQ/QF2i9nqRIwmVPky3Wvo2kYs1lndN0ySh+tet160pRmMTHE5V47jDXiv69kM5av5Dcx1xkcLmFFKMVZWTw1AbKULtboWS6ecMlwviIGzfsQ9idjkF1+QL5ULkPxVHIU9AacsafEfF4nYrceX8kvfJQAtra2uVxEZmRWVQ9yScS03QpZDHFfYgTYNl5IkIQi2T2/8xL7eQ2Elk74R8jbzgSWdhpkolWrxDULQSLH9WMHWkuELC4LugtW2I685824yu1eFAY8JbUcbNP5/rJhBUusKAAInGGrtQzftT/89fpSrXtHjg2Y6HytFaPppOSADs6ePu/1sF3RXIZIbbdwL1hd5hfyyCp9hc2pWmPh7otHWdXKZuMGOAFCO2BEmhlqCslaSDTjsTHTOV5yuillqj4y9+M1Mn7R1Qdxe3XApazT7QOII39PqlxVDv7KCS+83qhhyRJeNl44//yeDQl40EalEJWE/mNsnZ9TW+IV99+TwCTwu4duopfpz+eGdrr+FOkMeIdenq+nY7eOrnhE1hWWNXy7evV25hnvQBOG7t9SqCXg7oDoBIACCO7GTqM0SsM98tm/YqeoBYiNMA6xJ6moaL9OiRu16tbvC/0KjSSNqVllusob8NsZv+j4+39zS7lzjIhI5i2aFqubBVp2qVahvn+oWYiAGBeyGuQ7OIfPf+Hn4SKVQfQDu7h/NvFC+fZqWzgnBwjImBUoERtVk7/d+RE+aywuaLyE3v6d4deTTVCl8yrEIifxwuHkiNRIWljidI/7ha4CVdvT86paK9aFqR0S1IbStt+C1k7m0qGobtyQsmQncbONs4JZ+kmQcyCKr7j6BcVx5RV3fi4KZqd6Cf7FDcl63nNC3yxz9sxNdZLoVbsb+Cj63lRWBetZ1xdPeVxBLgNrcoDNFY+nNcP1AZNhe/hnBFZ9F0ZwRXL+BBysVEdcPnyGvrLjfkfl9LDVazqqg1Hc2Rc2Nd1evipYP4RLAAmcjF1YfOvdqlgySHFScpGberTC3XX3Ue7GBqSujuGZcmxHvtpET+7cVXypJ5UbQEmi7T9wmP7Kw== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0ccb2b8-a8e0-4d05-fc57-08dbc8d531e5 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:59.5382 (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: /D1dYE/dFUe6cGe/+sQqSgythRe5ZNCk+83v/zxM5w4EOjoAsFE5mJGRDXWb2Em/W7Z28RgrsYf8MZ91RkuOOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-ORIG-GUID: PaZoxJVww7RymDKtRx4ljGNSjIJKiqIz X-Proofpoint-GUID: PaZoxJVww7RymDKtRx4ljGNSjIJKiqIz 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-09_12,2023-10-09_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 Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for hmp migration. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration-hmp-cmds.c | 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..21b57f7ed8 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 = NULL; - 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 = NULL; - 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 ff04728b33..a651106bff 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -432,9 +432,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 Mon Oct 9 14:36:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413834 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 ADE25E95A91 for ; Mon, 9 Oct 2023 14:37:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNm-00040C-Mw; Mon, 09 Oct 2023 10:37:18 -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 1qprNa-0003qc-3u for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:06 -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 1qprNY-000388-Ls for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:05 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399DaBN7001999; Mon, 9 Oct 2023 07:37: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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=oRryHDDogfIGs6ux2dgBolOpYfIp3H9lPy70JbXBM hs=; b=e8bSyPPg/KpEa89dSWTIz656LpPWsZPIAGTA0ENrDePA5qwE+vLoTX8JM 4Jvaf1advM+ctICdE+6VRkaPTyAdTG6CMaYN5eMV2F7onVUNuBXFgVqMR/AFw8/P 5hEaoqldN7NE0LPUx6IOwJmiKJMVe/zG/cE+hqqzAeGDdfT5rFSsdfeX7FgmuJik ctLf+Egn6Sj19PSuYWi/6FO+AUscx1t/G7U7zExh6V33+dnKzPjs2gwG5SgK50vK O77Wp3mHjPmqVB5VohKmsarnSiFNXUNnO8CqxoOQ/GhFvoxgQKC2XFu3Pyi3Z8Jt I1f6QRHxU4dHhN8v9v/qanuIjZtug== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv02tm8-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AUOAj5OxUxU8nrCOjeJcryFGPGLN/O9ZF4H8bn0VxmeIixruJiM57o8psWZFPUArRNeLeabAhifruH1f5qAuwFV1iTUbHxWSXk69q6K2BdYN8cXkJYf/W1s6qBUdHFCDOL+rw9o7q8Ze0afM8rJMA2BpC/nfGXGXBqCHD2NeFbeINn742MkdbILRpGSK2QWfLvnHniYz7Hx4WllL6ddL/eGN+L2+4qZ2TXPpP1FDENbywfwb2YojgAijYPj4jCcD8j9nlJHt4IHOP2x7VFPPlnonSU0cvpWqCYhTvPiu5qn765OKejLhpVF78MPR4oOlU6kj33oV/hnyb0zxgzwSQg== 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=oRryHDDogfIGs6ux2dgBolOpYfIp3H9lPy70JbXBMhs=; b=JS2qsSS/nlq6eRuAh/GDmrGLuYbHrsjEti0mQrHSYvyjGAc3J+RQPLJ/CLg213VX4s+uscp3XswEZZPmh0ZFCmzVQ6a/iZKYRXTpp4xG/JudKd1xotr/rpHj7m+3ekYd/+cODlXUs5vT5oyKLgloonMMox7HCOjvbWxbJovVNhorxkmZ0o0zRYgfU4u0GPZDcdc9kAefyHDEa2Rv/XYrNNFCsnc1iRvNbO4n+3OU4NKJjDmrmkZ6uZ+lW54wTXE6VSnAHX9k7fRPBcIVZ7mm0DUnGXBDgDbB3bR8cdvAWqRZiH9QX3Mf1HwWooljcWgutKj3lM9NOX+ClzEP93FTfQ== 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=oRryHDDogfIGs6ux2dgBolOpYfIp3H9lPy70JbXBMhs=; b=krz43n0ub/Ok5IlTvueDtLFBTEPPW01EWHhPOdZfTemAluXO0c+zRO1CVJXcFirJ/Nsp6NvYSG3GdbmQ0V0vX/s/SZmTUdA6Cllm41DLZpPBNVcz5NkLcwD6tNwvdXCJ71KnfAdXIMhHtYWkYTT1egtr+JNVFK4o+gjRp69fD/BnUA/eME/bXc2+kovI9t9rXn3z+njinQVUMrJsS1V0ulQ8XkMG18HiJcoxUDS6ZJJSNSdHayEd7MrO4Zq29CGwDBVp0P8ejS/Q42tCw0ftyjjAUvj++67MD+XPcA0X4AzpX75zuw3v9+lZl3UsyvU1snrQuti33QvpsLv80096oA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BN0PR02MB7888.namprd02.prod.outlook.com (2603:10b6:408:160::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.36; Mon, 9 Oct 2023 14:37: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.6863.032; Mon, 9 Oct 2023 14:37: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 v12 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax. Date: Mon, 9 Oct 2023 14:36:15 +0000 Message-Id: <20231009143615.86825-11-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BN0PR02MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 28b4692d-6d5c-42ef-81dd-08dbc8d53306 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: GiBIyK3APyVkIGiJxwLLUqneCpIOnzZI/k56wWw5vGpv2uXPbE0o4+7xwxZaJs0tX5LkodQbMkwBK7W3TW5tFFGv7dZK9SEThoqejKydjZFH61sQvLZKIr+QAMk05Lk8N0ql1gOdaDDCW+jeie87eeUJkE30a4fjNWhyWHGjvEPmLMuqHMbRSK+C38XdkKLoIfYQnoJ4BID/DeBTbZNMntEFBq6eSx0fKNWzNBmtH8NR5gyN76wWXF0IkFjF5kDfggQlL+PtplhV7I/kBWCdkTLIayj8hRkdpt/BiXPp7iB1OchJtFVvFzv9CgMPc0cdCiR0ME12pOeO6BntnVBVxydn7iJoB4aQwyWmt/j4XvikZZVx6o01iXF3m0yo5l7FxskVVAOyT0mt+SCKyvmku7TTrMd5a+332gfI0JEGaRzetLVICrMiBRV6LDlhvDxUerxr0BHhbYpqS1ov4wa8rm3xW53foKCykBcRAINkeClLDho/iIic6RPXBddu2U87PnfSt3fpUurZv4qB0v/2G+Vuxb5UeJiPBVq/HQwII8Me3NRNzsSZf8htBQxLCkI5tKj/5QPj2GuEj56OJe0TcpF+Wr75aYoL1GULGnZn9UBS5GzxruaN3Z0FEKd2Yu2W 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)(136003)(376002)(39860400002)(396003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(1076003)(52116002)(26005)(2616005)(38350700002)(38100700002)(86362001)(36756003)(107886003)(83380400001)(4744005)(6506007)(2906002)(4326008)(478600001)(6512007)(8676002)(6666004)(44832011)(5660300002)(6486002)(41300700001)(8936002)(6916009)(316002)(66556008)(66946007)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dtShxeLk5dP3OX4a95aEOPv/+wXE0HFHI8saCZyVX6fIo+En3akJFrPriVH81UYSdMhhw90uVUY4FgavwKAZP6mCDZjLCcOkMU2C/CIF/bZySMthnQXm4IsF4wBYWMqbVS6KsR5bQcFFCgH4yga9Q7yDlD76XlWwL8K7WVZBMFOStfh5b/j72UJEfEnD58+XAzDbcQhI9Q7PXYq0n1Hdg7UAnQ3c2NX+ET+7KRZA8P6AzGjLfzf8xIV79sFbFezJjaqujnI2GiCh/itVFsU7dM2wCPTkt1VZnpKX5gs6iZn6YelQkrZbQ4Yugrt1we9BWdyJpQS+Nw9Pz6WJDKzjEXCUSlpUVnUNYHnLKuzhyyLukppv3b9Fcg/OJx7vUDzMRoHmTYau/SnP/4tyMMWmHIezT/rR4hTeYmZaDUJn52jiSnT/YaK/rEffn3wEfySvNfkAAYC9WJ13VvA+CA2Z7WwooHoIkVAtD7MSmyxPiyrCGC3lOK7FXKEAFZTMHE87gzO5QbjY/p3UrD05q+Cl4Ceh55rRfqur4khahQrKlU0pqqBzQoXpS8dVMz8kztttrzFfLxPqkWhfvUFW1c4TW4ybLhqFLAeJCQl5HWiQryC3caD3qCQA7D6EZnKJc6VH4mSNilKI9NXb71rpBguaFbI2NsAymuCUBg4PSM+V+U9+dRf9/FUk5s8mjQc2UMGVLllig0S3ttLAN8HM8e8tDfFHF9L4Qh/dClcLaMMDWl0qW38/wVpgjDglzNKTVFSh8aExBfO/CiCguB78zNorn7CTx9uIkh2GZ+cWWhD4nzNTxk5TZ1dkDL/sMOr34v9cTM57bOg+zKhSGrpFuzY8ZiGJ5ClXLdcTV+OJDY21BHGLVArnqEfR7qtVrOnFvMnkkamd1gyG1/Ux2S4PIlOi8YjZM7+iY+FrhzQswqMOkOtiqvrE0uu3Lbm3Qed/KAGzoyFIFg1extDZTErBP03oAN+/0hOOWVIXuXV3wSyd+ccwSEdOZ89GGUtFZRO8ap1aBn7etiVI8QUYOQYWTT4ZSgU4tujske04mqnDEqVafkuVFC9m/qo5K4UNu4OVvyU8gjsi9Fg4Jm+vNaYyJhJLb1Fwa5pmWmCRx0lrj2SghHaLYdiDYeVsFGRFhacizMTohIUxsq0uX6M7FNHPqI0lZUx/ryZ7awrZRfPZ51+DDZmSSOhr/9+wAijSrbVunPtfSVKAL7CWgLLPH3wv91FBaBKS2lV/6TZHCzV0LLPDGzzbD8x9FDsoRY05PLgjgJhd6dsafSegKN+J6tan2kaktJTn3zPpC3ZmExyml8KpYtVAe/wiBVxysyl2nd3tgWDYV334600zTMC6qVFK3xYd70gq44Iwf32GW1Re7aLCj8yPLIp6oTrV5ZMCJbEkg3HNhxJf3fC/Kgq0fgYVUhDYZOb4Pjywdsczf4/1q4imeqe+DqhxO2LEFN5tjO71ZWxQoz0XXVXHIrqA1Nprx5eWz929Hu4Ll+4W1rXf/rDhDtYcUS7sjQEZwhn8Kf0hSmFvdm68+qL2LdVYfQqXQwXLzBXphVvpSevfj+HsmDKlgtwzTb6vWCJ7IlzGv+QTOnwby74h+w+J1xGkwdOcCi949g== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28b4692d-6d5c-42ef-81dd-08dbc8d53306 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:37:01.4058 (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: 09h5rJi2kOSetLuGgTnWglGT5ezohpAPUDtHW+kinNrXjEyb6lSVx9NbimwH+TGq8yYj4jLsyPdPe07YKwyQoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB7888 X-Proofpoint-ORIG-GUID: SWPsBW3rPsmhFYMN-lPinAic35WtyADm X-Proofpoint-GUID: SWPsBW3rPsmhFYMN-lPinAic35WtyADm 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-09_12,2023-10-09_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 modify multifd tcp common test to incorporate the new QAPI syntax defined. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- 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..7a72e1ef03 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': [ { 'channel-type': 'main'," + " 'addr': { 'transport': 'socket'," + " 'type': 'inet'," + " 'host': '127.0.0.1'," + " 'port': '0' } } ] } }"); return NULL; }