From patchwork Thu Oct 12 15:10:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419361 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 E0FB1CDB46E for ; Thu, 12 Oct 2023 15:11:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLN-0006GK-Tq; Thu, 12 Oct 2023 11:11:21 -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 1qqxLF-0006E1-Pl for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:13 -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 1qqxLB-0003eZ-4a for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:12 -0400 Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 39C4qA7q004840; Thu, 12 Oct 2023 08:11:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=pAGiFdX3isrHf5p9/e8XtZ+HitLl++eCbY+reURe9 L8=; b=MrcjnHAsqGBHuZL3jTYQGkf1QbHxuHo9YxrWDMUo4jUzLeOq+g0EfdVLH tSEODCIGSpqAqgXimXMGZVhcKLYJbkPPYZEikMPhbMxosGOvknTAL2TZ3uvnzM73 M1ViW5HmcOzLFv+EtSbEjj4jiUFcp2RYQWo/luQknIR41Q/CWtaPhcK7NApUXwPU AuaRTQuEi94xNVMz8dnjITGuw96U0pnGjj+MMDZZxKfz1bp8ep7yzELN1Oxg7Gh0 SqNSP3RvZENGi8CNAXkOgulx/FfR6YONpzxXoaCqAFXOQE1J5+sV1AIdjKr+65nD U4UupzvDDEplBU7hK49kTi+a+D1ng== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tpa5c99y0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NlNdo3CKl3Gj6B8d/jCYAntXPufIjsy7HwjUshoLGhFXguwsqR3whuHd8u3z89e+TMl5uNo5hg6ejCefGxHCfnF14Mb8lyUUoGOVnAp4JPzgVxunNK94x9MB5+AE/RKbQ68rfJ9jT+EiHWPXh1DiiIzb6oX0rVpgmG3wByP9HXW81/rx9sKGowE+7bhFiros7gOIziiejLg/9Dy+BiELHiZJSkGoJq9297yGd0I6WI4NqrW5m1u9xUMZTosKk8vbmklETOoFgSn2hDT0G48GBujrdFXsRs5h8Qdakv3UuObf8EVIZSNVb4yR3n/XJbMSIUM5nRRRLCWAX5YEp5rVbQ== 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=pAGiFdX3isrHf5p9/e8XtZ+HitLl++eCbY+reURe9L8=; b=fLjXbqaxkkszpNbJIk5w2g6OXgolD9rDASG6EAbzi79AQ7BDEo5s0eEHng/IEdkQgOCep82qjgRv/qUImYqHBHQnlUd/ReHBUYwjK42tTvs6O7LGzE9n574+2D6TJhMHRWtxnTjE5V8YTxnUzInDNG0IEZ0pFShe/cC9wPNWkAuXtH8ieGU785AkQmgdeBMT0EJ4v0WpQegkvzkxF2gg8uagRUQytzVMEw8sOMTqWMZUS33ezOpranIhmwL4f20JFbCgNr7Y6uOgJbzTBhzV3POrju+xFIRkdL9muztHflKTvA0138gBJcoEtfif4CwQxwsDlHiJoJYNUJ+1iGdeug== 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=pAGiFdX3isrHf5p9/e8XtZ+HitLl++eCbY+reURe9L8=; b=y8VozMzzHbi8kH+Ym0e95+fPiaqHiN7ZXNx0OqgUBXeOFaiVBxz60093CtnYCOoqOJdkmmv7OanAdwtgWgHeFFfax04zfxArus4LiL6KueQkkr+MBKt+P4Ob7cloZ9CXs/+YVDBsxl8B1BB2hetY+vIdKL12SOcdnmVnc19wA8broQwpUxudq0Usc1qVkUweVvapzbJ0lJXAnXhMmaFtqd3B55h/UnajNaFqYDmuw3xV1PL7LTWbywcSPFKCPF3bCnwmXrBe40YnRoyGVYXSFmmyKpAPw3yWhSoMhw4Jdn75VeuDdv7oS64CIo1kV7z5g+s2VUj5bcYfQ6wPAZX/uQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:03 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6863.043; Thu, 12 Oct 2023 15:11:03 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v13 01/10] migration: New QAPI type 'MigrateAddress' Date: Thu, 12 Oct 2023 15:10:43 +0000 Message-Id: <20231012151052.154106-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: a65092fd-e992-4635-c199-08dbcb35736d 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: +m12i0NUTqVtUtyN++DoARvCSBEYVtK8Izbc2poagYvqFw9RT5V++0TRal9KQ1CLY9NE9ZOjoMi3sr/grTKnSryA1HeHSkGno6yYg54VdQSxhHw0PwhLE5tpMGOJ3plhFwJCoYKHuwIOkKue/yegJFObN8Wz5rsotzGP4vYlachdw1lRpEeVZdpVUs/+V88KnHrmxX8gdqSSiKGXToXumjlUivvVivTNiTjcMXZm4RXS3/r8BotZaShVzyt2PUhjRbTaNeGLfvIRidZvhZzfzqIB+846EDzs4+Jv1Yn3RwKTyBH9j1xhEZImk8duSmqsnYRo5wiIqO+967fNc7W+Z2HM9ZbxqFz9fEHGGwqdoAG7wI8SeqFEbdTmvGt/LU11sR5P2es19qASBX9xfJWge3ixxfAko0a2XQeKyRKREnXAmcb7XXprXjbYwhxmqzocMaNFIvdxjxS9sHLd3v32rnDsoTgcwFlXZe9TRuTDokAEeTCyqKGQhlOGPG+bZy3m1ubroew5mOYI+s8eQEYunVLYz8t5i368Sr5vi5WvDy/TZOMk+eMqzIXMR1e9QnRfPjimTIFFs6jNRI2+e1ll6OQxi6OUO3ZfK3ZaUaMDIf/2JMIfwTowaRCvLtKdrafJ 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(66899024)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?krCkCo00G9TTG1gTIGj3gh+/41nY?= =?utf-8?q?xpNl75/Yp4gI/kPZ9RcLDpLYMyjarg1v/yXK5Tqf2l+P+96u9t6WI6CHOdku7+kFk?= =?utf-8?q?V/YI4bDJsR4TZeA4hPUWKVN2XeQVf7kd4JNELZvtoKSv1tuaIMUqepvfbBtj73teS?= =?utf-8?q?6s2opWTP3r5tAUP6J/iZFW2TBZCAKKAVnc9y3l9JprMXRcHbdlC1Mqq1VH4ZYgHKK?= =?utf-8?q?ZqstTEz1RUTSGQMWCj0DQgTxpwLw/fYsXpewHsfPEh8I+PjOAlZbm8/CrSF5Lz9p6?= =?utf-8?q?iLGqZPmtwPVTAYFv8Vz+L8kY2iK7LtxIueWBCCqnHMZ7ctb75X2x5WVtE56Ib4K0s?= =?utf-8?q?gIb2ghJNzY6dk4tNJ2+wzmBAqr0W09DelopVtp8dT+0K211MC9mQKw+p6SNBskLy3?= =?utf-8?q?tkrREbWqlYo1cFVdhzo/ToCIi2iV9OxduVMVW06DHtxADMtPF0w7RApPcVXYkL8R3?= =?utf-8?q?6YVGwXHK5hlywsUS2FvgiRpRbED0BvLV4p9prjn7fr+SFPlguG/MsMujf7I1as0ck?= =?utf-8?q?cS1Ib6H22k4fUsNq38ddm4en5aN7ck/rDwxx6YdZ/UQqlzU0Bf5/1W6zHaIRfJ05n?= =?utf-8?q?ODxmLjcRJyB1RY1YHXBUuI8z7dNinHunQZ+eAmME+tkQxyGAU0tg4zFTT0mc/On84?= =?utf-8?q?gTKYqbc8Nxkm29U33JGUHzRoHO4STxN5MMjaW/H1uHSVnkHToTnl2cThdIxBGx0ps?= =?utf-8?q?4Xrm7bO5dWaaYsDMBMu1ejq41IjDFeaeYO2vB7QEMTeYghS9XukMnivWRyW4vfG7c?= =?utf-8?q?z347rW66UmQEoRaVjQFs0hY3KYoz44PuBFj4LaDy5Q63hxyWXf41zbavvZPdTm7Q2?= =?utf-8?q?S5KBY9KfRQWmSVz/JHuiC2PUP+B6bfSqKt50GpERQsI55UQrpd/fP4Z1EQC5BtNpP?= =?utf-8?q?MrniOaO5bh36PPjT9d8LWeMjSy+xDIBGHoNsEIa8bjJ/0+pZmMY8oNNzKVc/ZOT6y?= =?utf-8?q?3EpEO+9XdAln+3JeOhyPLQl2Wkcw8rCjny1Zi3ELT3YoWCqlLyeLXntffmHYVmj/I?= =?utf-8?q?w0GzqpyaBjUg69p911euAmEmcxgygnMZTsopXu+n+CQ4Kt18MeE7DCAz4sRF4WHK1?= =?utf-8?q?+tHzjOsqHdpy3mULRyq6NcTntF/NPSYkaTIsAIzJhcRCUmlZeHm33jTX0rQlWIFHU?= =?utf-8?q?Cxp21L5GjmmDey/T90E0vwjMx60OFnpmrI1eG1GZtoz1StVx4ORCt8ce+1Lul438R?= =?utf-8?q?83s5Q/mxqFyDUDZCv/mI6PT1PY3VI48czaBWYK8KnnDPSQRJDadrmQcG2IbmV5lk4?= =?utf-8?q?GcrKhV1yED8U3iIeO+XELokrTpo/8xbXuxl7pKixbqVmtLIWjR36teT0fquWJAgvP?= =?utf-8?q?I7yc38+1DL3r+rHoFGvuqRdU5pgIWdPB4/Qgk21NG5qSI7QkHmf5hqCdKhse2z9Yy?= =?utf-8?q?dOTB/c9SCRXGTgRf6yx0p1+yU5aZxv7Nu7bdTtPxWSJHEQVaDneIhjYRpyjRj/RYf?= =?utf-8?q?yjWPMYRQD1hf5CFlS5xTe1Fv7E+kamz24syAKJgsCk3BfHTwxcEp3J+DGpCW8moW8?= =?utf-8?q?n3AUJwGcRauoyV9gkbjWEYGDSzEnGjvO7A=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: a65092fd-e992-4635-c199-08dbcb35736d X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:03.5253 (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: XYLi1l5ZUxov1mrh6IZ/mT88AQyDQjVi8ykW0lwa83qB7voGs1A/XVr+cgfKg6CDj8BckVL1p1rRLi29TVrYCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: Or_Dgn59q_ZNynKBlhK_5_2pkkKeM7p5 X-Proofpoint-GUID: Or_Dgn59q_ZNynKBlhK_5_2pkkKeM7p5 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-12_05,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This patch introduces well defined MigrateAddress struct and its related child objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of type string. The current implementation follows double encoding scheme for fetching migration parameters like 'uri' and this is not an ideal design. Motive for intoducing struct level design is to prevent double encoding of QAPI arguments, as Qemu should be able to directly use the QAPI arguments without any level of encoding. Note: this commit only adds the type, and actual uses comes in later commits. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Juan Quintela Reviewed-by: Daniel P. Berrangé Acked-by: Markus Armbruster --- qapi/migration.json | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/qapi/migration.json b/qapi/migration.json index d7dfaa5db9..8847def17e 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1477,6 +1477,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 Thu Oct 12 15:10:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419365 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 7BA4BCDB46E for ; Thu, 12 Oct 2023 15:12:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLR-0006H0-OS; Thu, 12 Oct 2023 11:11:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLH-0006FL-9D for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:15 -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 1qqxLC-0003eg-NW for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:12 -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 39C8V1QZ011765; Thu, 12 Oct 2023 08:11:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=DK0oY+2gQPntE/m+PTKpxu35lGkR9z7N492OTm2aM VA=; b=C+jokhm23GZ7A013MIdHPYTgFSRFeMlk8fh4dPXrSXT5HjORAcKE3l7uD kxmf6iymr5870A7TAKKfjb+o5aiQXrLpEpvNLybBsWBxfTpSPSF9Vg8JHirqaPfs /o4bz+sYn+kGqIu7mZ8+Es8pwKXrQ5LgzxYw2yEvNG9bA7y5WEbGNtQXxHGUPYZ4 FEmZJW4Hpc0euERMPmyTu+LNuXmUwXv5ooN3X+a0x+lwN233wJxnJ6wjD7os2/eQ TBsoo8Ap32unmALS4EeoQG0QyE1yh42hBkF8PX+DWks5so5tDpLjKVfzn+qZy7BU tmVVT6Pq+R6kEykHMSUqyq8E31wHg== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhtc3hc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VMQtaN/sLzYNYTVTV7k96ikoexuPc21ilMqWRMqrEnzAxHaDCixILwrORC/seSVY6brr0RaGRRRSZw4CVZnYMZbMK45yuedhG3xtOh28hQqVMTZKcbR0ukQtil5VEUi+2NtCL4U1EXHktu1vOKwmv/O2inr6IwjnCx/DYu/p0PhbvAQd1wp2JKBF38KPAM9Tdh4aPfZqb6fyitfke6iW94t0strFROsj8lUquoW4JCbh8tfLZNdu/YCKHDHYw1rcKPk/e/Bk0wfPf7+RwUSIarovirYw/IQPdSn+mmET+FVPjpvPSCbMlQYgLiukNI9unK/LjbH9E4sjZ7ssgIWDlA== 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=DK0oY+2gQPntE/m+PTKpxu35lGkR9z7N492OTm2aMVA=; b=PnevWcD/8XjGDXhZtVkAnYLYNBa6NSDKKJ3mQ1VApYPgkf47vAP51/X42iu0VQy+6tW6cxxR62I3SD8J+Pid6V1ljYIbr7POjS6y8Fz3RM7pKuBbcPTzgV4Elk1IXhc7ObiNXODaPNFAzagELuDEYeMxweqQa6N5GaxT8SjtqqgM/nCHx9vqFLuJ2RwGpA04ASjDXR8ThJZHuOoNYWqIpIvpdw+hEBM23a3/oAKe9nfxHXMQx0EvSOJGxSnXZSUlYFslWMAyih/Fjfyev0HHyt+vd8nwoLWVPCgHw1yPYudI69mBKIie/bd6QF0u2rZ52RVEf6+uAE63zkYRPyloUg== 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=DK0oY+2gQPntE/m+PTKpxu35lGkR9z7N492OTm2aMVA=; b=mqUYB9jhI/dWrlOn45iqlIvIdO9KCZ3e4nQ2I90rkOh9B6OiUeVn5OHVTa5CZP9qrONZzbn1NcMReITumQEt3FsGY/b7beQVgb6EUDsbyK1CWrROIoLqJDQE0bhR/EFGxoBozG2Hgl/P4gJpK0+ZIa9vpSNwuO+1J1LusqlAo1Vh/oZu/t0ZG0s1LcELuzbX3Vz1qFwf7tIY4lvpqHQULBkIYngM34Gx8mHXozvJLjr5Xi9di81JUf9/DR8a66t2ynC61qLpalGQ4ablxxN+T7IoWLLtYS+XuDBk2HENwd2X4fL6+k77Tx4O4A/yobWv4WTaW4Phx1aDBtFb/TWzFA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:07 +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.043; Thu, 12 Oct 2023 15:11:07 +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 v13 02/10] migration: convert migration 'uri' into 'MigrateAddress' Date: Thu, 12 Oct 2023 15:10:44 +0000 Message-Id: <20231012151052.154106-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: f8055b9b-8d1b-47bd-671b-08dbcb35756e 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: rLreAVATtq7qZOMSd/17gF3Aj86FPOLRYN1oTQLAHLO5S8hbOdFnQNBw8fzKUX12Rp/aAc2HtjDwc6E7gs+2zlq49P4NPA5tj0naXNFOAvz7JTRADjJou8QKzd8Z92BPGpfy3zR61bnlG9jsZoleqxfKpzkUjLwCWWONan0oDWB7BtCTnKYywqw8LdHRcKo/bZQ2g2iwkYTgpvn/UC+PYNvmYh35QzHY/lp9h0zb/vAV+qa4zfYwjTGaYFItt5gUgdRGpOddDq9tImA42Er4RVRhthfu4Zwwh4kGtB8Mfky0JVEHSOgdFMA6IXt3zkKG5GMZ4hM7DpfNFTedTNK824GzOC9imVNwMtuGAQR26ZI+uj+fnZfaeSc5Sj9Z22+JC1TaEZkVho2szB2e/HdmA/sSGC8SemsLJm6vCjtLRsvI1Zx04u/XrdYkxN3dsH4USwIU9budxlpS6I4RzsvWxWFB/T1+A3SbZlJfCIbvm1ov70XCfWpa5GIJMRgNW4Dcw4JYovwjsT69m8ss9aO976k9236FIT35abhKLI+O20DIZ+GknQ0W6N9VFdJT1kx0HcwmfgNkvrVjAwCzoQ5tI2CuzJnllK5amwaOpxViJs3SIn9gNLBFapYKb5bPEykL 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: quHZk8iWQgXgDC48lgZoFgWxB+DCl0/Uj090MZI0aLtrt9qhVf1Xbtcl4+AeLXpZq+7pyset/hFH5k+whanPEHgXesPyEmW+S1w56jzfyGsDyohEbvce/VUBndN0CXklh+dzLlGCTkj5vKA6GRofsZgPwtZdbTN9rxK6Kcz2ZtOg9LDBZSGb6ysjX0S8GbvURiWC3ZDIJE+gW5zqR8byi0v0NT3vkv47gDBHhnnV+gkkMrZgvRqRKWfy27/smc21O4x+uu8i0ckwb/ONX20x58UElk+FqgZOUbrbtD6A2Ct2WvKf9JRCSS0VLu22dyVJ2Zd0TcXXjK+lG/YfD6kSU7yACyepBtv6pxt7z2mwhyBxsW5OCWuAfn9EO9UiSUgftUeqbuiB8CSPh/oQFj/W3pQoY8JV4pqczIUBjHVy1oChR6DBqyYyMPbUe8zAFph4079Jhys0hF/EZhQPMs9jfq/hecuswa6i/yDPrh2mz+IrWpmRqe4TJE8ZkX1QaEHJtRycs0dusuftrA/qB9ygwLLrQ+XuIJOx7GgWWCWpjSpLZ5ZZrf4y9c7bUkMFg52itx+ce0gwuBFYEae+ZDtkSpkv4OkcyQwhYycZ4ZkkK4OgY2gr4r9bUXpBDvyXAgOtKNFpD5ZfQlr3NPbgnMUyN34WQ+tLefbgEtHwwoWwKTDtVzR7FcqCflc+YHSZFkWVEncl6ti50vMBk85OP1FSPMezRD8g6tKEBeXvFsoB0eVE2NSM/hil+MMpAH0v91nLXX1m0xsd4VwcRPlsj//eZ+Mge2PoI+64FSna3Ge6Tw0jCarFej5U2e+1RN6cxtvNoRM/CJY7pvqhlDirmW0g1QnV/VT9a5upjtO3KnjSQYwPpgeqsHDw3dn7cAmJO90OlyRJ31NT6jbB/DSZqwmoFVj8dzv3RT3XivKRL6qNm2FRPgnqwQ/OphHrd6HLiMqRu6esSg9lkQSHwPyZrpyHUOsqtMNWjRq4QAuMq7sMrvVXErNaRrgar2XE6iETDwA2+hFGm3eIKn2CeF7/6IAuYQn5UKLL6H92TaVJa+bZHIBNtQxFgbfLp6gTL4KUqpVZE67uIhsCwBuCbRs+WgXtj5aBdHiBgmEfO7Hc1/f7oYxZ88l47w/MS0EpBKrKE3KrF0ud9m0Gv5yCOrrg4rdTcdyRxNnvl4xAubZo8eF8OvLAoZ8s0tlbdl0e/4oRKvlElkDl8fgxxPhcc0Z8Fvii7iEl1FE3mCbF8JNu+nPqXRCw7ubipA7i7+TW5kBoGi6KA2bx5D7cZSIWdwGehTbywiX4Az6tYeif8xGX7prjslTgqlUlLLViMqz98vnXaSa78mrTrL00NKZ+Iv1Gp36dC+hFCfuuSjf20Fld8jpUYgWQfdS2tFbv1slhsXer2exZn7uSNDyhtj5QAqGHII/3e9oMZz6DPaCJX1K32O8kWwPMSo5MvCYtoRpkfZqwzpTXa58Jwb9hKyDsv7qnunpcIyNgV6FshIMIQ1Xuo7zsMTicmrpGp3Fn4tpqcdDjhLDI7QHuZkonYfwBEpW+4R8jKe2JVr7dllrqBC4YvGVC7s8FMl/paluPivUWg/DEFNP0gA2TS+awX08xYtrw3xjhDg== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8055b9b-8d1b-47bd-671b-08dbcb35756e X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:06.8813 (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: /qMtKsBGhITsGWlzeSxLmCccG7QrKUIW4GiEJ2dCOzq8rAnWbtyZvxNMejuLKPhMwY1dAvlQ8pkcHTf5hALCsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-GUID: 6XF-cMUaXtHI-vRMZYjnN8abyfZPHAVg X-Proofpoint-ORIG-GUID: 6XF-cMUaXtHI-vRMZYjnN8abyfZPHAVg 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-12_05,2023-10-12_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 1c6c81ad49..2637c76364 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,9 +429,55 @@ 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; MigrationIncomingState *mis = migration_incoming_get_current(); /* URI is not suitable for migration? */ @@ -438,6 +485,10 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) return; } + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + return; + } + migrate_set_state(&mis->state, MIGRATION_STATUS_NONE, MIGRATION_STATUS_SETUP); @@ -1686,12 +1737,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 Thu Oct 12 15:10:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419364 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 36429CDB46E for ; Thu, 12 Oct 2023 15:12:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLX-0006IM-T2; Thu, 12 Oct 2023 11:11:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLK-0006Fl-Dm for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:18 -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 1qqxLH-0003f3-2a for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:16 -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 39C6aYlY010625; Thu, 12 Oct 2023 08:11:12 -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=0RQrFi90qvf16l9cgoqtlDkVaEFsqlVt0Eiz3qAJA 0U=; b=c+wJeAMtS5KEr3KJy4qvTraaMJAhaXfj5QmesLH5lYbRFskUMpEX+sWHp eztfVDiHH9gDKTkg2wiigj+LVS4lIRm+VPU5O0i8kWSlARF7kQMR+Zwo1OYq4mul nFAlg5DYdjQGKXKz/v2fFosOSYErXz2iQhsFxJhb2vFkYH3JTV8iUxrFob8hNDwJ ZhdgbRS6t2YjLlVWSYMWczJT1IQDRqAXcsXEVzuMCuR7RPrUiI21vro8EI1bq0QE mRn2RBuCG6kbGOrVUclibfgC+qMtKVrMF4p5Hyqs0XYR80VLUvM58ke/THL0iS1L ayFiVpuRX95AI9JLizQZxXL50/8fQ== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv0bhrc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6ASYtsCkWoGJd+iBigdTz2CxeN5TPEAulURtXDnlUY+71mQ1u4Kb1q9qeCE/M73madxOmXUdaDLapYTJtWC1d0RRBlbwrZqjGattm9H4oXDW6Umu8Ze4km6aqvLM/0eWwqBU4Y8XpDRigGIr3jtCvlvVIbAeZLTqT5lVPwEHGHU5WBk1ahhGqHtSzjgKdHc0i/oHUpPE6YbWtXM3j8GlnNIlCaUXzImIG9R68uMdv64NHqwzoOZeO3Wk/vVRKIoRIqSBM5B7MrfWuD8QtFKgSekmBhdBYuoNLGzpkP1i43VdWex6Jj3UUGZlBtguBG6pCcy5xIxigq81kbzpMTT3w== 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=0RQrFi90qvf16l9cgoqtlDkVaEFsqlVt0Eiz3qAJA0U=; b=BxltQQ/oQrYcFqfoutZouKu7YHVftHKDu0FqskB02zLa8hC75LPzbvxTF1bHnMc4dxM//3FT6icfZgwnbN6nKcA04Hn0KAFCGVZ5osEEU2NVIwci4w9cXdmRwbnKscU4XTmWFlOygpx904PVP7Pb1n7bzuN9q1ME78FAeO/fOLNEc5qRo2BpMVr9KtCwLRrr3h7NghuEQWytJ3mFF/L/E0lQkkagkYzp5GNXomqJ2Rz+IpGALbQfG1ciGEByv5yiiyUxdQPWmvW0izg+N29tskWAiIkzC1uXcSw2QsSnYvgxAGA+nzg3eqYiVUaYdy5Nm21KSKO0FKJxdAZGSTPkWw== 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=0RQrFi90qvf16l9cgoqtlDkVaEFsqlVt0Eiz3qAJA0U=; b=ZZSZUZukeiIsx+vwav9pGuUejUXR/OXQ4qZvM0IDBXnieOVZLPzl2ZMEsMOg74isli1GmQlFZc6zEPqCakx6HxT+27hx+JskptuMwCAEEdXDPSS0nZQIWVX0HawYF12Vs8/sFouCx3Gm6bikLVyVLn0P/lwTu22gGFyKEoJi2bqBfbaeYtTZm0c7rS70eTw1x9EmWVduujMW1kp55Eikjw1z3RcoYUNLHidlMSGV2mr0WOPJgVjRdcu/bAwLg1gNZnqYaWK9ecLGiGrQm2VZcOm/n7Zwb9N7Cat+mw3+qO+X77LaGcOZd9IFH4lrl5fZIKvXGh3TsgHVydAXT+X1Fw== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:10 +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.043; Thu, 12 Oct 2023 15:11:10 +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 v13 03/10] migration: convert socket backend to accept MigrateAddress Date: Thu, 12 Oct 2023 15:10:45 +0000 Message-Id: <20231012151052.154106-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cf9b201-c4af-4b63-8309-08dbcb357765 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: GpOgQu7f6n6UMBpZmCglK8ttMQwyx5eLcWK+Hgz0H8haOnFlu9OLleXi2+6AdHzLe0pnz+Bjbde5BZS49FgnDCbbLP+DytxPo0LdZyXQtIJXUBzk0StEuPov6CzbeJ7KYwXUeeWXnZeK8HwgOru44semYptHCQuRMFzyrveqV2ke6RnfDdLL4OshaTizf0fq4231CKXh78CWeplZsFSn8JsCPdMQ2C7xw9m+DaGcqFPcxFvHbip4qCrZVN9xOmC6YTJsnpm/8fhN7CILoiCUAbAbSTVvHzM9gMDxMIs0zxZF/bg/WRol1V1gcioOfDqeeFGyz4T7b2nCzhBq5/Bo5Cgt2ck6j1SeokbpG2GNZ+3bT+NIINwkrGXgvrf59jfLTTdFBKg5swy3Juh4o26ixCT3hk5r/BFB/CjCZhEJRKuETULnQUuUvemJZeAvfz30/5nKoTIoIJjKHmptyub48ctVVJ2W/z628V9mk4xnNwFormoWR6rfY10l4FNvu8NQtMrBMVGNvGPnEqdoA52PF2Gl48jktZsbOXX3MLUZAEFqZcv7aX7lTDpVhsCzovf7ij5JCG5jwpEy+MVwXhm8jRjUZRacA/aDslpMb5xZ8aI9GRrsaES+R2xO+AkAvOh7 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?33ToY+gaipJfH63YlFizOuMxn7qk?= =?utf-8?q?vUm00Rf5NFOgjbECUzjaFVsJdv4BeAZW10boM1/7omTzTJksKcmjEppwjb7b+2z0e?= =?utf-8?q?T0/Fh76OsXzHOuckaeBDdm7OoDMDbONhWQBgBkpABXnkfR8vEsEJz3Q+kUSTvZIuk?= =?utf-8?q?5uzFh0BvQCSnZdPTmcjlrsZ6dj5C6A7UxathSZ3Aro6wWuk7WvGUxniFCUCwz+FlY?= =?utf-8?q?wxtpFL7lhL2SRuRbfAFabxNXUuIfVynuBEckO+AcKftfaE8klT03YnQa1xpMRUXaw?= =?utf-8?q?5upYyd5R3ucDhEGKWYqt/R9dI9YM8doMag/Q6rYgbRJ2wusgsdqAdv+GD4ZA8XrvW?= =?utf-8?q?esg4N4yDD8kepDuUo72WaJRH1tpOHvAR+KNX5xx1TLcLjc8uYwN58Yxlqdg3Esa1m?= =?utf-8?q?+nOSkdRwyakG3L1ubtYQaBhJD3wyV7MnmjiFTzgs46NHk8d4vBbhOL8F9ajYN5oXf?= =?utf-8?q?pB5BgxparkJ9HJumkn+T+uN/j5x35u3cAcWxRqlTpy5ReFCJe4ytrgZkc5me/Yqqr?= =?utf-8?q?0yfsFuaGpHuKQbvN6YtlXGyQrhe4o9JjjhRPivlfwWI4wyTV9lxZk9CVneOsaQHSh?= =?utf-8?q?ogzLL/AcOYjgJeeEUTcVX/wlQTc4QrtyB9YjWIsH4r6SSwwY3SqxTTQqEnenyhofN?= =?utf-8?q?vZxVWdt2d1DkkyXCesqP2uSBtYtXnwZ39lZ/OEwM4ew/+KF3AixLTaEETZj1K3FhN?= =?utf-8?q?LwwxnNRPXckeTuWGzhv2qbzJmCAcXSAmVT03hhndzM6viErwiSQ0vp59yRKpIiC9f?= =?utf-8?q?Ql7M3fZx/K/c9ugQ9LYptCsFmfMslxlrg4NCKhSbRtQoh1u4gheEr1QeyHHIeT/1V?= =?utf-8?q?2NLhs91E721Z56VMKi15WNVycyyNkiH5Ns9j6DJnX/sSALw01fWt/ZOI9LVlgW/Bd?= =?utf-8?q?n+XpwE4ohOBe/Vjkh9V2I/Jr8s0ZKRyppKFmr2Gj3zPRY5JErMbpSZTB7zGI/wRVy?= =?utf-8?q?/7nez8hEJ7hgjvIdPRK6ZJaKkgvgV8Iw+vX2P48kIJwAgtxWj57jKsMSTpvk+w+nr?= =?utf-8?q?jDNXAgAqOgS714yvY3Rsm81evM4xq+iBZNGtERrxfRuEv4R7xbPIVIMNakbdjMe5b?= =?utf-8?q?jMYuCHCs/OHR3RnEmtm91QpjVR/dgkruuky21ODQxAWgF9/VXaZ/29m5P8GNUbWsJ?= =?utf-8?q?PZL24j9+LKgxWHIQ8aNjksKqk8SwOAk93VajRozo6ltiCbjkl+bl8EMt/K+1zYfHs?= =?utf-8?q?vLGPzSmiPCCm2Aw6I64odeopqaEgDk2y1CFCwYVIKFLr9CS6jSjjv3teuN2q62136?= =?utf-8?q?vZLpvhLX5/Dxm7kIQqIIzpuPabIoASQOXhCv5QFrKSbyXH7fOB/cPZMfweJEAsCIw?= =?utf-8?q?/HfDqkSIjuDqGRwMm6QNd/B+GJnxwFKhe0RdRC2VRCecV1a5pqvsmNo+SD3a1tLDz?= =?utf-8?q?Ipt0waSjpI21Hot9kJoWpCCKgUSOjJPIY16xpt2Qp1aWkY2EHxN4CIvA1IxRORlyB?= =?utf-8?q?2FLbG6fX60dqtcgdFZ3Ovd9LvMbBu4I/5UqhsW9j/hNBlG7/HVe01W6iIK4NvOE0G?= =?utf-8?q?YGcDPWZe90fk7MR4fqqiJbjLpfPKUDLImw=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cf9b201-c4af-4b63-8309-08dbcb357765 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:10.1875 (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: uL8woClpVDCPiLy21WdeZ3eUmvwat2grwDfGGRkAbBS2julSO2MpFgbURT21yCUMJ7b+zefgbweVkbJyR0daIA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: oux5vW2xt8p248vIjoUdHiwenhz2dTiu X-Proofpoint-GUID: oux5vW2xt8p248vIjoUdHiwenhz2dTiu 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-12_05,2023-10-12_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 2637c76364..66eebfc74a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -492,18 +492,21 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) migrate_set_state(&mis->state, MIGRATION_STATUS_NONE, 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 { @@ -1761,18 +1764,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 Thu Oct 12 15:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419362 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 02D69C41513 for ; Thu, 12 Oct 2023 15:11:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLZ-0006KQ-Mi; Thu, 12 Oct 2023 11:11:33 -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 1qqxLU-0006He-V1 for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:29 -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 1qqxLK-0003fZ-6N for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:26 -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 39C8kUl2027098; Thu, 12 Oct 2023 08:11:15 -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=B8CPtB8VFlLv7xK4hwQmmZb5gV0TH5eYMqmt4mrAn ug=; b=VyDBhOVyTLAs7wBbWng1qDD/zNcG6mdLcAx4tx+7jZPzYw+WgTLZWEsZS CqqE7kGjkI2EEqarsPK23rujvKjvQhS/VIyJkXpzNe44y9fKDijvwUvgSigXjQYh 9LA/bR1uzbLYpi6dFbz4TcX4erFq7+GGG2zhWJwiIFZDky1RUYvwQyD34UOOKgY+ MbaHsm+0myF7D/0pbBadU3SHa7/p7Hj/hmhqMnjPRNKZ2w5MiETiy8414U501nMU Ae422Eln5lV6SVZP0X0EMJxFkkQyW7I4LY6Jl/sIZpD+gAYIDtXVecjoG8QKa1WA iCzJLAemSlnH1T7Hvq3/RrKntIfMg== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhu4ujse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GSoSvoIXce5eCtMzHq+pM5z4GEoR60P3CnF7mM7fz2/v8PS4WReUynev8pR+H3msZi9PvWcWZxi24kgFnbmv3uPHju6BZhHqQTjk+W7Zbtm1eDQr/JpyKGX939Aw6Pu+E/hFDkfxqLUvBGFXk19EiM4WpCOTVSLUAnlvuGt1uMGAybWiow+N55q0RcSG6yeXh8F4X1ij2hdEZcM6uN104UROTc+Ec1h8iHeycIasX3UqVJmtodn9V9S8fJ4/W5vTk6y8gipPGqJHMsrWmj3yZM8KHH7WhT0PR2/K5wEQZ2S2SUsB5yQgspR4LxAPn9drZ8/H689OvIvopLr24H849A== 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=B8CPtB8VFlLv7xK4hwQmmZb5gV0TH5eYMqmt4mrAnug=; b=mqITf1v/E9FsNy1rgdMZAQK77UH6q41VCBV7DBQxN+pabfBLU4mFlo1VF5QXqtlQIHaFWeNeWnAKty6y8iTM5mKCQMxkVQvpPeP93PkSSvf2nZ/iSVc/r89yI5F7UW57f8SHAyd0Qsr7/5hcRQ3Ei0gFiu9aUf1In9Rb8cE8meNwv5bHyh3ElHw9Op9iMGe12k8xeFfz+4lgsT4thtMjyzUiMJIfFl/q/vtmM+gnz7B+65hqty7kcEQ3+Hn8/bciZH43IN4lxRId1OVJObRqu5r42wq0dmhbjJBGkeIrnItHApqemSuA7zhsPrkH6AIeKaxabcxrCL0OpIUpHCgHKA== 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=B8CPtB8VFlLv7xK4hwQmmZb5gV0TH5eYMqmt4mrAnug=; b=fqDqWXnMnEIbjz6HXvc246OrPdBswD3gHrMGS0FtUq1JgMfU93VzvZNtBPkw9emkq8HFsJFPdjjzzvCFsfUZHDkxOSB55F/L/7g27JzMjq9p5rjkVnv2/67/69S3EUQFEUO3FoIO8Fmbm8NmwtThqFyH1rdH5evul3zyCmVw0SEUTQHJ9HmWV2QcTg9NPQ9AVmVJ05Q4ZzTxQF8IHfckGR9qUeXaahS3kWpB9SbvjNh4TY/GWtUrd0kru7nyP15ufQYyeoGYlKf/8aS6c3XqGVAA4ezFmg2MW+qLjfipV3lSL1lDQKe6gZMkeCWahHGDjc9ZZeAeYpnG4naYW6V/Vg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:13 +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.043; Thu, 12 Oct 2023 15:11:13 +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 v13 04/10] migration: convert rdma backend to accept MigrateAddress Date: Thu, 12 Oct 2023 15:10:46 +0000 Message-Id: <20231012151052.154106-5-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 79a0733e-fe6a-4f2b-289b-08dbcb357966 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: IEHvTDVWgAD90XKbjOcc7Ya+uxMZs4jCvXR9jRZ8hq7qJxxlHnfvvHTcvOpvTDjBBL7B0KiOx89+ZhmxtkPo0JEoWQJ5JGVwD/hVoqtJ3f5IioUEQI0HuiLVlhni5QsENAzIDD/s0KR5RTcw4v0cgdzP6FcMyPoMfkUn0+HIHYexoS3orcGnV5L+XHqtdTp1mXY7h7WmlFSu7UvCgtlO0K65Tpn9ExW7CReDh80rkAisZ714p/NCXTrstumd5UPkiM8X9mAtJZJoc0knEc9AL29Fnx4CouQzbx9YGI1UFn6lckC4bRNgUCI+WUv7z9Qp7bwaUv5wBWIQG56M6GRd4f7fb7hwUwpL1mwabM6yWU6JQM7iee8jMcDBBuGX+B5aryVmHuPBk5zqdfY3+oY0+u7aSKCNS4Rn1ZIan3xVT1y8gdU3niP6rIG8VkMfkD+O3xJCj2Tdu3yP61IZ6yH1xDEBBS9sDp9/iLl1zYcwSAHBU3MobTDUhDKPdxKznaEd2br6Zz7p1i3zV76tMM4dAv0LdVhO0R7TYHxSwNzUv/w45qx+7YeCYZvfEfXhxx8jncvVQQ8JWy4IDCojcCTnbC+8Msyk0Kb2eJ1dYEPtgI2wgCWwb2z96D5sY8uGhQWK 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?fhEgs/HdOTMlFAWHCc84XTTbwITp?= =?utf-8?q?PwTKT/4QJdXZsQQ8xXl3B2jw7oJA8IXonfR3GYXn73y43ThEsv7ZyNIjbByfP7iVu?= =?utf-8?q?TdWU9nSXBJul8uCbpQuSHyxSLy57vFbDiUbNyEWipeHrzi6jo9A0OQ7vZrQzeU4V6?= =?utf-8?q?cQIBbPdhgdnqhRVihQw5QUIFsU1SizLADGkvl3a23d5B3hgWpcGlyJbi8g92G4MgQ?= =?utf-8?q?1IHG25Po6BujhDs92LYEOkxjIUZfBcuHQv0gUv/Ix28UcVBtw0mjY7znxY+bd3kBg?= =?utf-8?q?zXRdHyWEcoL30gisI2ZE5Nux/IXPfdOR1LLhyo/WAzqMVhnOkNci0MzwLCBSBgeVN?= =?utf-8?q?GIyMkQV1wypUfVCNJbu4gfVSsJ02KaPO/IK8kBpJZc0xs2Ic7fLJlIgDB6dk/U8aF?= =?utf-8?q?xTlzjoQK5CvD3Kv5SQAex2GhJWFmEAFjgImh2lNTLBxqn9EyOmh3dzMVlj/MUiQ9F?= =?utf-8?q?tuvWoCedMtHUECk1EEeBuAEKG70pPrqAKEDAr/ZbKNCmqmAoVZVGoVr5F3K6D6xli?= =?utf-8?q?gh4J3B0ruNt0l32AjwkpMfvVREPTFJDHBZzbYcLd1rbrPacZXJIBHT4QeIRv0ZoBE?= =?utf-8?q?MA6ZP+MuGcOH5BrmLVRfEuR4qLXYeZxVgE3iitZu5IRbyAB6VzAq5lpWwDt4fdcm/?= =?utf-8?q?BA3OAdNiEcUutLMvim1TbqsnW1YLhf8NkP8dPlpox99Ze6yeUm7lpKseqvcnBIZym?= =?utf-8?q?O46Ek6GshNTLvb/sQDqXlpui5qLoodTUO7AsSx+3ajEgWm9K4oqbmq9CqCOkUKoLr?= =?utf-8?q?mW/RfVj4ObuJFK552UAnDWoQ6hZ/QKnKgfy/6ZLmOATDNawwSf25Xn5RydGgsBMFN?= =?utf-8?q?frDCJ4fTcVl0iMHPp42fw/8b7qtsPq7lp8b+mq4crHwet9n3aYdvb7qWe0Tk2rH5Y?= =?utf-8?q?I2V6Isvx5ht/C2/AGwZeqSuNi1gS96tx0JQ/VN/B2UEoSS7HoZRMz55+aARKrGZc/?= =?utf-8?q?Utsvikbehp1uvt2VTXqTv7yWWqePRWhn6NJYIMed96qz5/pfNvktPchoAW6zI5SAj?= =?utf-8?q?8EEiJwO+HJpsLrIrRtAjDprYM5T7Ot2g9QUeIiVoRngj+4hIlpRwhlib7HczwGKKQ?= =?utf-8?q?YXaCQUNLMInh62DxX/7JCzBdqJ5PUHrYTneZRodUwFw2lnx1j4+0dEzPG/0rTKwLz?= =?utf-8?q?wPUJyFHYUpXn21BXUYAF4q1/l/BHfQjZUDX2NE7Cmn7bDDzBqYfEbVV+j42lxiTTa?= =?utf-8?q?OuCtgBjqMT9zfAazcQICclFGqF5nA1X6EUXusQ5QspuKLFt/pYS1fHr+G9rr+ecoK?= =?utf-8?q?sVOKaUbKZ6Q9cDttw1hw27OE2ccQsPESrc69pyU0X4fQObfajtMoq6er95fX/Oy84?= =?utf-8?q?HaZOKrLUUTnueLlAVfbmWjXMxDO/9tV1L3MVfVQLUbr22Zoi9sNhnlOaCj3aDSH6E?= =?utf-8?q?G94Es4YipOUvlarsA1+naO83eVriecUcq7/K3NFV2Lh46bV6JLwn2quAiNvo5dVzE?= =?utf-8?q?J41FOIU38EvWE5dWjP1r9RiuLYda/PIv8ip+BjPL3EEDI1qWtIG5JHTKnN9RZxP4V?= =?utf-8?q?2rtLz7W9Jvo7?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79a0733e-fe6a-4f2b-289b-08dbcb357966 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:13.5284 (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: I4L5YLWEHSeWvNlgtOUJQhuTyzd4qbp4W6R+GX91QRwzzXdHwRYAmNC+wUA35dJA9rNnzloyXVnKfNitEqa4Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: gMAlKNEQ320EranwnExb_h4Yw4uEgbRP X-Proofpoint-GUID: gMAlKNEQ320EranwnExb_h4Yw4uEgbRP 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-12_05,2023-10-12_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 | 33 +++++++++++---------------------- migration/rdma.h | 6 ++++-- 3 files changed, 19 insertions(+), 28 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 66eebfc74a..03b6deb45a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -502,8 +502,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); @@ -1774,8 +1774,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 f6fc226c9b..db8ef110c3 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -289,7 +289,6 @@ typedef struct RDMALocalBlocks { typedef struct RDMAContext { char *host; int port; - char *host_port; RDMAWorkRequestData wr_data[RDMA_WRID_MAX]; @@ -2444,9 +2443,7 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) rdma->channel = NULL; } g_free(rdma->host); - g_free(rdma->host_port); rdma->host = NULL; - rdma->host_port = NULL; } @@ -2739,28 +2736,16 @@ static void qemu_rdma_return_path_dest_init(RDMAContext *rdma_return_path, rdma_return_path->is_return_path = true; } -static RDMAContext *qemu_rdma_data_init(const char *host_port, Error **errp) +static RDMAContext *qemu_rdma_data_init(InetSocketAddress *saddr, Error **errp) { RDMAContext *rdma = NULL; - InetSocketAddress *addr; 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_setg(errp, "RDMA ERROR: bad RDMA migration address '%s'", - host_port); - g_free(rdma); - rdma = NULL; - } - - qapi_free_InetSocketAddress(addr); + rdma->host = g_strdup(saddr->host); + rdma->port = atoi(saddr->port); return rdma; } @@ -3359,6 +3344,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; @@ -3374,13 +3360,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; @@ -4111,7 +4100,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; @@ -4154,13 +4144,12 @@ cleanup_rdma: 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 Thu Oct 12 15:10:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419366 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 000EFCDB482 for ; Thu, 12 Oct 2023 15:12:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLb-0006L1-GZ; Thu, 12 Oct 2023 11:11:35 -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 1qqxLP-0006H9-6s for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:24 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLN-0003g2-7O for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:22 -0400 Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 39CDOLxQ011099; Thu, 12 Oct 2023 08:11:19 -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=9S6jgyH7sF9VL48X2Ox3XD8ScF5jvsMp0OYD5G1x9 eQ=; b=ai5zth2mvYoFX01pW+5MBLscS+7c3tfXM778EWUQ52Mni8QtyUcGVczh/ 2LQJqhFUB6yUv3g9veOsFJAeolMS/xDd4pg+aNI83Ph7UYSuup6XYZ5WLOt3PX2d fb8P0pmi201jui7jmm5aYGP1DB0ieAsFSHmXGxJo+ZAezHYkNSihmlTkRUAHKOJR vkr1fe8kzfg1HQMK9+fvr/PWa5b8DTpqGuUg65DT0jxWwZ+prPfTB8OkPMnVcTzw BJckvy0ZO2f4RqV2GWQntTwQ4YmLebboZKg12F1keeA7pUH+6m9V7jef+goTzMOt E4tGBYHK1haP5mV82K9xyL3fH/3JQ== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhxt7uc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GdKG++Hb1cfPh07x2uhxrkH7y3aLLSKNaxqqyryIucGZhf1heS52Tgdmymag+dfZLl1H/0gdgqtfA+u0CccFykjgdvAsAquk3lTDbsscUJbmD5Nz6nNq3L8bo76x/t0YSCQmmK5TqFabUFQn5WUduTTt8LoylTQ0rAZiU4ZfN489DoTG7Rmg4gDkGuY7X/VcwmnitghfRLQy0HqFBPVBEPKO0mASugyvCXyhYXKxukz7GRljIp1fNVRRRMMn20ouvFSmkYj5nPMNzmmP1VIJNAkNJFWOgdgClhjIVy8XFXa4GSMlHUF0Nn4LO0+fD6w94DGLKrCqshWUwPyv2DRbfg== 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=9S6jgyH7sF9VL48X2Ox3XD8ScF5jvsMp0OYD5G1x9eQ=; b=V+u9VSAJRLh2VHDbVTsFa+nyIIF1JzhjJHLZWJ/Yu3K+zrrWgpGimbx7bH97aiJsWuw6VBduYAU3phRRtxZhlQZ3KlLppHo6dYMXEIsSgx+OQJEFtEyx/6CESKontWDwD4uBsOXleRW3DK/H7dhaoFo5IVM+kbKJBpgmJ/N6haPjkdHwt5GhetvRc/XE6DWRpL9afm9PGGWqAkTtXjYtosvXEmbnUPasC5b4Vwi4aKdJNkWF+sP1mtpI6MIqeTMM+T/J8GR1MuNHw0QwYbTwzNeSwVLwWowNF5YneyzlRy2apvokGaxBvd76zHlt4LlK5gQNmRWr30VGxPOEh8594Q== 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=9S6jgyH7sF9VL48X2Ox3XD8ScF5jvsMp0OYD5G1x9eQ=; b=MzXGy2KzTgcMbGDFeUFcplguiaxPnZa/03n2WOu2w4vKpElvqtsFX29Yxv5CGskpPiMTCILoQPS4CaD30HgXb5gmN9mb25jkqYDkVr66P5UcxIaoLw5xlGZHLQGyICTzobzVz5C5hA1CwuRkhwgLRZyvheZn99FYzQmko171xE7ceMqqBwAj16tcd0qaSkehNOGZblzAMq3+E/yMdi2H5ts6Gh9RFFzgfux9xhoiwicbG/Jgp96AqScXeGg4UCCJbhNDLtQkeXx+MNjwIivXNiMemSDRJnVvmcnbEm0OGLtjO6AkT499m1Y+u3flWMVzul0HQuN16L4fGUBbUy+1Ug== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:16 +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.043; Thu, 12 Oct 2023 15:11:16 +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 v13 05/10] migration: convert exec backend to accept MigrateAddress. Date: Thu, 12 Oct 2023 15:10:47 +0000 Message-Id: <20231012151052.154106-6-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: a955295c-675a-43ab-58a2-08dbcb357b51 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: zSM4PBKGZV75sfl3qE+vLqskTVd6EJMRCCl02TByobnVaXglfcbHBmmyj4tazdCwpUs04CNIemmhI+qcvcLmogghT0ds2fnA7OHwodCSQ28bfNICCvAMM6/hxK5WZKM5OpFULROn+xL2tJroycTLAb5pitykEf6dbiDvm88d4K/NjNmi3Id0ofzw84Ji0u9ZlwDTCuERtUXtaYyiFG/9rBSJkZdkdDXghuq3GmKRV0hAkztKwk3SyUpHQ/CX4p/42lIhxOqyW0GVB5/Z4Wyff+aos93RSISKKfPhOaLjNrAAUNqE3SxLPCqGddrJUn3+FOuLIIEwZs9jLy7K356sHbSwM0lb+zUdhGqY0SY7b6I19EaX+RT+y3NK1/c/f+7mAhFzhhovR+XHcgtHPb2BixCK0vjxTts8K/JGXesyUPotujkKuJuvW0YWXg8WS9SNar8coLz0GCUZD8PUmcwCBZo0M5Pcy2cdafJ4W0n90MFpy3yxfkghbNzSt1bdraD6HSUfdhwNN6qr/zHoPT/g2VeA0oTmBK3SJMoznYvNCIsCv8Kn1AVLKO/wZSEWcsnLINFSV8io6n42Zjw9DsuinHsw6bJNM3lfzIlxK04AbkxmkfRABJfhlm+7UYLK31KhxRxfoLYKErEQq8zKjP7JbQ== 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001)(218753002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +o6x7TYCqmBhvMusnRlOJV3rtkswbjZ6KU2vKHw4G2CDOGHnndnJVaH181G+AX/AbM8QRmUhe1T5tO9jgG5HY5zhaPQ64FFufm0884o9Za6lDXH8vLjVE0W9sW+/4zpmZOkM9TCz0sFt80CSipVoQBM+wtLQYSdYFVY4utR21wO+e7ANoDTFvzaDaM3TjwScpHVlMb19TGiBsbzsQlQpyKeJu2fvMuUf5dfEOYbvgOB6L1LdPOtLZDTsrU3uAA0exo8ssIRHgeVwLETQs9RV0IoRmh0D+mHzMrFOLnL2Z8BKmzm6+kjQ82fstIAUUeC63ReImxyWh+aOq772TO4cZD7LW2DzsAT58rSA2d9NwRS8afeL6kmpO3frG15bCDH6FlxHXT+XHP9xWhSEJbGTxpOo25+p3FbNozizSodTXqU2A9XFQCWQLqnSdCbO9iHDGsfSmjqOEHW/B785rzNEYG3uHd3bMs+7UQKdG3dzyyZl8OBCQJ9Kmp3spSnv5LSNelY72sYIXpuKhUZ/Iy2631lA6W0ZXHo6Udvi83LtYHxOdpVHcKCvcs6BWHsoxfA8GWZhWaksV1EuhZQUbxCFA9YTO+7ZlSLxYB7lf2pyTg5SNnJEB0CjT0/WDMbz1iXv7XgGPJC8L5s0XbxcecmVBhD37PZVDB7/MG+ULEyWd8G82ei6z0qPwK32iIRh5yv4wEgUM6PDQKzRLjwtBT7hP4XHSZQp5BBrqsQGOxIB8Yv3C8n6bwpFcOIoCOPtvvd+V3Z0KF0XWRdDFBhKkU1Q6hSBYdy260EbVTeO37n6RTjBQopPDfMr2vaB2sfPmmVyXru5Kp2abkSbXFjgQJYe+MsLvLisLckMLr20kX0FWPyG4c8SCG1R2M/q+WV57p0GMHTFBUcZR3m/mpIYukL2QKs+eXnte6zaCXhwcQ1yibXF8HfL8wqXsHZ+086xzqLnGbCWj0iF+qgWN3TsZpbre3NxmDNktheVKLdCaN036bikN5dQomp15UFmmXh9GctQvWE7onMnoTt967VJHFoyVR2EwFB6lvwwUf2FR2KBr5FO74P+G4JSVTNy/oj18kj5ePjCA4aw0WTFdlt+ISoe+e1oaz+L9qsMAaMso72Dbp5gwA8uu6MCq3ZmfRu7+zcopDf9RVf2vSOhPzm7KO1jjfCjg3MfeNPkEPow0i5sG/q8lkpCPzU/OgrO41WMpiggl1RsqkiL30u6ohogeI9CaoKoiCZYEAT93Kmek7PC/KxWA1u31mLiVhZhcrWqU5HPqaU5oxoc8vvlZoEGBG2GJw/sCvroI4HBJbfWKw/BVAUOSK/SmJnz4qR//ByfALUzjcXNM/3CcMy761+u4hfaT3Zc1ys3WNkv9eQRoKtfJgR+WW0PNKCuqtgUnZq/jMniCEEkgqHx6Bu8kSiT4qZR+nyZMvYVKoOBapVKe+aHMsqwAtvp0l1JIDLV8Qc1SJUwarT4yWZHvIUSI7dfl5kucw3n2dCqbrQLIe1fBqlnqjVNBO9kHCvCfieT1vCvpuGwqKLMilY2q0uzi2oj2OmxWeBtpCJWnmHaq4pRTLYizv9CSac7x8vxO0wW3+V10icd X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: a955295c-675a-43ab-58a2-08dbcb357b51 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:16.8177 (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: Qe0MRBIMwYJUCojyxh7iVyRXPK383JPYgMi1WAGp3HllXTGRdyKEu6gpAVixVYYp5BPHjpMO5QGq87LZYgepFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-GUID: OXr1ksd37axGWfp2UPG7kkuvoV0b3xgF X-Proofpoint-ORIG-GUID: OXr1ksd37axGWfp2UPG7kkuvoV0b3xgF 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-12_05,2023-10-12_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Exec transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for exec connection into strList struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- 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..47d2f3b8fb 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 03b6deb45a..10b2c4f318 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -505,8 +505,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 { @@ -1777,8 +1777,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 Thu Oct 12 15:10:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419367 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 BEDA3CDB46E for ; Thu, 12 Oct 2023 15:12:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLi-0006PM-DO; Thu, 12 Oct 2023 11:11:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLg-0006P0-Uh for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:40 -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 1qqxLe-0003h3-Ay for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:40 -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 39CAbVNU017937; Thu, 12 Oct 2023 08:11:36 -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=QYQt1F17I/3pIxR2dFagkPoStsTfaHb2esFTBW9ip x4=; b=X+C0m60DbxYY2Jq1RWQBqeAcRnjn+DBXrUl5GtPeKPmZ/yKNBPeRJvMm2 PMEnEtPNel/U1xVFbJ3oOMXuTHahcGa4eqIvEFyeBuCPMqMrz/FDFRpPX9NWstD0 TvA18MQBZ0i3fvMulKoc4YUR3TlmKs75kUsfsVM+SzW5cB13vrhxiF7XnESGSmx5 x7DJ2UbyyaOdUyDv5kFV0JbLFOQr3xX8uaJb35LgsRZ8nw5zfxJvLiRIij0Pyyv8 XOyD9maLBdv9BTzLXodJM1qfQjTTKxE3mTvJRd+KWNTT0Sgck3ii3Rei874x+o25 xhr05Akhujnky4RB+4d64GkwVZ4Rw== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv0bhs2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JKJIyC1Oa9wZdhF70CGNMXP1c2GXmA0lSZ3mbmyHrMC8E7SBksXmRekdaexQ8xoV38N9tFaLmGF1gWOlm/je1Q5E4O8ZpkX5GSoTYX/atjkhmP4qZ+xCC0956KVxqPobmA5Xucwf7yL1zE8YIawkxWo95yf51OE6lh+lt7aGsRIWDVtn33QPbx7BgIUhTbIoJL9ZzmDF6pSCYv7GplsvmxnfywyFg7Jb9pvrhkOHnxSxGcwlmvC+kAWlx3dZGhUFcWPvWSuYTEgGGbjk/TbAOhgNQGqsYjn27md/aAft55NVbsfOvUd0hfEsfD1BsLDJPqQ7Bo958t2R2pglG3JKKg== 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=QYQt1F17I/3pIxR2dFagkPoStsTfaHb2esFTBW9ipx4=; b=nJLeR94dnplLOOH80AJvksxRcZc+t3QaNk+HriQlofsUI8+kH54px4cePZxdi6Y/5JNDFOfVO7KSvByNH9uVh8VQOHcNyvEHx6dx+GTM0XTwxhwxCbdXN4H2wH5+IzP4iy4PEqShJXbyl0O2Sjly/0VmALs8NU7wFxrw5DUn3MwvYGB78Rwws2q89dDIllt0YbmLlqIQ1Dl5SP6L5/59KMp+P+J681K6iy84aMqITuayeEgS9Bkp9Pe74R5l02CqhDR876ypF6cGXauN7TBLpWPyaWYfWTiCGJvim3FQikYxJ0saywUy/v4qV17k/Uw5nY7cn5oGNufkel560qnwmg== 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=QYQt1F17I/3pIxR2dFagkPoStsTfaHb2esFTBW9ipx4=; b=yCAJ5Be8WcDy7IrVmUBKLcNsglYexFhBupvBB4wOEE34GTUGTqtcuyYo5LEtL+KggM2Nrh8ZEprdXVMt4xbB03GiZ0dEjBfgU6eeJ/wwDA+KbHu+ZPO+cH1pn8gPQZlxfL9Zh4JCBlRWQXZDVunmyFoZoTvtdGWIiGUKMkOQQD8J2N9wEEnlL/hPhxtpJraxu+b+qCR90U8EIpgJ+t1jTRA13ioIB3YehrrYgUiHBGJGVubcCHy/3IoIyim6zpmE4OQSzD3NvwBNspPWfN+MnO+Xpsgwgb4JbszhvsTjpzVDcG79JuEn+kdT7PAuRncIGESjwOfSEddkgLY9evKWCQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:20 +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.043; Thu, 12 Oct 2023 15:11:20 +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 v13 06/10] migration: New migrate and migrate-incoming argument 'channels' Date: Thu, 12 Oct 2023 15:10:48 +0000 Message-Id: <20231012151052.154106-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 1afd85d4-e513-409a-9ba3-08dbcb357d4f 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: uQ38UTALS4hVRP4fEQkVwBiC26SEg0oBF3R3s9f32WFagxRrtbpkePNg0axP6DnKuZcnTmAY7/g6iOi6d77NckH+xhQOQqmtfxYIb0dqCmoUzaLEmwb6FsOlIdNSjNi+bQ2J6l/QNn4mNIvYu0+c67K6QyvM5Z9zYzk8juGgA/ctyZxomOk37+7o1RC46CR1peOnOAVjrHSoQ4A5w9JioaBAyihwFheUuUSASDzJGXuqoLgN48s9dZtBGlUSBP6u/Lql3FK4aulaB0uADPCpSybfpNHc2iU0pw68jJ8STezrqwQYn9DYoaUUU6sSCgDpYje8rYNcalJCBwSiHYRX1/d6kbARDmPJF9pS/bgZHulnx80IuHvDDELUjJkRlZBOOzcfQaWgUGzN18M9Y0SrNvbbVP2IEgq4Hr4WFcSPrQRxfW9pOkJoJ0AtCVZyLn+pJlh0FYGLL2k9wBez6kF/UFsE+sq6MhCL3sdeC0woyUKrwd8gXfwHS4tFgri331sh1XxCo4ZBlnI3xWWpc+y+FumE3K0YdT8IjQcyx3ZCnzvfIBsDMw/B3c5sRU3iRzkjEQn2g3bH9Qk0ESBguVjWdUhcuV4vc+z2WAVsuPm0vCryhIw6FVJMjF80oTKx+FMJYoREMXe5EzmoCRxJnFqa/A== 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Yl0tJNNJn0WMRJs+ZuPyficMA4Cp?= =?utf-8?q?B9Hkh6fMFZNsVd4gYQtTr+3tPRlDpVtp5G61CD0xl/lXT1YfvSRn/IYkrxRjuAXFh?= =?utf-8?q?TVcd44E2XZ3KOBwNVf1oy6rZnB5NqfNnPeVoXLIbpD6ixucrIWGJImVtqFO3bpedM?= =?utf-8?q?HGi82CPlYDFRLTbAb57rqDhG9FsnKBPYIkhp3lrUkVkC/zQ9Qt96BtP1DXV/+pybF?= =?utf-8?q?47S0U5Qek5vIjQNbNt+QvMCA+805O1xruHysvF7ljZFljgeQG9x/npEmabLTrSrI8?= =?utf-8?q?MJkTpcINJzyhKHTbw7EwK5OAmA0XgmLefKZD8SiTTT1rusXNB0a0ICu0cTjCV/Cq9?= =?utf-8?q?ehIEgc10U28T9lVX6X8m0Zz82lFKKZvYkS4uAdpuM/sdQEi7ZdzfwRssvxzVpfwtu?= =?utf-8?q?0R8dTsDae5pmreRST/EvKsUn2fK3TV3ZhBmUop3AWArnfapQPb8s68gz6FUGqa2Ig?= =?utf-8?q?tcEafVsI1DbHISHkD6li0SrRw5gzVQp6vfW5aDH2jZeELjMvuiVDf9dVlt3bYC4Lr?= =?utf-8?q?miTnNn8HLlJNbI51vIMUsdMl7z2r9OipwtE6V3x87/Ab1LaoO/es41Ol48zsBah/a?= =?utf-8?q?lFtQtD9bnlqh+Crzj21zyszjpuPWEge56jo4As1V4ZVRFVKFzWj016aHCwgoVy9Yi?= =?utf-8?q?nuCe+GeOMNEVbLXb4xWYl2VJVUMRVxpa2v1u6bZLdk1cXBmEEN3WNv6EPEFlnPgAm?= =?utf-8?q?Ewh4hvXmeK5eu7LbIs6gSfISUV3Eol73po5w7/X2QJ7aTMiUuDmZ9cEYgYzlN/7Yu?= =?utf-8?q?QhHJj6Hlf/36hbUmOkMyjVyTI4wxDj2qT82jAHA3SoemNfhwUxyFCWhB1AjkBxJZj?= =?utf-8?q?ZTzf9osL/hWKMLJhgZLbPqp7mK2TZOAVXpOGSpGSR5QJWOJpARryY6EcuvozlpzOz?= =?utf-8?q?IQikvLm6yOrI5kzb3Mc5CBtgZyDhXVd6xqXBuoVH3UrJgbOiErDm6KRoh7xSAlWDr?= =?utf-8?q?ORoCtEfB08/qAj/J7WWloQCaTJkrmmxXiTIn0cHtTiRP3rBSNToJAgVcAySHhlZcy?= =?utf-8?q?k9Ahm++tluIf7eltgaIuno0/6FtyYsm3fQjEk+yuMsGd6k2xMjBsAn1j8Y+ieCCPW?= =?utf-8?q?wHngW0Kxa45BhKTeZnHNCmYyYt5Ynntber/lyIL7a1aVQ50UlaQu+E07w7xVvVb+u?= =?utf-8?q?UMvOdejunR5AF1gDwweSVijxiidgImWNnv/RE6TWsH0DCXzXTL7C96ganCnnomKmh?= =?utf-8?q?Qe7NJ4S02R9/rv97HwJ/ygJWnyMhoysBr6dH7nxP7m1XXI7F7X5CcBRgEocO8TOZJ?= =?utf-8?q?odi2JBHznv4wLQmHSjljYKy21vqwiPH8KzsZjIory0jWjMxaii/XDg51y36ZgnlTR?= =?utf-8?q?nMyTlVTVb8r3LHZkx43hc+eRy12jRAehhRAvwAcJF5PfWq9PtOhmYYwtFaDRLFRVk?= =?utf-8?q?N+fWugvHOc5Sog/vI23lGwQGRY8glQssxNXT1u1LvK2bH2+ZADvXYbwavVpd1T6Zh?= =?utf-8?q?S4LOkGj05kmGAisdqUrtuDQuUu23TJ+z41rWOv2EOpbCS1Cq1nU4w8yNKb07Ask84?= =?utf-8?q?W1CcYlA+UTyj?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1afd85d4-e513-409a-9ba3-08dbcb357d4f X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:20.1320 (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: j6iYQaT0Pgw3flXReMyQQZXZ8dtpBMnY6sueBifU7ooxb5ggEaJ8J96qmaIz8ONBic3gL6IDIBrvvB2sV2/QBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: 0hKDfD9W2vEFjF40llwuARZ59dHKF2c2 X-Proofpoint-GUID: 0hKDfD9W2vEFjF40llwuARZ59dHKF2c2 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-12_05,2023-10-12_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 ++++++++++++++++++++++++++++++++- system/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 10b2c4f318..da50b83e5c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -474,12 +474,35 @@ 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; MigrationIncomingState *mis = migration_incoming_get_current(); + /* + * 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; @@ -1547,7 +1570,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; @@ -1565,7 +1589,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); @@ -1601,7 +1625,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) @@ -1732,7 +1756,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) { @@ -1742,6 +1767,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 8847def17e..9292c282ac 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1518,6 +1518,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: # @@ -1525,6 +1553,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 @@ -1549,14 +1580,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: @@ -1567,6 +1634,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 @@ -1582,13 +1652,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/system/vl.c b/system/vl.c index ba83040675..1672feb775 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2695,7 +2695,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 Thu Oct 12 15:10:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419369 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 68213CDB46E for ; Thu, 12 Oct 2023 15:13:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLi-0006SA-Tn; Thu, 12 Oct 2023 11:11:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLg-0006P1-Vh for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:41 -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 1qqxLd-0003gv-Vx for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:40 -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 39CAbVNW017937; Thu, 12 Oct 2023 08:11:37 -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=hLHnoLs2k8XyCKqL59yZ5EFsIqg3skKlW79vxSzXN 3Y=; b=cjIrYapUUVio28Z0gVQFtd+gjhwpZPhiQO4ZnHP1qbHYHUdLejqW9bON/ Tqm9eP+q9cxO2kuEtY5GQKz69dXUB+hCxZow6TkJzI9RYZTFwr24UaXEN46DRXV1 wP2SO2s6WHS25oDIoKabrZrYLAlOkL1Han5D/DjbTaXzquDAafPHrbyxEhvMfray 82Q6JUZj1gvz+m0ykOKZlWrBlHrIMWo2y3HdfNYYd7bLDOAbqwHmGa362h3Q46HT OIm5I1c/Mz7MP4FEoSOfvmMZVDzZhxD+8Ij4/rx4qttw0/3LahLfapWTd6xk5wjz It2npb08mFUSpqcvbEKYg7KBCRvlw== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv0bhs2-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ab+gNRqB1TV9OfeBoXRYftaqleUTEsVRKEBgTyJT4rZizGzEB1Fni0FnD8aUHwViy4gVzoA2FDF8tpvFipXZhsRwFgnBIDS/QD9w8zL26Dk14HT42q9nEv7TqsSpUBHa2TCY2Hj+RRyJ6uGCKBp2vA7hVUlNwCbgP0p9V942S6g7BjGz5FPW5fYpxP8lmqnsoJ1VXbnBDJ7dETSijgxhSdG5XqrvTTfSPrZ26Y/zghj+1Ylny6vsicIP1e8fDmbrqWHwz1+EXNiVoWm53m206aUPakJ8Vuv3eqBIJxixCo85GBqifdDRSEwjVcCXVYYp2nJms/ow9rE9RqRwQw5MlA== 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=hLHnoLs2k8XyCKqL59yZ5EFsIqg3skKlW79vxSzXN3Y=; b=UwTZHpyhxKcmAWxmWQux0blGdDcbv9fy3jejW2fjVEspk3QSS9wPx3FbahJkhCoCFIhf7yuzJc7KkShevWAsnhcLEu6e/8vDFMR8WgbKfqTrwrenP1Rf/I+oboQRTl5M6FTTuoNjT/ugLwI5wYOmyR/wfw9itzIh2ywkxxO2zTep92IrExkmgMu+6j4mcmFGZzjDIHxUT1kKHrrMTaF0qIITwljOEh7OfNhi19wmsvMtwm4ScCnKC+XY/nOyHnllmcUEL/KbUMK1pLEmPZvEU+Tsssl8KYh58FwCIYrXBWZkf5n9CSWn+lZoGJ5VrWm0h1m4Y6Ek8lMi/zTxmC+g0A== 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=hLHnoLs2k8XyCKqL59yZ5EFsIqg3skKlW79vxSzXN3Y=; b=GmRluPs2RSyTCigw1foWwJyoU5OZtJE0e+Uc21/by+18EIGGxuLjmCr58V3CtXTysFibuRyl8J8Ot9oeVJVU+tdLLuHENRyAWkSx0kpNnbxnaYcaL1XzuvXPfufaWCPNdsJKVOA3dDSn3+vQ/Cp2o3mGt9hXwPGhi+PJHm71kVQVIhFk/URFZbYrVc43UW0h0nSfxu3BtpG8HRKGthtS0tRq5alI6GiHrNAxJpfutSI4UmkpUsKAXIpe4EP3bmopJMx/LjMzfMGKeDgBfiDcbBt9tGCYmYsGMXo8AaUMz040knnH/NmesrC3nEtIUnFDRKZAHUxYp9DD4ZLTqpqU7w== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:23 +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.043; Thu, 12 Oct 2023 15:11:23 +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 v13 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Date: Thu, 12 Oct 2023 15:10:49 +0000 Message-Id: <20231012151052.154106-8-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d6d7cc5-52e1-47f8-b7b0-08dbcb357f46 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: UgsZrFY0K+T1aAi5Pg4tN5AVSkgHAM8RA3BEmb/VyXDkkxjDM1bVCup/Y7nYRXOMKG7IUSScR32O7tq9W2hQ/XFEQHU22UHnrj4bhmXdg8Rr68zK0NYR5wirelcwDNlXI7auesJPgGQP1MPcASF/QXdGTNKDaklSMxp5Zod0yjBN4Hu85DSeILRxrwj6o5qiHZsi3AWgiuH8V3VCqzH336fliPFfUiftCr9ExIrDXGt8n7xzM97JASZklXTlqP7UnzoqTnOdEOPIB/nW2EfGQK0FIuvKkaFd9FwNyER5+uQ8j93Ymw0ONfgbwJwS9pGdwRUli3YZGEhn3p0dTx/2Fx5N+OMU+bRIAcZpvboay6k8x7ffYe2T+JvEA+E3dwzuRBmBuQnFXNZ0nsSGrdgS3UecZQZdGCC+jAJoptSuKjHQdxx5h6Q2ZcMZ0RguYaVAWpc+fmqasHhYJ9bOFLEfLmGli4zHOWw6Lb/fEgy+B1GXM/D37yvdQqbQX6hYRl5kkQA53Ry3LANGfiFq7dhP/D8I4suOuEPHostNl2LVGyJtfWKYbRLXhp8h2Pynvm6HH3jH1X+vf6gU2/umow2sG/NYgX67n5xijx8radifp+MikXwojk4lmA0TnyELDcFf 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Ht7NHO0PIjqgUFS8nU5zmhxTSPD1?= =?utf-8?q?8ha8ZZv7/2O8VqiqMLcMZ49oqkHj7zK+Dty+iCuPhXi9VV10i0RKyd9YYAqqw6HYn?= =?utf-8?q?XQM3TFUW1MIEPDzpLDLQBctsRCU/LhmG0A8blMy/t5u/3g8uBxGUYUwuoEuo3zimg?= =?utf-8?q?je/aQnb2SoIbU9QCwQCNj8HF+tfTPYVWc+/HnY0y8ZaLWvZv/0MGqpl9ibtSGfXrR?= =?utf-8?q?PgnMup9+5zn0Q1EqSVQjcd97K/Sy6BfbEczCd8dJ4u8uh8WgTNPx0vuAAil5xARNs?= =?utf-8?q?1XDe7OBTZpWFQVedTDuDzvE3u1RTwlqs4G3Ku1x4MtnKQzU0soIgOkG/rlJ8u2ziT?= =?utf-8?q?aN/l49lsf0drVy0ca8Gl2rzh01XfSihcXBo18BNiiepcrOIcql4J/Iq2UliiO8eq5?= =?utf-8?q?UGo4e/xO4pHKOgoxxYX9T+JNR3TAZJkjoCpOa6TXdyUmAzkqD62QhmJoD047AIALk?= =?utf-8?q?MCTGOEaljipvMTQbH8EKAtjHjqUm/UWJdKoUyDZkpcLnUljRNCKO2ZLIDAyYgdC4G?= =?utf-8?q?0JPl1hpybn4mIW1EWl50mHuicykNm+rU8t7kpfapSlWLP3FlbqxQxvyyYib8FkARM?= =?utf-8?q?FSot7wH3BYRVJu79iBaaLcrNMcFFryH2vVgl1y5X/y69Fo7//rFYhwA/vniMOlpSv?= =?utf-8?q?UUr35foq8ahPtR15Fh+0LN+VFyoGHOXvWn5iSaTJ1P/5te33tp5bA+xkKbF0tXyOh?= =?utf-8?q?Fpki6rYANyT8IhwNsFKN8bE2qgBi60Ec5fLb0nOuqCLmuWyVEcFSrqjqs5icPbdxz?= =?utf-8?q?3Twe+jhcsz7aTinFUowIFii8zRuIVm9rjlLfii7vWHXydTdTta9CpeVkaM8EmSeY5?= =?utf-8?q?ti8Mvgzxa43mO7odHwDY4nTcAQ9Ji75YknC1rGGyHzR1z0mbNnXubJfISRop6+fcm?= =?utf-8?q?YWIwLF/V4K1HPjaKi7WYL7saHVM6ViCL4eNk2e92LweVwOeMLTE0lkb0O8t3pz50T?= =?utf-8?q?NGeM0Ox2WPe0pMjJxrh3U297YE4n7fjhUZLfAGhATt76fs6JuJg9X7zP82Nyp7k5Y?= =?utf-8?q?1twMDtRK9PfGjsN3mpsZiBWuO9kOYF3ZMxv37/CgWlQLvdifHdlh11obTmZj7HxnO?= =?utf-8?q?aw4ACrv/AmXSgequ+BVpbHej6vpwe6uD7+abf3vRZaikFkxBO0mK0xAER+P5VoBjD?= =?utf-8?q?PmCFfLKiS+oQbJw3Dn8aj7ZL+h6vOGLrX5vbTQQQF525ELnzFQMRKh8fxQAG2yL1g?= =?utf-8?q?uB7piN0cVubIKRjOjZORgrl6yy8b1RKBmIwSFQzx5LrZTRtoXYcE8tyAQUrkH/ExN?= =?utf-8?q?GAAGr1niEGZlRHo40MoPqExjBZ5CF4695l2twBRawHsaiQ5iAzicXBioK4SeHCc0H?= =?utf-8?q?qcTbFyKa5r4R/edn+Ky8hhKS8tcdOlhMcCqoHrR29EAucpZIdIj7rSsFMV8KybjmR?= =?utf-8?q?psNF9yacZlhooJ5i0pw37+5RWQKDUJKqvzXRk1IybOBX/a6nm7tYFKN63Bz1fHNnd?= =?utf-8?q?DUJC5X5jnJ7PLsYHqZCTs0VVS6x0DocuJdTFj3Pzb/yXVnrhbSCmc27nVcAiK8Mnj?= =?utf-8?q?UWbawkOiGD1/?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d6d7cc5-52e1-47f8-b7b0-08dbcb357f46 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:23.3775 (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: LQbi70FF9XGX7/4uLXe46JOIvv/UrWwFDXvG9thayGtnz2d3FdHtg8favtz4dnTH1fojJMe+o2skxLqHe3YJDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: _JwaYV6vNvJ7qcyLJBJMfp92NRZ-W5xS X-Proofpoint-GUID: _JwaYV6vNvJ7qcyLJBJMfp92NRZ-W5xS 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-12_05,2023-10-12_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 da50b83e5c..cf5a620c8e 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; } @@ -503,12 +506,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; } @@ -1788,12 +1791,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 Thu Oct 12 15:10:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419368 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 E5F8ECDB46E for ; Thu, 12 Oct 2023 15:13:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLk-0006V2-D6; Thu, 12 Oct 2023 11:11:44 -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 1qqxLi-0006PI-86 for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:42 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLe-0003hA-SA for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:41 -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 39CAbVNX017937; Thu, 12 Oct 2023 08:11: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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=txiZGE3q+Kla4HQYXx7EAoeqc8Ao49ucsKlinIQKW Pw=; b=GfTAgfPaNtvOTz2AVi4xHu9eY5Pr5HSFEMZ1n2bH+wKZ393Wb6ZaWwdvM a3S+CEezDStXPzh/9RF8whcVAoVJZQtmFJ/+EGSGB9TAE9CyhY1UtycD81e2U6cj /eWkz8AJAEAXOg3ENLWjKDDoxOXCluNof0WM2PBh5dSSb31bVWrsKQFUNWM/nPQZ p4MD7D3eAWdC67Rm8H6kfGJb2g9+9jaGnSvg3s+TtcfRM20ohkLxPGC1kzG14K2h z+VmL6PB+BvTLG/L2CoTBLCkmjQRf0nt5nCKSgo5BGV8C4OLsPvBQH2GFb+JxmC/ drYwZw3kcvUYi+4r9MKR7i++ImSkw== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv0bhs2-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MIJe6GFCW1okV99UsXEYg8qzW+0K6e/CSOoTyVshCPK/IL4yNjfb5tty1q+2MG8Iv2UFJ0Y3yKI37owkcx9i03+V1CAfmL3Nbx0pLKY0+BtMbF3GsbkcSQdAueINTZ+6pA/8d3jSasaTmLNJlmsihhoh/j58YwTADwhtniic/Ipj8wnr4D/PD4hSEn++Gf32We5rXdn92XtF2DeqzUkRTibHsz+KSmOSgDWLyYYBPA6F6gYaVppNUXJKoF1TcBWvPi9GvPZXKT2M2EjuNgQCY8B20XuFKjh7O9j85T4Lv6BW//mb74qyGpzPiDI4C81474/PNREEJuWl82VJ2fC5Ag== 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=txiZGE3q+Kla4HQYXx7EAoeqc8Ao49ucsKlinIQKWPw=; b=XeSFAdAe0PFH9dOqnf3soDm1lKOpAMfzyjQQnciQwNq+FK/kIBSsHzvginv2QB8LCDu0ZWq58e8Q+/Tr/s1RUARo8+jJhzYIuYlzMm1s/BPSs0zwLWI+q4OKSMTeaZnL7k5zsT5snscSffCDJ/hnByseCaFLiFAef9INDyLqS6K/oV1Buj+UgveSdpa27C+DRy2x8DVLUNtGoSvACx8+lZoK9YAqqSg2M8VZB2Pnpl0ZGqe7X/lnSjdEAbTXtIzzGkRFCrmzWImQT/Je5PgOMiwleJY+bFwsFVXZRIquwHDALUMVzWXyV40eZWURri8OWzNMICCjhCqD7TytNlpZnw== 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=txiZGE3q+Kla4HQYXx7EAoeqc8Ao49ucsKlinIQKWPw=; b=VqNOG/7FM+xh2NjLRARNS01hX9yDKqab4CFGgEuipDnWMIudjdSY848DoWdGKWoufKk4yAjbfmqiCNT+gQz/Dzjnqo5ld9HVuooe36dXB+hx87rmwiVrXGhyh172n+g5VAJLch8Bus9+NSTs3F3WIYukw2+wZ02Gl8TCeyTMelBow85tkyUvHzlyliQuG8EgpZe3A9yUeAbRY9FKfAv+JviAdPRvRAOvg6GL4UcJCXIqkv70x4OLtx6pmJdDgyz1jwZQ5+PB1n0WX0Sm/Cqvdumn7aqpj2PKaUquqapMGVM75f/aSHIgimtmiCpJLCWJPaFA9Lj8fNT8NUrfKe3apQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:26 +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.043; Thu, 12 Oct 2023 15:11:26 +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 v13 08/10] migration: Implement MigrateChannelList to qmp migration flow. Date: Thu, 12 Oct 2023 15:10:50 +0000 Message-Id: <20231012151052.154106-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 8e3999e5-0b57-402a-0eb2-08dbcb358139 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: 5bBJsCjwRBas0Jtpg576W49Ko25DUA+fs/rYXYBR85E+MoqNAzssmhSC0I9bQLWSzT/D/bz41vXFwSRAWWU+RSOy7R/Zvmd8zkaTnPM4yDnaEkE/sIJ+eGXMiXkEC4ZC8VJQxO6i3w2DC/xLFZQYMdHJAB+L9e2FCHUax01ENxQeWh/obzDVaFYiQrHY98gCg2c6BrJ38u8B3bBbOD4CjYgmPUdk5v9ID48tQH3JRQf+W8RIH/J14jF9NMeiRcIOzx1XRPxUp/7hqbRWnQ/NOV9h+mnOlghprg79gFdDoxQDXcBBg0A3SMRw0+bRA2U0qOdCK9t15XE3prKaQvok8+fdZKm9aDrHoxaVywuKuzj/2rKh7Gsgv4ShC0B1WSMHEoAtRY6Ru/J3+PKlQiwmsOgpFPln8bBp3cWydF1K8jKTwsfcuc+EhFN01KctCw0alBOukopJVuX7SdKPsHqftJUP+l6DghFOQKTeiyIPQN4Vj+KinlZ6jQ5kgKRrlB5WMI6DwdlomNvDky9Hrroix0cDUPC4R2fA1C1fNbX6uV/+b32TgA7oWGhL4fikLeDW3sfYZoCuXXvi9gbljMHli3UmoqZjBDtyxYFTKy4DEw8Z6dTcV6HpB4Aicdm83pfc 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QRcCTDiojghjncx/2joTfeBDc7RJgeF8ZzbHczY4GepS+Rm04KBiq/1a9ca693pL95HMatF711D8SPbC7X9KBSvfMC6L2zzWlpAycWoVDeeaArBZ1EC+DFmDV4LtG5i0CDrly+fKL6syhhA6jLJfmR3mlfOH8KLEWridmw6YKM4jlT+8tDftRUL4Qv059udNHMNA1SnXiYLZAKPREnj9/QGHy3bmTmw/n8nKkPXeiO+j1cQcmWRwvR5j/Sd/RKejibq7LxxeJpLjsyYfFD7BXJmqQkX8S2wYWgvm7m2K0l1cTImvYv7YoYwtqclwIXhk6uzpsn4y1MYYaCsHRqviY7iTZTgjJyJRwCPB9/yOyj/QVVgapXjLgfKJ1SjR1atUhwikTuaasnK0t5AnzDtQ7+0Fkug8KNZfrYScZyMkdibCrzzvc99B+rPqqkQStJkJWdt1NAVE681nAPPtv0Ip0pAAVD1Nej18aQqwLx374x6Y92G8NC3Y4nRRtJ+24XpcBbK25wRqJUeQJa3OCce06yDI2WYq+sPH+aUYRi9tgzkz+0OabpxB+AoG6SuSDUjQoEY8OnNHTmzHR9/u5zpWY59TLSo2nPs2b0r4yP6MjetNjummuWr1vvu7NHzBvUF8pWGEIXc9aOaKr4NYmpjMQKa9Qrt8xtHK5JuMn1xAyQfQ2JDRVJAct/3Z+p9lWFQ1CFQ6Teb/x0DkLpw6ukBYSKSgRhgHQj59J7P9x7KZEeqjGCQiak0SBAYsWogTfDOUhwP0nXaPz5TtX7v5qB/Lt+mgwI/TpsWiT07iEJQqT9Bv706GNY2tPreFPg9YbUUJkbIud3VeqrDnLYI80QVVB/x2uaHHTvyAZRbuc5onG9y3WUSsqqQTpDbF2N5scgzxZhNCtZFv9IcCIk4o3g+StrWn+zrnAf8IabF9y/kosEIE8hdnmbukpAo6VQUN6s3fdw7Ns2UlNhVT2FPMyke2HIpjGyNgpKPKQ4JMQLNm6C+y61VMc2RzHkB4No6UZWkW0U7cUY+j2Njm3Y+mJnlx9OhMwBnOGF1VhaESMaBlS/6v30qJQD5A7EQVRZWW4//PcVhJTG3x88QexUsWvqciydvI4r1Abbb/NwBMKvUGPw8VKTCzEnaRV89Z4k0vvNw9rEJRbZXeOAgYOUSdZrAt5mEl/w6XxGRaOsVmvQMjp5cGBaP6vJY1QVVIPRGaHLVq/sbCn7W7XZ2d34nZ5SkHm5mBN1GWm3blh1ZTwY5XFuV5i8OKSXmUVFDbpblDS9bC/PWGh5p4qD9fiuedpvQJKw7Tzp+ky91h26+Mx+Ir8Cuaiz+kSjqFVfYaVK3/XR090g1POqPxYuVMr7MUywGJUUnorBBDkg5G7tMGDtm0p/fHgFcoz/t8fcJjKIHQniTbBiVQk91Xztj2zEfSEjQC0jQEBEnC4zXhFn1ZQu07SpTNVLzzmKtW8be9TXC5cQ67rVby4WQSqu7yvcY9t5WQ1TIR0QhVkSEOml3VDsMtLhocF+9ffQPkVZEShk3DNgPpL9/MdOg7BY96jPYImSfNfJ7cbyEPve0R8N4EsBDIoAxOA9hvhtJBst9hASGxMnvS X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e3999e5-0b57-402a-0eb2-08dbcb358139 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:26.6381 (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: d7cerR7/MFJbl3YG0caAN1nIsW7ISRdJpo97j8LwwJMWZSb1eBnGJ8wCNuqr8aTl8KmQp2aYWnjFihAp+Qn1EA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: KyqQWlqq6HyPQICDVUymj54VnY8TCWYl X-Proofpoint-GUID: KyqQWlqq6HyPQICDVUymj54VnY8TCWYl 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-12_05,2023-10-12_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 cf5a620c8e..7db1f3196e 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,44 +485,47 @@ 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; MigrationIncomingState *mis = migration_incoming_get_current(); /* * 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; } migrate_set_state(&mis->state, MIGRATION_STATUS_NONE, 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) { @@ -528,11 +534,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 { @@ -1768,35 +1774,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; } @@ -1813,8 +1822,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) { @@ -1823,11 +1832,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 Thu Oct 12 15:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419372 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 1E9E4CDB47E for ; Thu, 12 Oct 2023 15:14:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLl-0006Va-D6; Thu, 12 Oct 2023 11:11:45 -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 1qqxLi-0006Qg-Hd for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:42 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLg-0003hI-M1 for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:42 -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 39CAbVNY017937; Thu, 12 Oct 2023 08:11: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-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=3Xg3QzICmN8m5yl5q0Qo77o6PzxIUs5dsxgW21z8X Nc=; b=QyKoExGx2m0YEqQz0/8wY+6H4UJG+aBPfPSuACA1O7DZW5G4XVyJ41WTp MZMnnjqE29S6x0ATzCWdV2NA0v9KHr7cN9KVCFVeMrkdY5Zy4GXJfF/WsBkHq+1W 2A+oYVTMo27UUlb80pfJeBwOqzjdFzhUMHADYLsmJU798FAVNFSGSVB2vu17Fh1i wMSkKv7q66dRFyf1CNS4j81007uMVetG1Bfbh6INK0mzpYyxxWfUrRfp8uqS9rRN uYcs2s5CULohRnEMBzsV2+C5HZV1Fu+ZGCyWX5LVbTUkjhuxsu1C3fGT9kMV4hMV Cf6dTx6+EMQl7exulr6RuxXcKbqlA== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv0bhs2-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VU47dOH5C44ZdvVUicohEBZQNYsil+iGviQcNblNgea5nplDkwxXHqTImVkH8SpytBi9liTaiHEPlrPfYA1MTC7R5wktprk1hzsL724y9Mpv6ODJPwYZ+O7QwEfFAIPSrDBXekaSTvgqd7EldYyvk4Nv4uwcapcoAvBD2p0DGcb7c/rmYtW/nXZW3uAZWYj3GCvR4XTFyMfcFZ+Mj8S7G3uwTbmPKmN3ymYyOBuFKF7ayzA2DnW+qbSEtRC7ilW3XJFAo4BitsVyjZ2YWba2rv8LI/yg+dtVtrSLBso0lf03fWOiY3fq9h+8J1Neng0w51v4i9JKqDaocmoKy6T0xw== 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=3Xg3QzICmN8m5yl5q0Qo77o6PzxIUs5dsxgW21z8XNc=; b=A+WibXMRNDCfSkzHD2w7Uf7JsTSoRulGTkfk1X1cKowkV558/XaCG9M5IG6sVhtFESv/tH2b9N3h51Q7WqYbGGJz6yjK0RMM5YeUyTdXt9ier/rDzKakFF93RzOr/TcUppw+ee3d9jnR1G5smw4AsTCsELNAEimXTck/5zJviUoyyQuEyeZV2dgqwnIIsllAOfaXZ0e0T1b9TIsm5CYJvFungcpy6+BdBJ579iPK4UGNtNuepIKtQspUMGzjYJ+5IGvbr+EYeDOL3RWwvz2sThbmtk4tQt2OVFLzoh+eeMWcfNdF6++2kLJnP+d/3U3n1H4cn53ldl4MHKqrf5cRag== 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=3Xg3QzICmN8m5yl5q0Qo77o6PzxIUs5dsxgW21z8XNc=; b=Dhl2UgLJ1aqvol19RtczRnXGfaadPI3Ctbh/gztcLT6+k8ujK9VMcAM8EPOdfJhVAUdOufukmf6g70z1LvSXZ4trlUOL0Lx5IC9y1Tlg0och69Vlv0GOnxJwvA4WvXaXOAUPyJpNLChiuYLZC0sFwDp7OpPD1Ey7wTxur3zMQxJUkP0E/4Yc61fOaKtuIM7mLM6t0iUWd/FJIciiCGYJ+wLapyA+4vLtUlxWsAUgZDF9RkkcpjhxgWTVOiyPhGZAA7j/KBfCQnmpcLkwma8qjjHxDjE5RKSgxh0AKqrMKgoAk/ESCTHqolCUmeVlXG61/g03URt8aDtGsht5iDm4iQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:30 +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.043; Thu, 12 Oct 2023 15:11:30 +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 v13 09/10] migration: Implement MigrateChannelList to hmp migration flow. Date: Thu, 12 Oct 2023 15:10:51 +0000 Message-Id: <20231012151052.154106-10-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d34b4d8-bb2f-4fcd-3de6-08dbcb358343 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: lU6wMxHUdopYU5fIojYbRkeMyVJ8Daq93W7tP29l8s/e24LkqnSZdb4uXcwv8/peNdZxwcNORkGCd14fwPyQVgxGp8OSX2gaCIzszAb6C0nyhV0SBOV5Xb73Pn6NPazNKk7i1grMIs8/3FDH/sqRD+YwdTBX8UlGJDGGNUYMmzcRDJIpE68D7i6fc0ZfICKCrqtONZWW+N3+Hw4jB1ocwxqgE2k9x9uUrKIQMQvvHTQiGR9av9Pj2ZnkNX7Z0pZ7D8i0+NSA3uvzA9mMQAQzJdxHDrUeXl+Yzs1NH/szAMqXwKG9FtCGjZYf+9SPCbfkPwk7dRok7EeQc3Ys9A+XwPeuZvQz9Cce0YAY/71jGILdoZTWAS7RsgTXMkWLvnHQbvVcVyEB/sUSOOfac/8yw1DIxPsbhDiShGS8mTYI9dlE9o9wr7zxYup82NQDQtlet3ZcJNtAduYSBp+QOBCcoxHvxcNQjQBgcQw36mf4cSTvlb5cQxQDBV7A4SWNGVYcQjk+NaIelUNCYVYl33+Werarb92SVpgFyD3NDF4AgKWVDLiMCPD4WEkPsCVlenFS9nPY0Pxomm7SZHyqOn6+qrxbeQK6DNW5u4Ff6gJJW+5v++mz6Noh+UTQC5JRKYz66Awjo0J9qf0h9HxCBIhjyw== 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(66899024)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hoskpACS8lS1MVJuNZIvq/xhuKATDT+dW8S519LZk2vPQxYP37fi/PFig28xFomdjz+b6qOP4TLWVKmNX8qXel388o7bSGJWaeL25irrbpt4qnFnzq8QPmtrR3rsUzJm5aXXPYs5ymhCCb7oc0egpgqm45wlrJJjqGQ9UB2g4/ZvMDmKswUwOMhKfw0+KWINVUiYlikb+Wk1Tyvi+2nQ+MGzprtM+HCXIs5KGEe6wGLPoqXboBoKXnfWFohfcNM1x61HGExcG/nv9wbooW5m/l2ZFWhFR4HAqJU8l0VYQpchjmpAKuf3k79AFX0/OJSlKQud/R33tuJK9rkCiFia8Fk3fjdTutUxTRWYPZUSVQGxg+dbEhjKiJvfuH0aCCXdbdEj1ElYOsVuJ+BZAJvkYxNhr9+wx9qkV3DlkcpxdkKIQDcMsQya5Sm/T0HEsUEuiVDuF01hSvg9mUnJfEIB0MypsX9E8folcq80jXi5dr3qyogG2xT2I0p0pPF0y/mFmkaThTuJ/UE7Lr0W9VFsXVEvR81jWa5Lr9X4H107VyY3p4c73c5uCterTDSpfwttpIrbAehQgLEayl6F2qnDbYPC9/skzxWo++BL8Sgd4vvMtxth4tthz7v/Jd7W3wOePAdCkGPaNLWQK87uJeI8KYi5aW3dviaZYQnjJAnfTIDvz23rhzq3nRq0BIIO09zODCpNc/2kmqetu/jo+rbi7zZM9LpGIdL5QRWzbRmMrIK7dDoXHvRvqRgiqp2y+OIWmQZOMa8fKXa60chkCuYdOW+uaH1eeuE2p3/v/C7MUHu7fnV3Odq44tRrh13FX5dCoP16dAUhWYkRl4rPB4zICItDPSi42WzDUbcdRmkbXyT6k/f1ZJYDRBN8jhj15ZawoCx4wb93JhnGNnn7WFw2LK4L3S82SJUi3UIxRfVQQmWgsE0jzeUYQ1N0hbAVj4xzffk/XkiDlwfYkQxtEyoGSEApu2Pgvj8eoGMeiKveMfSe5mKaxvoL85AQsNI0/lKn9LbnTGuURSAJEStbCH8C70ETp+VrxJUmHK1y922gEWKahzEyxJ84h67S8Mud3HVd4EXBIM7+ArMCzXW0HAJKwBVCMBozGd3WaIHIIgoZWGpkfdrWuZvGnvbOOvbvA22oqN6yhbPBGZCJ4Vtd7TbZOGZYrXFH1JYe42+hrj+3XMyG/UHs4L05du3j4a33ccdcuMRo7ziUCIdjnYuAE1t8qs2fMjSj9iwtpnZWKkNWOziS1oISloE95rjFKKIxO23FQKRwQ7FctuqDWRgUc+7ZsDrJ1CbQuVPWtVlLxft3EyEgFw+eW98W+maiQPbZl/QwUEDakwR/hVTaRiISRVPSh/+DOygq7A4nmueCBdIPBktc0squROK9wXq3MbknCtUy0bnycvAEQAAxlyBI46+qKyun3lkxjs0o4i+e7dAceqGPdju6IdbU/Kb3tnig6PIrKhUwGqF4kTWKOYvaQm3v754TjKu4csXwFp9IYQiLxh5bwEjOsKHWdhTR7irSMxyX20FpPxzC20kC7b/uyjQok3ZV70KUwkN/z2q+JG4oM8YDgIJeNVE6cu9maMOEuliy X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d34b4d8-bb2f-4fcd-3de6-08dbcb358343 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:30.0754 (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: 2Vc1xvvOzc9+UEmxpuprRxcnCXYltt6WEcRqc3ClMqC++Gi+cmQFT3wx+Iey3kNLbrsayNTyYvhJqpMQOxamtw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: nJ_jmnVGkob37XE-DLwdLJdFhn-sbOon X-Proofpoint-GUID: nJ_jmnVGkob37XE-DLwdLJdFhn-sbOon 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-12_05,2023-10-12_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 | 27 ++++++++++++++++++++++----- migration/migration.c | 5 ++--- migration/migration.h | 3 ++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index a2e6a5c51e..6799a699cf 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -441,9 +441,18 @@ 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); + if (!migrate_uri_parse(uri, &channel, &err)) { + goto end; + } + QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel)); + + qmp_migrate_incoming(NULL, true, caps, &err); + qapi_free_MigrationChannelList(caps); +end: hmp_handle_error(mon, err); } @@ -730,12 +739,17 @@ 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, - false, false, true, resume, &err); - if (hmp_handle_error(mon, err)) { - return; + if (!migrate_uri_parse(uri, &channel, &err)) { + goto end; } + QAPI_LIST_PREPEND(caps, g_steal_pointer(&channel)); + + qmp_migrate(NULL, true, caps, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); + qapi_free_MigrationChannelList(caps); if (!detach) { HMPMigrationStatus *status; @@ -753,6 +767,9 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) status); timer_mod(status->timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME)); } + +end: + hmp_handle_error(mon, err); } void migrate_set_capability_completion(ReadLineState *rs, int nb_args, diff --git a/migration/migration.c b/migration/migration.c index 7db1f3196e..ec01ad34ec 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 cd5534337c..2da414e8cf 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -518,7 +518,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 Thu Oct 12 15:10:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13419371 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 23E93C41513 for ; Thu, 12 Oct 2023 15:14:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qqxLl-0006Vy-Na; Thu, 12 Oct 2023 11:11:45 -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 1qqxLi-0006PH-5M for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:42 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qqxLg-0003hM-C1 for qemu-devel@nongnu.org; Thu, 12 Oct 2023 11:11:41 -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 39CAbVNZ017937; Thu, 12 Oct 2023 08:11: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=QoW/P8p35bgYCjUdJZA4EBFFAEkJQRHt7iq1qi2A0 R8=; b=GcyMj2FwWXjg7iXuNJl40nMkQdreGtrjeoxGZae0pFKv14OdBj2oBQfFM fis/LukT/SGu7p05GQNHeFD4VlOdSEEYC9iMhd0qYgHZccAjHJT/6NE4lMbwXjvW TRnAoCwRVD3zyy281R+Pc5ipBxHcjeMcx0+a52xATfntWrIYx3LzNRwD2XBeTS2X d62AKsRTqbhFmvwIsYnleZ4L+wIklvwzyW3FfpX1Ql7mdb176QEqzZiQOAS/2pAR /G9anFQFuODud7Dpiu2LbkUnaGkIiFdpSYKymCXWtF6K0JCu6Wy4DTwNx2VVLBNs v4r8cyMhZlBnlAyH9NrLbb/Mhmztg== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhv0bhs2-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 08:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mzxUnTdjSjRk1d2Vl3SBBEic2I+FA6qoD48eqsP+yHOwOB089kIVweUXq44LKgkSwS0rro0wSf2dpGXBIYl8PuoFGmTGDgKFPDerKYzb1I0iFGZIrbryEX3Yr2+LgyGnaZ7M/ZL0X3cU6eN1+iZFYA/CpfhcK4URnQHORJlQy1WHi1h8TPGFUQ8mM4wcLJNfZojyHf+LxIyaMrkbow17YCtuDimGh5PSwyW5l5U63ZnywZ6VbUoZlS0Y0RH+3q5rdB6gIMV43WxArgHidbYpsWKAEKuX57ZNj4nWY6/GxyJ8omh28G19EVmmfNiiPSCLJTljIVBZJIDi/+3t87yKBw== 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=QoW/P8p35bgYCjUdJZA4EBFFAEkJQRHt7iq1qi2A0R8=; b=lIPn1eNYxOL89KAO8On7Btw2f2G1aN90qwx+6eNfKS5F92v4nSCBI8OU6kx8UnVKMcuNM/BibFu6StBNFdt2gYSq8Xs8OO8Pr7BsJ7XraFPYdRGmmxv4npm8ch3K3QMV+QHs7iNIITplhGwZq3P0U1jOjTyCj3ivE2/lYQtkRgO4GXEt1SUy0EIJTFhI1qbeBnFqcG7viEfBkv3KG27pl/ak6eEumKfYfY/pq4tz5+MyJ/1uec6B1xZqKUGGwCGTn81untHNpLqqS/oHF7gabyRV6JSNU26PtOUkkZ9gm65loe75KiaISc0zA+coQlQ6RqaVcQE6r8/9NzlpGdkieg== 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=QoW/P8p35bgYCjUdJZA4EBFFAEkJQRHt7iq1qi2A0R8=; b=QP8aJiSzw673QFEmjjMdESxQTukWPAxtiobXIhuxTeiYR0SnEjjhvSqKnxPV+gxmt8U0e/inz3IWiHWp3pgsL4zBpsFnEVZBzjvwKzpblNRGc1yMcZ2Hl9rXVsRdiZOxSr8L/n13a7raeq9hrWMkbI545QHO8HZ5rRgOGngr3OxLytgb0MO1d4yl57LJCwCw0rgWxhaIlvPXtD+DPps3f70XB3ONf0yybm2fdueD9bpceLpE6qE/ug+dUdELugLIEQJjlfsp6utn+1Pi7eyLMf/kGpAObMWXLa+gGVDrBCEPbw5OWHsXKu2sYFG8fpLXP9iPn6bLKMEmm8jIFPq2YA== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by IA0PR02MB9510.namprd02.prod.outlook.com (2603:10b6:208:403::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Thu, 12 Oct 2023 15:11:33 +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.043; Thu, 12 Oct 2023 15:11:33 +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 v13 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax. Date: Thu, 12 Oct 2023 15:10:52 +0000 Message-Id: <20231012151052.154106-11-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231012151052.154106-1-het.gala@nutanix.com> References: <20231012151052.154106-1-het.gala@nutanix.com> X-ClientProxiedBy: MN2PR12CA0004.namprd12.prod.outlook.com (2603:10b6:208:a8::17) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|IA0PR02MB9510:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cc50b6c-7c20-4a52-1f68-08dbcb358520 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: DmMtsJwIGUc6fpYy15mOlsIwrnBFmtQgzJRUZ3YlDh/lMyWm30qEaFoh2VCBMU+yiPZYc18XqptZ11nsVUaZPIBe2RszdzREafEphMOE/NT9EG/53xcGg7dH8Ak1RvmuGS8A/7Ad1/FyN4lYiBW95QHAQQfNh7Syzpi+qtT0yHJsqDgcA3PCY8WKeg6AeCH/DZVOhPXaZ8Q7TBlnCOS3KuyDVXLboQz60wVPbKeNg7gZz6ziBJxtBXMFQe6u1fQasAspjM7C6wo0pGWJqkdUl+9y0DXfg/OxHw0vsX/vPhN3kGK/QGaGL5wPgGuupb9F8UTtvB1+DfnsMH6b6bSkYvpVpiPENyjka2wxrdMSNesHmwMbPd4C0BOYb/B7kHXynwrfan66KCqxRFcn37yqRgSqfNXqKzLr9e9IIwSUJOqz6GlOElN01jVlj1WOGgB3uS4/0KB1IEHEE42PWhURslN9WmmfJ8o5bwtS5Nfvxl/TkErKBXJ4nMYLybJoWK3cfrlsYWckqQLFRLua/VSr1L0pYobGWs9mHg4EbllbKxVEum+aQmSMxLX6lYaQ3O00dW3MGvM2WvvD/KufVl06IqwGbi/254aUqagUHFFaWPyZfMyWe1hyC9VjWIdBOUfc 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)(396003)(136003)(376002)(346002)(366004)(39860400002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(6512007)(38350700002)(38100700002)(26005)(2616005)(1076003)(107886003)(478600001)(6486002)(44832011)(5660300002)(8936002)(4326008)(8676002)(86362001)(4744005)(2906002)(6916009)(316002)(66476007)(36756003)(41300700001)(66556008)(66946007)(6666004)(52116002)(6506007)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pFFRCuLQ8tZT5eEcOYWxGX9rwIbxIBjKSIGrflOmznRMNBqXnK4SrfIOVAtLcnycIlsDLDcxijGtOOb8gNbwpUT8J3BR9F3PXdxhZ6iNH6B0MZ+TS++XxAzk+ctay14ycXDDCrHwsHT9fWucg/h/p3gNPES76ybQ3xZSiHeTCbR+A1fw9rkXv6JCVD2HBagHJYkKK146qU0o+O/mcg0/50VAWdfQeT3Qn+wvgQIPgBYqvTzARlRGgFuUX7CoiydKaAWCRA87N02nU4Pb96DlqU0+/QqmJDRMpKznGKzoehwLY5SAL8b/8cIGCpHFwd92ompmji4Jj4dP+JVrCQyH0Ewg0h/JocR0SFsNSwUeZfW5o9o2omJDh/scZfQhiT5Dp2Lbwl7Uib42bQw1WGPsjBnet47jMx63SCnlYPotuJ/rWoiR2nXkwShGzpxfrHmm5cjYWLMFePI3GDLKE0xmSMRKMqVi/0OU4hH7XK9TQSUzELlJH3FJ8t7CvC/m7Zq+irFB20CTFdAeXjpTGubw/FJP794omby169fYAvF8/l9IEGxUqqO24WkdTpdRuEpQ1pgALl0Ao39uA+6Ob393S9N+3qqyHN30iznEwPBfw9v4oBJiR2L+4RqoSOWIFE4o2DpmRQ5q3IZNWpGJu/RS1DPFRXiTjxtB3Skg4xQczYZQDVi3hjPeDGLA16vyJ2NT1/Z08AcG6RMoZ+ShhhZmQyCJhTzJfi79S21e+nSJk94eyakBg6/cqxUidymBZEO5AlIw0wtuWgXFD6ce4hHwwgShTraxdkcNbEfTzFD19CRBM2kANGWmuurTKaSO43HOJIyPyKMRXCgzNuR37lrHqMYWIXZq8JOtGnXhVfnZufWXZNdrp6Htkfw9IzvqRuN1qz0cuYElxzpVDbQg8TKQovTi41AJQaWL4mwWzjh4EG0/uRrN42ouzKNce5u+hgRqTlKXznLpzNAYC+h22IUkG0vYF887uinomyAaAm751vncfqfdiIgSDPivEIs6Wk/AV2lTCCVyaNNetcqkJ718ObZPMDAdhqpdbER6Pr5Xw0cvpdYS3yisbUV+ymAgrxADxlWNJ4IJ3wDBE5S84L9CmuY+B50eWUorKe5qmWtfAXQ4owjPq7Y6z9lkAhJu2/vB5aZC0okUOyytjebLeCNctzCCjvSBW1i2eYtrFNbi4izrzuBrjJ+xNfX950X4NMbxrqPn3Zdo7CWh79icrreXZJRG1OHHS3Lzj3d7I6cFgpzd3ukgQm85/HYAKSAlqFnMB6Rbjjq6rXKTjWYgeUBOQMDrsUVdX+6ROf05q3ZsAm07AFvNGxh4xsaYUpUVK3Ji1oWkb0BOis7yhtGGmsUqSTPhqidxjlHhVZNbUq4KkX2ZzLEWC6Gat8LgRMng/At8tYc/Oa/b0pmnJWd6tn1B/fayU45qCW7sFG5rMCVOhMor09AYkcGMaZAyk80JY5qUs1gMGnWABk2YcNjU4Ga8zVACniIM0Se7BZi9aKKfURRSpnWoKKh4aN/NILYEi7ziHja0ZcaVURZOOyj66jIqVujXFOnlOlz/wuTFjFNoGk+xp7MAGKnQah2lEISqPVCpFM0mSgWUSpzRJrc+Y9PPMg== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cc50b6c-7c20-4a52-1f68-08dbcb358520 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2023 15:11:33.2797 (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: xJxpkV8QtPgd0f5kiOJ6oesn+X4HlzTUTybxKml8nuJySLSUAoJKICCTYwyXtbn712lsZK1IBhumxzdjn//Nqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9510 X-Proofpoint-ORIG-GUID: S4n_nS9cnA_wlfYdqkyjPoDgDrPzyUb2 X-Proofpoint-GUID: S4n_nS9cnA_wlfYdqkyjPoDgDrPzyUb2 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-12_05,2023-10-12_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 8eb2053dbb..274e03db43 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1277,7 +1277,12 @@ static int migrate_postcopy_prepare(QTestState **from_ptr, migrate_prepare_for_dirty_mem(from); 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' } } ] } }"); /* Wait for the first serial output from the source */ wait_for_serial("src_serial");