From patchwork Wed Jul 26 14:18:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328215 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 7B9FCC0015E for ; Wed, 26 Jul 2023 15:02:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfMY-0003rW-E7; Wed, 26 Jul 2023 10:19:38 -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 1qOfLo-0003MM-CR for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:52 -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 1qOfLl-00015w-6L for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:52 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36QDC32K032511; Wed, 26 Jul 2023 07:18:46 -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=DKQM8nmKY7bFayiJadfN5KzX6LzU1yqvEnGMcIEVs LA=; b=tieVZD7qCvurUJXLJej66LjiYOgBdvxm3s4x0kLwM/am8LVd8zweQdMGF MikTyflzG1dqqaRiBrmUJ6AesTfsWOhQzRnDsQoIqGnQS2lZeVqo+J9BKfEdJKHf wVQvAMCd1A3UInK7s1tA3kUxBL5AocVV+NAleV3bPKi5RhMs+BGjNS+b1stJcsN1 zF8wIAWVlFrmGLe+BWNDPecGWkTXXPrQL/9Jt8YOlrl0NRXP3cONpO/PS4mp2NCz x6CKAvbEGy8qzTPfIMByn79kWw4LjXVeWgHCVdf8jPw2neCOFj79Xe2eElonvbPW tZ268Mt2omchcP33gh+cNVIdNC0sQ== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0b1707wq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lJNW08w2uL0WgBzHd7wXDS6I2TMyFWXJFBoHnlaJUG2CtERQwDs9Tvry31ydhqwBUYEInsXTVhHGcUbF2UPOMqKISO42KJTGjxOiJOOltQvDud9q6/CqwvfJlWgS7Fg2yPV7OQN6cj0Dx8uAtcGjU4umMEATEtPuhhDEP3kWcWMLcrUD76WWKqU3Gz7vsmZsfdDKsLoTZf6+HuDURg0DhrnliDtlceWO+wNeON12lGDE0XpLNeiLKjj8SCcxe3TSTMNbdxIHXymYWZuy9SDiZttln/HOdwjxe0kqz6qBbPnDBPKjoHQRY0xjUmKGJs16EoicS+C4PXNTQd5gZLtpbg== 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=DKQM8nmKY7bFayiJadfN5KzX6LzU1yqvEnGMcIEVsLA=; b=JefJDUJ9xvA8DEPlmbWIOLKsUlw7WxuIG3cGAJ/SLf0YNdytMOPE5Z57khDoTDhYqVAc227UbYwLtpeKUZ5BXjkL6MaLq4GFr7mQ+2ZEF5wJl4Xz3GW7Zu0sh3K8OWiQ+TCzs1Q53TffMj9jJY+yMvKnmI3AuththL4B3x6mcW14Hy/uMPZoI8hooiCxYVpFT2qqzr5V2LtMXBhFxf4TrO0EmU803fQRdkwswC5jcVpFuXW/5InIVLWHCPq675DPh4Ox8zmsWugwPiDbpRuzZfGAGJ1J22hE748OLK/owEiNCrRUuOPUbGOddfR95Z1Ya6VF/kHOBgLBqh4pL8eHKw== 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=DKQM8nmKY7bFayiJadfN5KzX6LzU1yqvEnGMcIEVsLA=; b=eVLFIXXxylUlw9k1fRr3xwoqSfqOp1zZKbyN8eQbQmNifY+O+HA9HyRnpGwMXmU3DmWwOtlahV99LtMw4Ozc4LdnzJZCO6VgCwPepW/Ck8dVtXXJ882j9YJ3KzJuXZHHrot+yqeEeZ1T2bBPtcmPd2RFSUJhvGtJHF6zbsNg3GY/IzFut+2ZPDE5++OyHOMmmn6T4Y9tliKz/J2ludci/iISY770kddQRy9NRbdxSg14OeDcP5YHclxG57k83CCXhJgNIWj71U1mR3uJZJBk/Y8udRFx0vVvvFQ25+1+d+wR0iftuQdFzW1yyepxI/4rZ2h8brIgx9Lv31Y+aOvI2A== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:42 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:41 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 01/10] migration: New QAPI type 'MigrateAddress' Date: Wed, 26 Jul 2023 14:18:24 +0000 Message-Id: <20230726141833.50252-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 0765e3dc-d62a-4109-aa1f-08db8de33627 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: 9Iq971KrgOk1lDiX00loAhkPZkL3b/BP2NueGcw8fEaW+AUd3oXD+VKUjhne6zXK4ViQKymf2Kj8dELnkBvTVGoOydWZL1FLXgkGLOJwTTEZRPSJ9jyhQZPOUpWP8Htye7efDhPTQnMLB8HJ3tytJO/HmY+PMftMZmlyStAmRK59vkC9v3eCK1yobxNs0K6SWQMOBRf8wM/Eni3CuAylBxBPKkNc3MZWPV3EYEdge4+fdWJa4rJwfBojgww3MIiPyFa44t79MWnadvaoRY0QZjLOWFufHLNB5HonB0FSiC7K+J1aINKeBiUAYxb9Ls7nS2pX09PLbnYlL6FH9gZEVrlyt03uRpYl1mcb7zJZsm7LwPXhYpQD8JTcuLXamuMFtHhU/DDeLuG6wMUOxKnrfVK6RxK2A9RVK0WdrX5oaW+uud8wYv4+pSE+fLnEGoYRwVeMraqh96LvphdarE+KO9BZStj3Xt8qsy+qAOhoFRvyiU9Jx3R3sZZMDUSabemJCDoMZAHcJ6Iqhgw1DZEL7dNH7Zvh2tb7c+PFgC1B4nuDpzY6sjlDKGk4b9jzjwjSfKudmqujOAttt1LGxZHV3mi9FyGqS1fYWPvGgFloIfsKtnomRz5jduOJRT/j6dJb X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(66899021)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?m3K8MJOse0XGap+s1OngId3xiBX6?= =?utf-8?q?4POgDGG18qbWAYuzaOMlTuzttea+UTCNM0bLOz9Sx2/24eWCIif/DKZHL6C9kDfYG?= =?utf-8?q?4JbVWFC901c8St8rBbJUmxHlgPAjRh78frYNtlnZGmgP2uzHOqKM2tvwmJ577Id4q?= =?utf-8?q?7O91zuZ1+pHp7StP+OPbU6qol1Qs48dFnxi/YkwCBIvwvrfhdRl7oHWNldLPUBX2D?= =?utf-8?q?1OwdIED/3NwLkHv1QZB0ocU/3JLmkmn5IOmunsDIxRfWR9DnxJURc5nn0z2yyKX9G?= =?utf-8?q?1G2HdCFCCNDD9O1Hgh3ExJNw/msoIGddMDXyoiXLaLFNOq9jCmUMD2uTnhP4ExriV?= =?utf-8?q?lGn8bA8TnMle4/vyxM/mGqbrv1X+Dr/VpGTUY2uvCpiaunoRNUl9TuPt1iQgwBtMF?= =?utf-8?q?VN7vAcxQvF9VDQO2UceiyyI07XYiT8cqCX+xh+0svOzfC9lAXq6++XQzBAsHUm/+Y?= =?utf-8?q?nVNu2DFtrLakl7in+zOIaEMsgeULFcOd+wK8PVSr/AwVqIA6ppVtgpmjQgsTv6Sw6?= =?utf-8?q?DQwS/9RL69aU1575nPxPXgHDEb6RYR34PbTVMOykQNER+GJAQG6O6rQ3EdIun8eJN?= =?utf-8?q?C37/vDqB9djyxH4gtsnZlJVXwa3tgi9T5jyNk83Z+1tt6smTxJ9Md1BzOHjbq5e/g?= =?utf-8?q?183jqxdQeC8GRTUY6Yg8BFP9gbKCMGzQUHBZ7XiDRP3xwcaRcXLJWxdsEO1yiJQKZ?= =?utf-8?q?ZJyYsf7+qhL5J6xTAUfs6gA4gpORBfHhRi5vpQW+iYIAGc7hWl+eqMWW9k7b9MEvu?= =?utf-8?q?XRlMT/hdDXqKjBg4qUEvSiFuyzMZD2EiwWaaCS0JKfrADe/bqKFoyag/D7wll+m0u?= =?utf-8?q?6W2IYz22J8Wc6RvvB92V3wp0QcukSVFL2J+ZHLNA+4QtP4nI/dnot9jePf/6AEgBs?= =?utf-8?q?vKosJBv9maiHqSZ56feH4ax8eyDemnWg4NVe3fDtBMQAHP+aK12wpiwm1nGn48+Sz?= =?utf-8?q?BnnDODq+6gbRLWi7MlfFyCm/F9xo4r2rgwdHr87OIOj1mWV0p09HCzpCgFmuxKDb3?= =?utf-8?q?6k9ItC0/68E6zSH6ivkn89zjJnm6PENjfpqYYDlma7IuAisT5/PK7rbySWGvzTHkA?= =?utf-8?q?/y0a9FQkTKbDH+tPvOnBbL4XIUxf4+1tzT4UJn8+Jw/lfqfPbTgJRsKSN3kh0RPW2?= =?utf-8?q?a68/tuv1ftzI/KEvKBKpLR5aVMwnBNq5Okl7M47/FHOVX+gz7NUdfNXofen1YCuc9?= =?utf-8?q?GKOWZR4xr8Em8xxQE9vRE126iiYFHwflPVTywkSX2pK7d3PqSQeXiySb+FKWs7C2M?= =?utf-8?q?SamN3pO+qwIOV0xytzN0wyKfpz5H8O+aM+DzVcTvxQM+9oHtz4kc4lFKkrG+sZyFc?= =?utf-8?q?HrvYN1qlOkAgKPM+NG6tpGoEZGlz3ITmwgzerJv9AhCGgtLkcSE/e4yn01JXvnORA?= =?utf-8?q?aREpUEC3oXtTMp8AZuOegZ/AM4E58OOSBTCfkekyReYHanSHSzd44g9mVjbMlpZ4j?= =?utf-8?q?F/QnptXXlD5W6BKVzubj8ayizaslrgFc5jVUl8/1UdYzqG6mpWwTtbwfdmh2S+ey+?= =?utf-8?q?7C1EwyTnK64Ce9NUyGhDHjd5QKNeaOzqEg=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0765e3dc-d62a-4109-aa1f-08db8de33627 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:41.0847 (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: C8JaS0hz9w19KnGUyk2VcQ/V7vdkA0mKJ6YG34J6Z3GVXFT+XfRCeTKepzLX0LM/Wt+o5v2LPKtJ54sn7k+18g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: nZ01Li5zGb4ixDiK89kEh9lzJlN-9mFr X-Proofpoint-ORIG-GUID: nZ01Li5zGb4ixDiK89kEh9lzJlN-9mFr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This patch introduces well defined MigrateAddress struct and its related child objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of type string. The current implementation follows double encoding scheme for fetching migration parameters like 'uri' and this is not an ideal design. Motive for intoducing struct level design is to prevent double encoding of QAPI arguments, as Qemu should be able to directly use the QAPI arguments without any level of encoding. Note: this commit only adds the type, and actual uses comes in later commits. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Juan Quintela Reviewed-by: Daniel P. Berrangé Acked-by: Markus Armbruster --- qapi/migration.json | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/qapi/migration.json b/qapi/migration.json index 2a6565a0f8..6b97ce9633 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1417,6 +1417,47 @@ ## { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} } +## +# @MigrationAddressType: +# +# The migration stream transport mechanisms. +# +# @socket: Migrate via socket. +# +# @exec: Direct the migration stream to another process. +# +# @rdma: Migrate via RDMA. +# +# Since 8.2 +## +{ 'enum': 'MigrationAddressType', + 'data': ['socket', 'exec', 'rdma'] } + +## +# @MigrationExecCommand: +# +# @args: command (list head) and arguments to execute. +# +# Since 8.2 +## +{ 'struct': 'MigrationExecCommand', + 'data': {'args': [ 'str' ] } } + +## +# @MigrationAddress: +# +# Migration endpoint configuration. +# +# Since 8.2 +## +{ 'union': 'MigrationAddress', + 'base': { 'transport' : 'MigrationAddressType'}, + 'discriminator': 'transport', + 'data': { + 'socket': 'SocketAddress', + 'exec': 'MigrationExecCommand', + 'rdma': 'InetSocketAddress' } } + ## # @migrate: # From patchwork Wed Jul 26 14:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328284 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 D0E26C0015E for ; Wed, 26 Jul 2023 15:19:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfM2-0003Q5-IW; Wed, 26 Jul 2023 10:19:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOfLp-0003Md-Qy for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:54 -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 1qOfLm-00018S-2m for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:53 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36QDC32M032511; Wed, 26 Jul 2023 07:18:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=Mcj0Yu6E3uHHH/C0y8c67jmjidYRyXgmwHY0SLWF3 2w=; b=JqeV46OKdZCvgslNUSEcvpbYGVTkBQkX5nMnjacpR6E517HTgghMGQW9J PgrRTXyh/YjHclXca5RTN3Gx8PgzhOjBKXJXhT/wnQ1CXGbdOpmgYheGipc5fNec nj+kPDMKcIAUY9iVhgk0eiGAPrRSothJwb5o69nq3eV9UiG9yt4E9Drq4LD8dGZp quu7VevIzTNxUCOsCRVEoCEPzLFU8BabBFmSM6YRkX7yDlyy+gAUXdQgTA/ijB10 OlqjdD8z6XSt8mb41z+9kPJj/KvPYigLMUDc0ABLCJouIB9uwz6/+4UbmopHq7er tMM4xWIxe0QPk6rSw285006WIya6Q== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0b1707wq-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X+CsBUSRUX3SkXRazuZHpNqy6TJfGhSH5nzw2MetVm0jj7O2QYQC6oBxIS2xftd8T7jB0CaRCbMxXtrBN5N06xo+sPh6q8O7tvVHrFcNOo2GqGXX9j2ods0VdecORUQurJJF7/lUSDuKZfVARlOvIPl4uVpF2wcEYlm8iIClWXW1b2Rx9r/CcZa25kW8KO7X0SKiYq/y8OBjwj9jdRvFJviflbwe9n8ilZyI0wWZqucw/f+RYm1yiCcnO2nbSntNyjYhz6F79FNNbaJTiJ2wDjUVlO93y4nAwdZqp2o2ouV7fIU0EkN5dVdhD/Ebc7WVGT2szADq30WfOYmTScZvMQ== 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=Mcj0Yu6E3uHHH/C0y8c67jmjidYRyXgmwHY0SLWF32w=; b=Ouitrh0l2mX0O+DRqhj1jCaReTlMo1BuCCBRasy9QxTZl0ipUUTJ/V9s9GIUmRIRECYKxN6wCZphsV6/OiaMBaFTKQtfmiP6DK/MavFhBZze1FcHv3971Z6kS5RhBNwD7WwzWJVMAUwzITJtofxadYJBVFY29JRrPZwEpDVqbfe/SJlsREk6ANpSL/7r85UT+sYBtVCweMN6oSu1XZA5zok2q2CiIBxN3PitAVmdz6HCQ08p4nM06oflHpgN7REx3YOzkPcdUY7pKhiELX6rbwPnnnHr1CAssMyVpknvMGQE68tRSo2RWSuRuK3mQ4VHTN6+26nfnYaH0OHMAiCrLw== 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=Mcj0Yu6E3uHHH/C0y8c67jmjidYRyXgmwHY0SLWF32w=; b=LKl5oABG0GWZPBj4jgoukAlKjxOFQEJhOLh6dYKOeH8nL+H+lKxQTyJUHywBrJoKHTHwcX46135Cj3Sn4TrKDAzgRcsfUSdgvEH5cPRll0EFSHpZ5f+EZygWkaHX2wMehGELcR7OfC7frles4/zR/sWOqyLXOP9sBpvG7KoEbVhdDabE7kcuok6Y4JZAGi0gFbxBI/npP5D+VbE5miOAmsbiEGKtrO8JHXOL2C1BK+/pwLaanexSYhDzBRFVqYVSPEST92M20hE0JFfKzv2et9ZMH7j9ykZFEfGjEZTThVsz/Ie+lFJgtlgAxjxumgzK8XVyZEcBgwEdDb4sgZw0mA== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:43 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:43 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 02/10] migration: convert migration 'uri' into 'MigrateAddress' Date: Wed, 26 Jul 2023 14:18:25 +0000 Message-Id: <20230726141833.50252-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: a8359548-6feb-474f-fe1c-08db8de33702 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: sUlr4c+Y7eWaqqTE4B7Ob5s3VqcrfRTcswRqL7MZCT6FV9MaFT83PFbg2I4YGUEgwDWuPQemPh2Jb4VwbF7/gAfCK2WIlKKKh3pKzphL5PXUuVqL4Z+pZfpqqC34ijnOoXXoh2t1sbv+vfToaBGbV6ulIb1vy9Z3Y0jgX70St2I3ykB2abneiZchPpU9bkMMKaGoQX/YMXIaDYgzTZWjvwdYsE/dONkB67viPuutBCfy0AHgDiyDGuTwUPyp9TSWPRpyoFqjbuuZqW4kP47x7eZFJhhOuqlDwtHaPGP3WfiLrYoRmn5ZWJ5d0EqxKA71OR0QwVA1cgy8kYRP1sf3aAsvtMbR6CxAgTH0zf77Ux4St1cKZm2vCmIH1QoUqxkqnW1i1Tawu8RTmMzVraTa8QuRQrAUnVwvrb+5jyVnW7OX2MWo3BHy6kpYHzxIWom456w9AjOHE5YQxRCvA3513TpsPcYrh87eb1wa+9wgqjj4aXvsJ96xg0SJFJsm3bwkj1SiXZ1uh9K3vuLm/qraHehAAFSwWPvNpo/YjvTgDzNhLSHg95YYeecPHOd0E9TJkpqBKgOTkShiABQ7XQnzUx50LOscZiYCRRD05V6iZ7ZLbu99Ej03rNR5xc09OTQv X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?n8AFQ2yP28v/AEbjSjDHbe3RgPMg?= =?utf-8?q?l5KPRwpI2mlZmq7oKEu88XOaNgzuy0vg0X/okHV0Kr7sW14vPpn7tvDeXxdEPIVB5?= =?utf-8?q?MdjulrR5hchiBxF7Q7oytwE/GKH71xa3D33qMKDxKBrUJhFJnj8W79LFyglCR0w0J?= =?utf-8?q?cqiS7eX887GKT25FaQlda3ACw8yZ8V84Qx/3AyDKejoNF6ElOpAvtUcBpHUnS6MK/?= =?utf-8?q?zfy6ePD1xmG5WcBZMrL19J/uNkaEmhnzP/s+7dRyjv4VrvMfD/rWFVLLC7xXMfA7d?= =?utf-8?q?tYITS4nimLgs9qt1RslKf4TUvNt8zeH4pOz0mPFiISv+c4BaXHpuOb9SqOrx86ywW?= =?utf-8?q?K+dwcfUJjG61rz0dmobV133RGfyxQMoF6dETcmOD6n3oH1/Zfwmov+eMyeQD4qjKs?= =?utf-8?q?J5RMaB8aPMVmHg6+YRjHN6A+Jn/BgHCavf59IQHrYWjAjCd4C2X7bPBviFaU2Qjj2?= =?utf-8?q?oDSne9HRYq3Upj9u9ONAr5Sn4UsslGHAT98XP9ulnHFtwz6SOqgHQXpN/Z3y4AAFU?= =?utf-8?q?QfhMUok1KwSBhrWiYkF+dsREriMNGn7GyPWLLJgD7O6H4xDO4VzpIig7WZf8uHPdK?= =?utf-8?q?O0LExoVfb/RgZo6fj23pfxKCzhle/FGvWD4t7Ywf6ldAUp7hB+RiTPI6RBC14dqxN?= =?utf-8?q?C/+XMZj0GkL8U4ytUb7D56cFvI9ATKUyLEZ0B4GMk0XrHCroJPwy2kP/F326a0rYu?= =?utf-8?q?LYtyUFMXvo2DR59PuCXgEr8dyzOfcltawMpTEDuEMHbMBIx8w45sIg7xKSYuizLU9?= =?utf-8?q?70LfB+L0wY7uKo1cB6Kyc4IaHhahaTNYehPmT8jrrXugDbk63n1L990osx8CDEiz9?= =?utf-8?q?4sfsWFaYKjd6B/9GVMp4ljyMXvogwTi0eFy3iVMKeSfvY9y5W3pIIoOEIKBibF0jh?= =?utf-8?q?fipONECsaIWa+RwB8dUmShXcLNuM4AwZEl4QQR0kIn4IxDSgP1OcsgIXu+wGKCV40?= =?utf-8?q?i8iK8Njxthoj44EcwxnrrAitu/M7lMuFyfTGeNTYLETyjw9VqW3E5a8Lx0CTSAfkq?= =?utf-8?q?AtmvZ/TB/TRYWc7kRGgkmUiRLoMLszzAnu+ddLCKQ657k8d2+npXXUUJAu3PiOHyT?= =?utf-8?q?UsMpAQ8IHMQDjSRtPFw/leeS0fVuCvNIMCPHgW/fa/C22Kn/1geA01goL0wigMvL6?= =?utf-8?q?/LqFQ6AVRhPYrxybD0a7IIKScElNJDGOHuy1zpZ3MVOZUOsRt9zEpuq8rqvnAVAT/?= =?utf-8?q?m1fPtfSHYXhLogrZfkz0sVqKPz0M+2MKYBA6D/7DDh4cMji7Iu6ucKV7eWHTidb1P?= =?utf-8?q?pXSN6o1oTV/dYYaKeJ+/d1ce+EsZi2A4e2Hm6ly9/rF3nnHMt+dEw1+Faz3lolu26?= =?utf-8?q?xk4UXLoOOyc1R2xLsH4WraeSEH1DQdEQHUGOUz1PgQPVomsbYXgDi+I9pnCLlUIwH?= =?utf-8?q?j+j1AqLnsI78H4gZY5jzkKMp404fKycgjLEvbWXNmuBxTf8VlvHCeNRAPTWiP1V2B?= =?utf-8?q?URyAhmlmg7ZpmnBbev/RvVwRFn+7T5GF1JrGhFPddk7NE0+rdPi1jyRJ0K3jtiOS0?= =?utf-8?q?JZpBYc2DZ+nz8xL28OgAmJsAXtteIuu8ww=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8359548-6feb-474f-fe1c-08db8de33702 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:42.7868 (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: GpsKvIm3K1f5C1hR/7c036WqcpNQUlpLW/VvJ50kC1gzuQYULcPLr6eogy09ZEeGExIrI3fLD2vqBPAhMBDSOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: XQr5b2S6LAWfG1UmUp12rgmKhMONuCHe X-Proofpoint-ORIG-GUID: XQr5b2S6LAWfG1UmUp12rgmKhMONuCHe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This patch parses 'migrate' and 'migrate-incoming' QAPI's 'uri' string containing migration connection related information and stores them inside well defined 'MigrateAddress' struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/exec.c | 1 - migration/exec.h | 4 ++++ migration/migration.c | 55 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/migration/exec.c b/migration/exec.c index 2bf882bbe1..32f5143dfd 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -27,7 +27,6 @@ #include "qemu/cutils.h" #ifdef WIN32 -const char *exec_get_cmd_path(void); const char *exec_get_cmd_path(void) { g_autofree char *detected_path = g_new(char, MAX_PATH); diff --git a/migration/exec.h b/migration/exec.h index b210ffde7a..736cd71028 100644 --- a/migration/exec.h +++ b/migration/exec.h @@ -19,6 +19,10 @@ #ifndef QEMU_MIGRATION_EXEC_H #define QEMU_MIGRATION_EXEC_H + +#ifdef WIN32 +const char *exec_get_cmd_path(void); +#endif void exec_start_incoming_migration(const char *host_port, Error **errp); void exec_start_outgoing_migration(MigrationState *s, const char *host_port, diff --git a/migration/migration.c b/migration/migration.c index 91bba630a8..5b3be767f0 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -64,6 +64,7 @@ #include "yank_functions.h" #include "sysemu/qtest.h" #include "options.h" +#include "qemu/sockets.h" static NotifierList migration_state_notifiers = NOTIFIER_LIST_INITIALIZER(migration_state_notifiers); @@ -421,15 +422,64 @@ void migrate_add_address(SocketAddress *address) QAPI_CLONE(SocketAddress, address)); } +static bool migrate_uri_parse(const char *uri, + MigrationAddress **channel, + Error **errp) +{ + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); + SocketAddress *saddr = &addr->u.socket; + InetSocketAddress *isock = &addr->u.rdma; + strList **tail = &addr->u.exec.args; + + if (strstart(uri, "exec:", NULL)) { + addr->transport = MIGRATION_ADDRESS_TYPE_EXEC; +#ifdef WIN32 + QAPI_LIST_APPEND(tail, g_strdup(exec_get_cmd_path())); + QAPI_LIST_APPEND(tail, g_strdup("/c")); +#else + QAPI_LIST_APPEND(tail, g_strdup("/bin/sh")); + QAPI_LIST_APPEND(tail, g_strdup("-c")); +#endif + QAPI_LIST_APPEND(tail, g_strdup(uri + strlen("exec:"))); + } else if (strstart(uri, "rdma:", NULL)) { + if (inet_parse(isock, uri + strlen("rdma:"), errp)) { + qapi_free_InetSocketAddress(isock); + return false; + } + addr->transport = MIGRATION_ADDRESS_TYPE_RDMA; + } else if (strstart(uri, "tcp:", NULL) || + strstart(uri, "unix:", NULL) || + strstart(uri, "vsock:", NULL) || + strstart(uri, "fd:", NULL)) { + addr->transport = MIGRATION_ADDRESS_TYPE_SOCKET; + saddr = socket_parse(uri, errp); + if (!saddr) { + qapi_free_SocketAddress(saddr); + return false; + } + } else { + error_setg(errp, "unknown migration protocol: %s", uri); + return false; + } + + *channel = addr; + return true; +} + static void qemu_start_incoming_migration(const char *uri, Error **errp) { const char *p = NULL; + g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; } + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + return; + } + qapi_event_send_migration(MIGRATION_STATUS_SETUP); if (strstart(uri, "tcp:", &p) || strstart(uri, "unix:", NULL) || @@ -1641,12 +1691,17 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, Error *local_err = NULL; MigrationState *s = migrate_get_current(); const char *p = NULL; + g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; } + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + resume_requested = has_resume && resume; if (!migrate_prepare(s, has_blk && blk, has_inc && inc, resume_requested, errp)) { From patchwork Wed Jul 26 14:18:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328298 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 2FD77C001DC for ; Wed, 26 Jul 2023 15:34:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfNB-00047s-B3; Wed, 26 Jul 2023 10:20:17 -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 1qOfLp-0003Me-Uc for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:54 -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 1qOfLn-00019J-Bs for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:53 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36QDC32N032511; Wed, 26 Jul 2023 07:18:49 -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=KpbfUwO7Oi3gEYNbedNRcrtCbcQe2tSGM2vh6Nqxv mw=; b=TMeoiB4oOngWVC50yNk/cL2ttZ7nclYgax5PcQ/rrXenlhzaM1C77O06d PTmtXLvkaAjhYUDAF6r5o7YwgU7F4thHvdr+qME5bbqaxD07/fhFgE6y0YqvTw4E dOVjHLm+fkaWbffdcK0wm5N6zrSlGOuXW6VQ6JeY6JBN6o9b7B5oFfBrIEfqeLDY cMRNBFuWDlHuJyzgoD4xhUmcfTGzdg/kaKcPimMSm/JsQtAI5VYVYkL5pcQIh40w U91/EE89JTKbNzzOO83mzl2PAXTZPA/ClSD9F2hOi5c/NFBySZYMipnUFjC1zj5y dDv9tcKb+W5mR0409zEDUkDDfPLFg== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0b1707wq-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hygiJGg51ckTg9LULLzQ2Fr0wwM+0vMlTOZqCGNBPhiPrnCFAmgDEck320gnkdV1IB+AI90FyuKJWc6XRHcMR9Nrg+Ap2rp/vUVjCPWOLDDkOEvgEVlMl4VdOmgGjIwRDT9+/2bdiZBkE78NNkaE105WDxIxCh/0hbeRJ+yO5m8hAiBr96XlrcNxMCQ6gZdAHuWAuW1MPYTNrr9Nj61lSxob6hlfUh9/yQVbSe7TkJcYSIp+6/y+5/JONk2ZQqCun+XOXLApZ2EbRtyCcyet0mfRgJskw+jCrnRqqgea7z3V1lYYYdRuD3MoRQdjpOugA/trpCLz1G2YkfmQGf3sJQ== 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=KpbfUwO7Oi3gEYNbedNRcrtCbcQe2tSGM2vh6Nqxvmw=; b=KHqDlwlUYjEpGzAnuQNaSScZQ7zI35701nu3c7DFLvEDG7Bh5L08nCMe02mk45eJXAVocAij2BQxFqpdYJ8t8Ncv1l+huEeuoUJKq2sEhMAqBjEVL9irOUZx6Wq8tQclSNCS+k4RfoodmvjKdIfXYI00HjniXJmkjysryfCs9LX8sD1bf2a+U0mRlLUEIc2yTb3KcEL75wdS8bwvKZaA7kV12vl7heAM8BYzKBlY3rfmyvFgDJGoc+BSV4aTmsV+GgmrZ4jtnvshGUyfhUuRuq4zBcIJpjsZdnWyoF33K5Cy9XQicG3NVaqJ5FtbM4CqETuksz7QbqWXq2CvFmxVkQ== 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=KpbfUwO7Oi3gEYNbedNRcrtCbcQe2tSGM2vh6Nqxvmw=; b=yaYCO7z60FKjhPpUZKlFbraHqD9QpFkytMTqrpqsNlku3dhcKzhTMZd9Wi9LxVo0GULX6d+sAULZC0QexZ/7nQT94ke3QKzS67OtElyOgbc4weoi+nLAAvlawIJhVI7sV4nBSqBT2F/ucirzPr0G8FA/s32faHYn+28yN9qNDMdZ0tN2mWw5ClbP9IggByAWy9dtI4pH63oaq3XgYJC1KZkSjF5eSc+6rT2jk5JqxZIM6flKT0sQbZ04vWSG8wL+SAlB2DH+9yWAoTbyvIhAe4oJplaLd8yvECAvoY3ELmn6BnEPYwaBdJL9JNBn2lwsMTr2xqA7Fp/4lC5y9nYDbQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:45 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:45 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 03/10] migration: convert socket backend to accept MigrateAddress Date: Wed, 26 Jul 2023 14:18:26 +0000 Message-Id: <20230726141833.50252-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: cb690939-0cf8-4de6-c2c4-08db8de33831 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: 3KMASVc3SBSjP/dW1FCu96CYoEDRimOdg83HEGLSO0BmPTSaDsJBWP2wq17gfJQoiWEqbwrbkKxhuId0ar3scHTRYBrCQdBm/RMuNgO4x66c6gTD3TOx7kOdQbmR0GhWt0txUwLyBHxtY89z07FJ6a36zbMX/DKC4jjIGqxsFjN6Do1opzdIhnlbDrrmXK+1Y3THQ97gge5CwYxaNFTUJ+KLbEAzxqKv6JwFlQkbE+Be6B7Ms2fk0q1Mig/cAQC2kizieyU7rEEB0L5JZ4p/VJRro8/mOrxAb3P4xkU6LT4XYzVx77F0T4PlUow+upTMizzEn3dZwtBDX5yF/Z9KULUxcDiG1EM9f+FnkhaLPmdo7J1Rq5R21IfngHfBftD10/HqBm0ppuHL0TyA1RH2CpnSFlLzJuGGURYvJBYgbYURspuzmIJFVdgBghPukOaYDa3ZKax01qUE7zthXMHZ/sRUpr4Xlrlvp/8Qig3CYx3I4H+TgveipbjglNS8DwNGIKuE+9quVWdjLvQuFKC2LjrL1k/n1wHbY0rtuUUXYH43dVfVW+bg5Ci3hyPzRRmdZvB1IJSZNwYoOv1lcPn3J1Ty/Ec2nugOQFXGRV7t+Bmx69Jm2x3IkFbketldZ8LD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nZiyotY9w51zfahH2KRzAyYM85vE?= =?utf-8?q?AbSfGQEfzycj0VEPjSIyQV74Slgx3TTDu8RwnuWwGB191BVVezDqLc4WhrB/9avAQ?= =?utf-8?q?XNxsUNb7f7JTqphdtTNDhBOVQeIMwbd5O0HRDqSHG9FqR38mlCDqMFp1uLPcOV9ci?= =?utf-8?q?Hp3GYZXuvvyaReQE3iiwq4T/6LPMm/CVjDb+YYGduj1+zPFPSt2SmjzMo77UWzMlH?= =?utf-8?q?XK9MeqJRkn2vgqxidlqVP48xn5NIFZKLJN1AmiMFofSYCH3ayAemdK2CLn93yPLsq?= =?utf-8?q?DyTaBNHo2/DY5Uge492fJ5d4brqbUvW/RASxLKI/IovT6+U1eXdjuBupcwBo/wEZT?= =?utf-8?q?YdNL6MDUPmTcnXWoqS8GL2kD5G0gGQHHyFrw81Np2D2fu+JLPlld1wk4OjBiTAyYV?= =?utf-8?q?54os75RKgUjsKC7NXjsAQHwEQ+S2gbuD1D/MWzSior8OBP504feRPsfaO+A20WB6L?= =?utf-8?q?YaRZ6cPeWicBtiYHpCbH5dusER7Aq3ZDA94UZEQGbyXueeLskbcPG7gg82IFkOlnD?= =?utf-8?q?6UucueiBDcgxYlb4mkD46J4spWD5EWk+EDC5F5RMH66Oe7AOLQyuY8rQqb3/FiNCA?= =?utf-8?q?q1ZHiLKcmE4hHhwXUGo49Y3nP2KuoyXOX7yJo/dOYlDQyhn4msO7UX8SqQ8QToo8R?= =?utf-8?q?nRDdq1x/8R73mmV901YjG6inFH4M/GQ4Phxh7Su7/yJXvO+R2lWkfTPpDQbYNVw72?= =?utf-8?q?B1Fa3gsbi87YOkpH1mEBP5qvHTM/v3ZeNZuEcR1K83cq+3yYBllyrEsix3gFV1Xx/?= =?utf-8?q?O2x9H4n5yMf+GJLA7KUZ9CYOBiqvOzTnvaqPod0arOwTXOuLMAMaurD+vbA1eSc8X?= =?utf-8?q?9HdNLgPUSCICieBO6IivYZg9H8U+cBasKS5fN2xiUmadw0slYaMkKDRRMNtWCBNC+?= =?utf-8?q?DfdEj4JzRkTnNZwjm7Y33N/1t9d7OvCKYTOPpWhY5XOYAIn6yyTU3bHRiIFCJOPvQ?= =?utf-8?q?NBUIel2R6LfmOlw/XBiFPYZp8b3Ed78NkmFCsIEY7DsmNmBFcrFEEjJAbHhbbyala?= =?utf-8?q?LRg7lPOdpYzb5Op9HzbuWJWY3Tjy7YD2u2CZexxGP+5T0CARJglXlaItW7d4fx3gL?= =?utf-8?q?rY4JTYyAl5bI5MNYnbKhA1cRQtNWeHH+e80z8hP1eFdVzjdaP4lhi2IjQpy4/R0DF?= =?utf-8?q?PA4sQk/Zi7iW0Iyc56RVkub4PnUqh/pAEsIzvl7U60rT8qhJYK5YY/fiGNy4cTghI?= =?utf-8?q?IKbADz+/y5C8ha2aACd9l8W/c2R6bmW5+6HodCk/u2KFA2pW5GGEo1XVbJXTnkCxo?= =?utf-8?q?lKlw29WlAESDG+VkDNjXaLZNA20dU6WD/taKxnpNIj0aatVQxwhzb5umQSyYtIkUt?= =?utf-8?q?kCrNNC9nGKwwFpYWDcUwZA1iqq9O0jaa5a6BZB8ezWbTgpyvnXMWilj4Dh7FyMYGy?= =?utf-8?q?wvPD9WhJXQAyy1IVLODpeoFsWow3b1XawvlGRMv3klGZTFoxPxQ7aol/TMCvfeJeS?= =?utf-8?q?8ULw6bPUR/De7uYIn9zxgCtLPPIG3tHmW6NfSO+KS0lGZ/6dW124CkgpgM2xmQOGc?= =?utf-8?q?Jf8O/BlUWtr2rvP1yHNnj3ivg8N2Rr9XPw=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb690939-0cf8-4de6-c2c4-08db8de33831 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:45.0668 (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: VkeCb8S+95VjD8HlOr0u+YQdH8SDcS+6onLO8W3WlQ07AUmfV5aabxru0SGYdZqllFRw91oMEWGayYQqRj8zWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: 4FPNTMH3ZWUXqtmuysZMyEMtNoQAUilk X-Proofpoint-ORIG-GUID: 4FPNTMH3ZWUXqtmuysZMyEMtNoQAUilk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Socket transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for socket connection into well defined SocketAddress struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 30 ++++++++++++++++++------------ migration/socket.c | 39 +++++++++------------------------------ migration/socket.h | 7 ++++--- 3 files changed, 31 insertions(+), 45 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5b3be767f0..c4bcf8bbd7 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -481,18 +481,21 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) } qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_incoming_migration(p ? p : uri, errp); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_incoming_migration(saddr, errp); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_incoming_migration(saddr->u.fd.str, errp); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_incoming_migration(p, errp); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_incoming_migration(p, errp); - } else if (strstart(uri, "fd:", &p)) { - fd_start_incoming_migration(p, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1715,18 +1718,21 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } } - if (strstart(uri, "tcp:", &p) || - strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL)) { - socket_start_outgoing_migration(s, p ? p : uri, &local_err); + if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &channel->u.socket; + if (saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_outgoing_migration(s, saddr, &local_err); + } else if (saddr->type == SOCKET_ADDRESS_TYPE_FD) { + fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); + } #ifdef CONFIG_RDMA } else if (strstart(uri, "rdma:", &p)) { rdma_start_outgoing_migration(s, p, &local_err); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); - } else if (strstart(uri, "fd:", &p)) { - fd_start_outgoing_migration(s, p, &local_err); } else { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); diff --git a/migration/socket.c b/migration/socket.c index 1b6f5baefb..98e3ea1514 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -28,6 +28,8 @@ #include "trace.h" #include "postcopy-ram.h" #include "options.h" +#include "qapi/clone-visitor.h" +#include "qapi/qapi-visit-sockets.h" struct SocketOutgoingArgs { SocketAddress *saddr; @@ -108,19 +110,19 @@ out: object_unref(OBJECT(sioc)); } -static void -socket_start_outgoing_migration_internal(MigrationState *s, - SocketAddress *saddr, - Error **errp) +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, + Error **errp) { QIOChannelSocket *sioc = qio_channel_socket_new(); struct SocketConnectData *data = g_new0(struct SocketConnectData, 1); + SocketAddress *addr = QAPI_CLONE(SocketAddress, saddr); data->s = s; /* in case previous migration leaked it */ qapi_free_SocketAddress(outgoing_args.saddr); - outgoing_args.saddr = saddr; + outgoing_args.saddr = addr; if (saddr->type == SOCKET_ADDRESS_TYPE_INET) { data->hostname = g_strdup(saddr->u.inet.host); @@ -135,18 +137,6 @@ socket_start_outgoing_migration_internal(MigrationState *s, NULL); } -void socket_start_outgoing_migration(MigrationState *s, - const char *str, - Error **errp) -{ - Error *err = NULL; - SocketAddress *saddr = socket_parse(str, &err); - if (!err) { - socket_start_outgoing_migration_internal(s, saddr, &err); - } - error_propagate(errp, err); -} - static void socket_accept_incoming_migration(QIONetListener *listener, QIOChannelSocket *cioc, gpointer opaque) @@ -172,9 +162,8 @@ socket_incoming_migration_end(void *opaque) object_unref(OBJECT(listener)); } -static void -socket_start_incoming_migration_internal(SocketAddress *saddr, - Error **errp) +void socket_start_incoming_migration(SocketAddress *saddr, + Error **errp) { QIONetListener *listener = qio_net_listener_new(); MigrationIncomingState *mis = migration_incoming_get_current(); @@ -213,13 +202,3 @@ socket_start_incoming_migration_internal(SocketAddress *saddr, } } -void socket_start_incoming_migration(const char *str, Error **errp) -{ - Error *err = NULL; - SocketAddress *saddr = socket_parse(str, &err); - if (!err) { - socket_start_incoming_migration_internal(saddr, &err); - } - qapi_free_SocketAddress(saddr); - error_propagate(errp, err); -} diff --git a/migration/socket.h b/migration/socket.h index dc54df4e6c..5e4c33b8ea 100644 --- a/migration/socket.h +++ b/migration/socket.h @@ -19,13 +19,14 @@ #include "io/channel.h" #include "io/task.h" +#include "qemu/sockets.h" void socket_send_channel_create(QIOTaskFunc f, void *data); QIOChannel *socket_send_channel_create_sync(Error **errp); int socket_send_channel_destroy(QIOChannel *send); -void socket_start_incoming_migration(const char *str, Error **errp); +void socket_start_incoming_migration(SocketAddress *saddr, Error **errp); -void socket_start_outgoing_migration(MigrationState *s, const char *str, - Error **errp); +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, Error **errp); #endif From patchwork Wed Jul 26 14:18:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328281 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 4F2DFC0015E for ; Wed, 26 Jul 2023 15:14:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfMK-0003bP-8D; Wed, 26 Jul 2023 10:19:24 -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 1qOfLp-0003Mc-R8 for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:54 -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 1qOfLn-00019e-7z for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:53 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36QDC32O032511; Wed, 26 Jul 2023 07:18:49 -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=NpW105tcAsd10rmuvnzjL2udmj40wK6pUp3VdTIXN X0=; b=MWmYBExKM6pnJTuBZ6iBCyrBE6IItVT6ijzVg0hxfH4F7uTEW5dtFYDEk 5vsw75AmqlZ5DGDPdZ53od9NdBJ2yuNf8ZwdsoV87rOmSl2ZZU763wvQe7fTR6Tl xY/rUVR94csSIAnwA+DOSV2XO2yvmHq2YUfpGaf5tiTyW0+HgtlhzqzRuRKTpuLV f11pxJntOv54ZQ802jwsWooqNrEP21vnfT7L/kGg3J0OhUdXoI1yTBDTASE4oVCj Q1fsAt1AyxQEGMisa/VbZmMxURSV/yjiZeThV5n7vY1Y7p5z86Y8GHlDZZidc/Xd Q+TyzHhVkrBmibxwn0XSHDlLj8jLA== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0b1707wq-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RNUCqweAEaavqV06GQV18cN/1kfNjHG3zOoF/KoijxRbZm3o9A0pvpMSCfrefab4+BVx3AL5QQIhi1wl4/8mmh4mB6u0d9492wA69OCrVVtLDxQYhkrT3c88xv1fEIFp1ITicdjpH1mrP0x+xnn+G2gdXnS4dZuafBFynZHuewzCr9Trl1f17mK/G/Ff7xabl6YQtNs0wVTYWaqY3LaOI8E4f9RThwGPgDUP7qNOhnYBeinen0lpoHRIA0suBfMu9x19F3WFoR4lVm9sCF/LnjKFAuv4OBJU0ljLHzLpEWFD0LDRSV/1MyBmZhVZOOpyFyl8xaC6GyiM5lZk2XQ36A== 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=NpW105tcAsd10rmuvnzjL2udmj40wK6pUp3VdTIXNX0=; b=SE7WW5zkuewAhI2EeMyvJr+SlSxl5IjREloBrrd18SHJmLt2stS4ZiiZn6ulQ1i3Pf5RjFpbrJVQio6DeTLgzR16WSxCjmXsJNvh9jVb7kN3YwN6pXms8kU4075caJlOi7//tx+/pE78cpFxP2tLGulyVNnpo95ICvSKpqKCbJZ+RYYrhw6k57tdC+PEcj/7Po1bSDAbX8uV7C8aYNXNIiDQxOnmwvUaHPTQrE3YX0z3aDdG47Uf9JRkgJjeaFL5N6whzAkGwYKj96JqEEZfzVqsLS7mN7yc5vZZv9AUBPgiuDS2vmKDNIfOH8wN4NH17oDDJoqt7vqb5qQXT8RBHw== 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=NpW105tcAsd10rmuvnzjL2udmj40wK6pUp3VdTIXNX0=; b=cXIxUC9uBozaNXHd6PK0cPapnMCqxHJUcMF/DJ6EOWWIVoo/hlY89LaCqYeWl0IMGHIlIaYgEXqncckEnBs1ySAOFVZn47X5RlNb8CSX4978uPnT8kG7hPE9/MaXVP+AaOzy9NynfSCMBVgYHViwiZxpJATnhpKdLY9hJuqkdjVB2Dmvxrtbwurq+R6RP/DUZVJC0quYE2LMuu7di8Oy6JHwi4efeQThVuKmeS4f0zfl2P9vQGSUJpQskrdtphYWXY21mJuT6FxRaAF+x920wCyakWsDJCPhH2HkDQ6yM18fIpJNXVnFdcwODv7zFiVvSS0BiUIgUpwxLD7tfGbJdQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:46 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:46 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 04/10] migration: convert rdma backend to accept MigrateAddress Date: Wed, 26 Jul 2023 14:18:27 +0000 Message-Id: <20230726141833.50252-5-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: f14cc720-492f-4946-8560-08db8de3397f 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: Ns1gewV9ZOPkKFyzMzqaf1QbX+engaqRZqpSjZYbXlqgVk0VjghRHAqI6y77rBbAuKWLT1RA25KEezM1Cq4tLElX0sKegFAW1tdRzdksr389CJ+uPrFary7OFQkSshPXgSRqhQBstIBpmnG4GzB6ltIuE9qOhG3Tdk+t9A84LhtpnkEhK1kzX1Tx+EmRKlwzZ62DSvUb6O5eh5yU/D/HKlTQFuZyIBeZDAaY+qVBJne91PTbSnSFgZxXtWQvEcL93Tyh8DGh2pN2B7U8XaLUxYTQOdJsRiT1kx17r/0dVK1x4jbGdxGmbOoWf49yfovMjujGoUgPMTIHu4TSwqLQ5gETF3f+NZSj9mbAD3S6XPZ6HerALa4FCSmM8WA+uqp2ZI3mw163ntZh4sGEDKFL545pfHcLyJnIrFGd6qba5NR4lpADNyjg7VTlvfXepP4QVnhNFimIapRcghZQygZoU+NndHCfCjZLizI68Dm3dtffEfYh0jIVVEEZpy0vEr6MryEHfX3xVk4CyH5B4cVYrCjdqgF/5SIUQq9178XwhzPlqR2GCVF50B+opBvL27os4q3eNiB+PCH57OTJiLIgFORWPs4c0vQNxhr5BYiXVAlGPWxvQO502kjEf2cDEMy/ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IUQsVC49vG9qrR0TvjdKbFo/Dhig?= =?utf-8?q?/77rebwmx1mYJyCoZhKc1m0O/gxq/9Bqch38enPhsTDDOT5k71cYGn3+FNL7o0JeJ?= =?utf-8?q?Ijim0qUPQMF8pkOb5n8Hu9jz4zh9upvk4JTJIyLxMMwLIVsP5cnSsMX6ewo91UY1w?= =?utf-8?q?r4ooVb98Xj7kJa94Woah0jPE2H89CGssTrgofBr/cvmdsqCZ2IrzcOD/KKp/wMv7o?= =?utf-8?q?65tes8hQ1+HhbdoJnULNIJ4vyBmUMB+LVJ5L/3Fv8d1pz6C3sQ9MO/lEnS3ReZKRq?= =?utf-8?q?wmoqfzvrimPNbx6uKgdaW5lXRHFbmjQAvi62qMfOLFgu/er0kOLkasYYyA8ZAGTfD?= =?utf-8?q?CP4G15DCAz2YdgWzNd3S4ZJNLCMoIGOWZW24CErT8aWmS2w96ogUxZKHr0+y0Im0n?= =?utf-8?q?ixtCZ5Bok8hWOPcZurFSJ6SLH/6c957swj2Fso0ip/GWb1hEJewG+jwLsigiYoG7/?= =?utf-8?q?7hB04jsTKvfMb1lz/A6ic2RGART3VDE+ncpxDCMr7/UkA40uLcK8Zzg9IpPOJFNdk?= =?utf-8?q?eaiNcvbO4egp37PB+F33zXsSB0olTjtxwdCxGOOggIMf0szMrCFtTQURTdLW+NWcr?= =?utf-8?q?lr6RMh87PsDkMe+mARDLxDS1FpmfslYhVIuc8tpZ2I29cQoNR+IRvO4UzwnmcXfmk?= =?utf-8?q?uSUZrU4yCRjl6mEdu78Ns+Bjo6mVXtlgu6PiQezqYAMKprQtQ18qQFsbVGwCammY6?= =?utf-8?q?PDVy0RRAXajusHLN2K5H0xGv/WH3lmhwdJdfMOC+v7URCgw/JFlRjPHn+vcAofnS4?= =?utf-8?q?0NXbNvWeDPVFQnHiG4mAdW1OJtgptDYkeJSBGhIFbubjNzecyD5x7Fj9ssIHdkUre?= =?utf-8?q?pLBzGuQ8U0aA58TtCZRHTFYdcelkETnj80O2xpMwV2n6R9seVBAxtF4Rjf4TyLKKL?= =?utf-8?q?DP9c0Sre/bgsBrA1PsH4+tuPxJiUmt0TbCBrOR6sMtaiBQRcMzyJtoGQUp0OhFklj?= =?utf-8?q?5eqk8yeA461hVxdPCBmPI4JGQQr19MadcSjV779ss90uw/IfoaZcz4jg1cXgyzLhk?= =?utf-8?q?xMwvJf3ADYSlpCKuLpf0pPzcCDP+OXCl3gpvGNWqYuggHTBXgxE/3vp369WqwtnXb?= =?utf-8?q?7iEMdcAo18S+XChc/gwcwA1SgNUzMPsc/Jf037ZMjB2kMwTw6l1GTwIfYWO+QW93b?= =?utf-8?q?4psij5hMXejwp0HbMZEKyV8np2yg6scDcx/AdM62uSFtTJMrmE/bIzIsJ4B6FwlAb?= =?utf-8?q?omfOWyGTPLUlZKtl+BwWI0pckUhxxjDGmb4BZhm0oCukhpLYOkPLgCk8BQmzkTK8v?= =?utf-8?q?BvoGXbfpNjSVL+DpaoYWii+/OWWeW12ATs4eMDXJNLlE3YHpgJ6bUvpeW11K1Tj0E?= =?utf-8?q?pQ6Sopp5lb3McvlawoeR/q1ppDQWLwlzmZ1Gdluo+jUis4MbA5uILTDTvvmdlNP+R?= =?utf-8?q?i2cfZPedGq45av4laT6XOEvtFo/V4Fi8aZ5Fv/AQVPgsbh6oSlyHMSXYVGXuyiK8F?= =?utf-8?q?QvpE9IgLYp98efSkPvwo7iHos+zT0DJAxQ/INmPzhHMDzxibRwBXEE1f8s0XEPZE5?= =?utf-8?q?3AgP5r8K/a8UDXquYj4lPFqX73tomDpbXQ=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: f14cc720-492f-4946-8560-08db8de3397f X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:46.7411 (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: KArcYKuv7xFIitI/oAzXpfhklwCYQGi9lwqWXc8v9hULWuMzyPw/NJLHXtMFwKcCIa/FnxuhdEK8ZtTMsOMULQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: ihUzrhOq0rKOIJ-a0ljT1eHlmAfVunyH X-Proofpoint-ORIG-GUID: ihUzrhOq0rKOIJ-a0ljT1eHlmAfVunyH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org RDMA based transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for RDMA connection into well defined InetSocketAddress struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 8 ++++---- migration/rdma.c | 34 ++++++++++++---------------------- migration/rdma.h | 6 ++++-- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index c4bcf8bbd7..8012f93f1b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -491,8 +491,8 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) fd_start_incoming_migration(saddr->u.fd.str, errp); } #ifdef CONFIG_RDMA - } else if (strstart(uri, "rdma:", &p)) { - rdma_start_incoming_migration(p, errp); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_incoming_migration(&channel->u.rdma, errp); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_incoming_migration(p, errp); @@ -1728,8 +1728,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); } #ifdef CONFIG_RDMA - } else if (strstart(uri, "rdma:", &p)) { - rdma_start_outgoing_migration(s, p, &local_err); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); diff --git a/migration/rdma.c b/migration/rdma.c index dd1c039e6c..4d64fae492 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -319,7 +319,6 @@ typedef struct RDMALocalBlocks { typedef struct RDMAContext { char *host; int port; - char *host_port; RDMAWorkRequestData wr_data[RDMA_WRID_MAX]; @@ -2455,9 +2454,7 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) rdma->channel = NULL; } g_free(rdma->host); - g_free(rdma->host_port); rdma->host = NULL; - rdma->host_port = NULL; } @@ -2739,28 +2736,17 @@ static void qemu_rdma_return_path_dest_init(RDMAContext *rdma_return_path, rdma_return_path->is_return_path = true; } -static void *qemu_rdma_data_init(const char *host_port, Error **errp) +static void *qemu_rdma_data_init(InetSocketAddress *saddr, Error **errp) { RDMAContext *rdma = NULL; - InetSocketAddress *addr; - if (host_port) { + if (saddr) { rdma = g_new0(RDMAContext, 1); rdma->current_index = -1; rdma->current_chunk = -1; - addr = g_new(InetSocketAddress, 1); - if (!inet_parse(addr, host_port, NULL)) { - rdma->port = atoi(addr->port); - rdma->host = g_strdup(addr->host); - rdma->host_port = g_strdup(host_port); - } else { - ERROR(errp, "bad RDMA migration address '%s'", host_port); - g_free(rdma); - rdma = NULL; - } - - qapi_free_InetSocketAddress(addr); + rdma->host = g_strdup(saddr->host); + rdma->port = atoi(saddr->port); } return rdma; @@ -3359,6 +3345,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) .private_data_len = sizeof(cap), }; RDMAContext *rdma_return_path = NULL; + g_autoptr(InetSocketAddress) isock = g_new0(InetSocketAddress, 1); struct rdma_cm_event *cm_event; struct ibv_context *verbs; int ret = -EINVAL; @@ -3374,13 +3361,16 @@ static int qemu_rdma_accept(RDMAContext *rdma) goto err_rdma_dest_wait; } + isock->host = rdma->host; + isock->port = g_strdup_printf("%d", rdma->port); + /* * initialize the RDMAContext for return path for postcopy after first * connection request reached. */ if ((migrate_postcopy() || migrate_return_path()) && !rdma->is_return_path) { - rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL); + rdma_return_path = qemu_rdma_data_init(isock, NULL); if (rdma_return_path == NULL) { rdma_ack_cm_event(cm_event); goto err_rdma_dest_wait; @@ -4113,7 +4103,8 @@ static void rdma_accept_incoming_migration(void *opaque) } } -void rdma_start_incoming_migration(const char *host_port, Error **errp) +void rdma_start_incoming_migration(InetSocketAddress *host_port, + Error **errp) { int ret; RDMAContext *rdma; @@ -4159,13 +4150,12 @@ err: error_propagate(errp, local_err); if (rdma) { g_free(rdma->host); - g_free(rdma->host_port); } g_free(rdma); } void rdma_start_outgoing_migration(void *opaque, - const char *host_port, Error **errp) + InetSocketAddress *host_port, Error **errp) { MigrationState *s = opaque; RDMAContext *rdma_return_path = NULL; diff --git a/migration/rdma.h b/migration/rdma.h index de2ba09dc5..ee89296555 100644 --- a/migration/rdma.h +++ b/migration/rdma.h @@ -14,12 +14,14 @@ * */ +#include "qemu/sockets.h" + #ifndef QEMU_MIGRATION_RDMA_H #define QEMU_MIGRATION_RDMA_H -void rdma_start_outgoing_migration(void *opaque, const char *host_port, +void rdma_start_outgoing_migration(void *opaque, InetSocketAddress *host_port, Error **errp); -void rdma_start_incoming_migration(const char *host_port, Error **errp); +void rdma_start_incoming_migration(InetSocketAddress *host_port, Error **errp); #endif From patchwork Wed Jul 26 14:18:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328181 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 E64DDC001B0 for ; Wed, 26 Jul 2023 14:38:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfML-0003cF-4l; Wed, 26 Jul 2023 10:19:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOfLr-0003Mi-7D for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:55 -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 1qOfLn-00019o-Lv for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:54 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36QDC32P032511; Wed, 26 Jul 2023 07:18:50 -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=OlID4Ibyj4SiVXonGdoH4oQKR+o6ogad0oe5tbof+ pQ=; b=l0bMUEOiQndYAfJ0xWxzHGA/JHrGCfl6Okp8GvrwYDptEgcpoxTc+Oy6f tkaV4G/vta5vqHBDayjmPYIV7/dAltPtva5XhTCxQi6T31oGu10MKvDBwfPBPLOO OJRpGIMIYiwdti6pVDlKrRIA3vzOdvykv3wrqOIxs94y6g2fohy0sdRpd2US+ueQ 4ONrH1Ql6fkopPthfwyrCMalcRMx4F2GWUYsweubXcSWuQY60rD6rqv7HaOIcTPa /c3YVNaAHcPqRijlgOD+ebbtlANYe6TJX7xMXMUg1w2Antirq4mQjQpioxoYHr4P dTS7VzvB7SqjEVWHqMc6blZtWEipA== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0b1707wq-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fcxCxW0NN/yvE3HvdU13vue0wb5BvRFy1ZxVJZHrJP2x70M3sXvBkfraAhZW3PDKiL84LMI5XlU61s3BCRHQnwGcYjNIm0hdRsQm4fNOCmcu32dKaXnh/pyFadLS8NKCAVy7EOY/A4VYfusvN/vfB60fwF6yhJEOLPUeEM+16Byt1V3mdt18Zu8MrQQS/caqEhYgo8BSrcsXyqzNY7E/0K5ZYoxvDjcSr73SXU8XpXibOfTwgdkIMy6QL+Np50dsgs1Wa6wlE81oNvtGzJf0xMXf0o77EEskmOkZVSRyli6UUSax+8wkY5cR70CqZX4anM//RhD8dVJKxSxmcJRLNg== 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=OlID4Ibyj4SiVXonGdoH4oQKR+o6ogad0oe5tbof+pQ=; b=Vk2DTh+HUFxRTsj6yWXqBoopJewT32qcxT245mK85Fwww4oOyfU2aXERcr/kLgIHPEthXYlWey19+dOsml7XQPdYx9j2LeJLlxEGBkE+BSySnrSa2w7j2b+2HAPNhTcMSFVgiDr6P+fXVMZQX327fLl93rROjtn9XpcoO1C8xtOSqvT7O1lB/KDKYip0OHYF1MkD3B8526MG0EukcSCd2/J5WwOEWsgKDhb0YOBg3arPrExOF5QnrbLbRykP6dGHuGtJuZmWxG+wJG+9yVHyR/oaFuRjyaK7SrE4UiTD8wXSPFMQ9fC1P1qaIVdBDZRL1rkU0obhtmkNVkb32E5QHQ== 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=OlID4Ibyj4SiVXonGdoH4oQKR+o6ogad0oe5tbof+pQ=; b=BCaAlrUEL6MZl2PaCFjgrZh/F9M3GYmBf7l2FYkSRfPwkzDZU+2L78EeLdfxSzJ19jU5LuQD2MYZNi+ztYHWv4rGDenhEqDMo/e87WGo4sPrEin9x9ivAebZIPgoTeke0VmmJRMJTTp/K1G5SduNhd0bF0h4/LNyl7HK+sBHizvY0KiMNqUul9KwV/D16BD7kcSVI+xI35wM1LXVVZT4Pw6948OfXQcP0lz6Szmm2lstlQcqfwbHcqiG+QephRIisNRWG3l/ONzba+CjiAbLv9GloHvZ5td7yoDEI/7pbQPHhxmffAAPXdiNLw1SgabNHjB9axZDvsoxH6GN1c8iKQ== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:48 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:48 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 05/10] migration: convert exec backend to accept MigrateAddress. Date: Wed, 26 Jul 2023 14:18:28 +0000 Message-Id: <20230726141833.50252-6-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: ce48b021-abb0-4fca-750a-08db8de33a77 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: +kEjv/qtEt8bxY1XTth9309NLpyUV+uWRZoP2dGb2z1mIm0kg4XDxyUadjKJrmxtThnoOXz24BnL2oJhmPA80svYDtarSmxtlJrP2vAmzfJjoBVQkryxGXGEJiE+4t0T89D5b2x4cDl5INNPA2SDZLHJbnBJOc7A/yHrzhV2iIOdR+McBDrj0vxSNNhGqwtuFiNNSiKHLDicIUE//0pZpc6IVTWJNYcqgnQFmkDto11w4Z9SH5Z4YisgR5sPi7V+P33AD66iQRquk//QskHPTIvdQtVesW2FmlxXAuXRHJRyIHGoC+SGYlNsr/AIRICOz6Q5jEEMlh7Uh0FEWrCDNU/ej4i4fXtiWKtJu0gXma8sj7ifSZZj8aabT27lqiS3JHqoLhsH09npmbpoWnsZU01WM8kqeQtBt/SadqFWsmn+nDwKgnwZEgMfjLWG/U5+hhucPI8bMHhOKYNlLzCig0LWTAHSe/P0SXbO2Bor2aDnLkTX36ALCgQ91x96B8qKs3Lt9M+h3UqL3Vib7Gq1kyNPwmpIquieYE1cZHUl7lQSI4r/nevrA4XhSIGkXHogj6InP45RZndYqTMRqBX2nsjEmxhI/lA12hpMzurrdvDgO1qHLpYpMmKZmNxQUBXcQ+Sr8iH2PGAhx9Jr5gvyfg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002)(218753002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?w0sWXiQ08JpNLBdcqddixyfmMX8T?= =?utf-8?q?w2nxfW4Vj83PSDu5ZO2/JfPnOR8F3h9IXdWI75eQQD3yOirA+pmud0lVFLtB7poWQ?= =?utf-8?q?F76+pOPV9x2helbMXV7jr8yY60B0mG0cPw/Sg8P4rE56KS5q5XeKgODUws8OtZdHT?= =?utf-8?q?UymtsYdzJQzk2GvcN44W3l4bfVyLiZetzAujWDhBsA9Ruh52NkiMpCfwMeeghFOrF?= =?utf-8?q?iCJng9YEQJDQLq3AXLXFpb5HfxR1lGeLPnqm8Mvo+EDau66GCGXUBd+sd3RPpJqSj?= =?utf-8?q?c4Ueu5gbrihhUvwuAsTEF1vjRq4pXB2m7t7m3NIu83p/ZTAwXVtaaFceFQp2hraUB?= =?utf-8?q?pEctJ1RncQT0CtGIeCWG7XZpZ0l6lKcsbWymaEFpv4dl97QFYAw1JGWG6prFOD4sD?= =?utf-8?q?7O67yynzn9HRKdEn2104WtwzlsZAoOoNijHgKFHumRn7un9P+pZC3ohrBZWxzFier?= =?utf-8?q?NwBycKSJGC4gQ3PVexlGHJzCojAnlwpX2BPzFaKxhuUY55IWNp9bynHUf1Dhrqv7o?= =?utf-8?q?+uFkpG0gWq5bTkYf+FPQqyCvmxzIQ1bjYvGsVA4dOzoI+PTMduN4h6srRGbf+6ssJ?= =?utf-8?q?jV+oXy/Fc0A+I4JKrnIU1XWd8ykyM8bBbYs1nOAQYU8xKAxH1nZ1Jyq4BbzefD1+V?= =?utf-8?q?6XZZKOk/Pv4yC5w/zXF44RWHuWpr7O0oBu5glHPcaWHb1v62V46IAhZeP3dmsWBSe?= =?utf-8?q?hzX8/EAsXW358VWadFXFoKPR5lEtkQhJp3xcu/5pcvFPKrku2tRsAEimAqIMrILpM?= =?utf-8?q?lilZGw4itI2gLL9i+J4iIqX6NH3NuHkGxR6Bc0jkGLHQ7lkuqxz2MmDczLD/BYBNx?= =?utf-8?q?NGSLb9MMVDHcgK3BUTAlr9gxYXt23y6MEea9Revq59yKdmQ29KpCdVsKpfMNgU6eR?= =?utf-8?q?mk24VYAnIuSgaVLsTGjxxsr/bx6eYebuqUD7QvIkEkHZZv8Y0Zj9svQh3FSD9+39n?= =?utf-8?q?VuYb04FBjA+uaEde6LNe25evgXnAydg/eKVcjEJhgi/SGx0QMcFEQVcV4FtaLaDUC?= =?utf-8?q?VEhAhYCYJNMtbOwJQHhdloYoqiF9iZT3iFZFAj9orlwbkUl4GASFc1rASm8NmUBxE?= =?utf-8?q?COM8nSnHe/tLObxwAJpYcT86Cn+HcT8PkFDXrD52069QDPq62qB27wf3WmvdQZLxX?= =?utf-8?q?Rny3kOsYlBe1zqivt9dBJ/ik4y06eUsRTvP7wn2K2KedQ5Lg+dbPOnJ/S2CUExskH?= =?utf-8?q?OxjV42EoOw8ERzD6E1LOFei0sHZ1cGGjjr7ckEphXjsdpjlr5gNIkRGAaeJ6eRF5d?= =?utf-8?q?/XFxa5zO7mErbgFzMOk0J0VUnQlAesue/g3BobQNkR2bfkgvWjcd9piaMWcZedwNw?= =?utf-8?q?eNpDhcb9RvEe8XxhKBq2bhloGU7dD6Td/NsX4jDatF9w4kC500CLXKrIo0EKRJbBj?= =?utf-8?q?BVgXzzqrMp6Cnng+tmnaAkPucvgBsl8bsaCxdqoGabzGtuTZPCz9+JcmafFe0SVgG?= =?utf-8?q?DsE/ARRMBxn0z3HlB6Q6JIZco0CWt2a8G67g2iWdnIeRWEjqEBDqeTI0uoaF0d9/6?= =?utf-8?q?P+kRmGbgkh+OMNdH4SRS9iQ7+LTfBXnAmw=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce48b021-abb0-4fca-750a-08db8de33a77 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:48.2830 (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: Ojhi8NZukL7ouJ2ShHUKHh2KWIAUueNvAeIVDMBt9JYCZX/jO/LuXhIJ6cZjErx6l7PDEr+itqNj6TQoow4z2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: kr06CB5Z1DoYuF1JtlXVVgv1pbkVNitT X-Proofpoint-ORIG-GUID: kr06CB5Z1DoYuF1JtlXVVgv1pbkVNitT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Exec transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for exec connection into strList struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/exec.c | 71 +++++++++++++++++++++++++++++++------------ migration/exec.h | 4 +-- migration/migration.c | 10 +++--- 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/migration/exec.c b/migration/exec.c index 32f5143dfd..8bc321c66b 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -39,20 +39,50 @@ const char *exec_get_cmd_path(void) } #endif -void exec_start_outgoing_migration(MigrationState *s, const char *command, Error **errp) +/* provides the length of strList */ +static int +str_list_length(strList *list) +{ + int len = 0; + strList *elem; + + for (elem = list; elem != NULL; elem = elem->next) { + len++; + } + + return len; +} + +static void +init_exec_array(strList *command, char **argv, Error **errp) +{ + int i = 0; + strList *lst; + + for (lst = command; lst; lst = lst->next) { + argv[i++] = lst->value; + } + + argv[i] = NULL; + return; +} + +void exec_start_outgoing_migration(MigrationState *s, strList *command, + Error **errp) { QIOChannel *ioc; -#ifdef WIN32 - const char *argv[] = { exec_get_cmd_path(), "/c", command, NULL }; -#else - const char *argv[] = { "/bin/sh", "-c", command, NULL }; -#endif + int length = str_list_length(command); + g_auto(GStrv) argv = (char **) g_new0(const char *, length); - trace_migration_exec_outgoing(command); - ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv, - O_RDWR, - errp)); + init_exec_array(command, argv, errp); + g_autofree char *new_command = g_strjoinv(" ", (char **)argv); + + trace_migration_exec_outgoing(new_command); + ioc = QIO_CHANNEL( + qio_channel_command_new_spawn((const char * const *) argv, + O_RDWR, + errp)); if (!ioc) { return; } @@ -71,20 +101,21 @@ static gboolean exec_accept_incoming_migration(QIOChannel *ioc, return G_SOURCE_REMOVE; } -void exec_start_incoming_migration(const char *command, Error **errp) +void exec_start_incoming_migration(strList *command, Error **errp) { QIOChannel *ioc; -#ifdef WIN32 - const char *argv[] = { exec_get_cmd_path(), "/c", command, NULL }; -#else - const char *argv[] = { "/bin/sh", "-c", command, NULL }; -#endif + int length = str_list_length(command); + g_auto(GStrv) argv = (char **) g_new0(const char *, length); + + init_exec_array(command, argv, errp); + g_autofree char *new_command = g_strjoinv(" ", (char **)argv); - trace_migration_exec_incoming(command); - ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv, - O_RDWR, - errp)); + trace_migration_exec_incoming(new_command); + ioc = QIO_CHANNEL( + qio_channel_command_new_spawn((const char * const *) argv, + O_RDWR, + errp)); if (!ioc) { return; } diff --git a/migration/exec.h b/migration/exec.h index 736cd71028..3107f205e3 100644 --- a/migration/exec.h +++ b/migration/exec.h @@ -23,8 +23,8 @@ #ifdef WIN32 const char *exec_get_cmd_path(void); #endif -void exec_start_incoming_migration(const char *host_port, Error **errp); +void exec_start_incoming_migration(strList *host_port, Error **errp); -void exec_start_outgoing_migration(MigrationState *s, const char *host_port, +void exec_start_outgoing_migration(MigrationState *s, strList *host_port, Error **errp); #endif diff --git a/migration/migration.c b/migration/migration.c index 8012f93f1b..f37b388876 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -468,7 +468,6 @@ static bool migrate_uri_parse(const char *uri, static void qemu_start_incoming_migration(const char *uri, Error **errp) { - const char *p = NULL; g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ @@ -494,8 +493,8 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { rdma_start_incoming_migration(&channel->u.rdma, errp); #endif - } else if (strstart(uri, "exec:", &p)) { - exec_start_incoming_migration(p, errp); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_incoming_migration(channel->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1693,7 +1692,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, bool resume_requested; Error *local_err = NULL; MigrationState *s = migrate_get_current(); - const char *p = NULL; g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); /* URI is not suitable for migration? */ @@ -1731,8 +1729,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); #endif - } else if (strstart(uri, "exec:", &p)) { - exec_start_outgoing_migration(s, p, &local_err); + } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); } else { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); From patchwork Wed Jul 26 14:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328205 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 83E50C41513 for ; Wed, 26 Jul 2023 14:52:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfMO-0003gv-0A; Wed, 26 Jul 2023 10:19: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 1qOfLt-0003Nd-01 for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:58 -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 1qOfLp-0001B8-N3 for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:56 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 36QDBY9C032359; Wed, 26 Jul 2023 07:18:52 -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=gAToj1I6DYbRU9J8UWsEOmQz4M7Y0ReHAhFH6/IM5 VE=; b=wedjJAlLHou4URBVdJA8eZRMO1vCOBjnXQRpx2DF+WdD8IWHYeKfQCkSg mqe77SyxZpn8sUU/Tt3+p05MxfzxVr9Rbnv3UXFbFWXSxbfQ1HIPfW1axQIM9nSW jypsBAeDYvVTMEY07y+s3pDcx/asAKBqhexXxtCBjsAkT6hhacOWQDehrZKhaKXl G8ZMK7KOOMo8E8QL6zTaaLQgAq99PVz2riFRkfJjE5+DExDB2I7XatNx2ENHb96C 4m/jO7LKZMbCxiK1Sz5QC2rjGTIYNs6FgeTURcrHJUciraKlkk8URvl2wuVrZ53i PJVnh94CVN87tZ5bfVXz2AHTrIGfg== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0b1707ww-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bip2THPtHNyc7iodLgexR8JHNBPO2MtOY4LI9TrrxmV6DBv8/s3FfmFd6TcRNf7ipISGKiiFcmwTNCnkepr5Zm/HSdP+myEiL9gj/gokWytGV5gDcN0mvvSecZ8GCdY4yk76MxvWQgqZTihaCxk1r1N2ft0351NHwhv+yV/yPpPLbqIXPCXF0dU3iGGfITGUhEgnAEEaH5NwFK/TF5Hh8t6othkETNPE/l2LYclXk/uLJpe5TEf08T0l+UzdwF8LxoO2Uz8jdPeXnQwc0SdqVTIzIOYPW8Aer35fy20/u8RLAtzLMZCDKWhqQ7JV+0aZTrarOLPocvkFR8q4zrI7Iw== 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=gAToj1I6DYbRU9J8UWsEOmQz4M7Y0ReHAhFH6/IM5VE=; b=eZ5rVFx2OkFgsZkHNnpN6sctzNIAYXv9s6PE+Sno8vxd+TG2Hk7pvqoTUAmsDxVctUkKGVVdkaUT4bSHM7BsOXDSAfcgBWUK35E0ZGK+AQhsr9IStejV9H30F/1FVaJ7bswsO8zSwnYOjgznLT+Wvmk23U5T/1srJkf6fMHF50Qa3u+KUBrmJW+BZQgeAGS8pMFc9efOCsY5lPOQ8+r4hI2s8JtTOusOJLBfirupVLKBHyrdjQ0BC/Sxjc8hzKWhvIOxG/TbEDI8piAI6EpIQQ+Yn/c8nuk1Ca3WC0Wh8Z1swz3nacNJ14Qp+8t4Boqqr52BYm8D3xz42lKkSC6N3Q== 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=gAToj1I6DYbRU9J8UWsEOmQz4M7Y0ReHAhFH6/IM5VE=; b=cej6klKw7c/mB9Hm2jH7zqWEopjNpXTBH8zLDaZIs0EyryHxrBkgw7f6OayIPxHeZYEynyt5FoHUVI6qh8GKunA/Wm63/UMZ5JFudr2mGXVRsszRYIexCU17Nhvw1sgCgi/X9ruDKjris5hwGAsUENBYcICaeexlZcUWRrahYy7AT6tOsrc2xx8mw6mpMVXicW/dU9pIHKmt9Chc18kuvzXMMqWLPiVk3NZvmZGOvbtcw4EMl8fS5JUfMU4JukZON72SbjSjNgKEwirpVj/yjC4TKgQriIvsjA69+o9j2KzjKdx+7CS3xT1tWBEtvwnOBvYWGdjInwvOtL1kDtIRvw== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:49 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:49 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 06/10] migration: New migrate and migrate-incoming argument 'channels' Date: Wed, 26 Jul 2023 14:18:29 +0000 Message-Id: <20230726141833.50252-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: e1250f69-e32f-4645-c909-08db8de33b52 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: OhjDa9KFlObr2MoCuMJ1fBtcMZvJNjzvedCv1Ys+/tj2A8eGiwhk1LgsvryJpDoKnf82awi1HdB3lckJMPr5IPoI+m1yS6YEB6UG9EdWHsZHpgN5/ilZMOG0/yNlzxTtMlO32Yxo0FiK9uqtHJ/ivXpdkIWC3czR/vz71xDOvxeX2bhHvb2LxQxbRiRAuiywsjtDNbeJi+BaArXvyAmAEGZ6rtnd6PCJgIh7yNt78dQuX1MfLG4xfDsQy7jVwI477YW/PJzP8r4eARHmA8i+HodhMRKkaSWy8CJEgQBM5ZhwKVelFUwtdY0QqobNM/CieEFt6q8OmTxP1JCmOHc2CLYTG3SwfH434Jhne6moUDKN+wRW0m5cXHXnJjWfF81VQKH2WkUw85G8f4SwCX0cNke6Ex9witmXCGz+MWceg3aU/gA4hj/ran1wFSWNjhRrMgA6jqJ/e+hxoNpj12Abraam6kee7B5fUvpa9jQiAF5YWWGvyapNHJs6BgZNeosVlCN1QZZcYTdtQFBmbua5aQTbnXr7FQNsH7+SCFpe7Cnh2+QFjEzvYiOYZcQBMzbc212W/eI/mgoexkFCksmqKglcMVXTH0g+aHEwN5+/6UGmdRNbsNQFhb/ISwWNBFf01xB/HSMWeGwL3gtP2FGRPA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HXsMr7JhVXf7JowIYs1Tv+ipKcaDmNGOzdJS0j9B+pl6ct70QEI7/1eaQ6IW619aMZN8x8W17u3Lk0v15B5BdwL+LpF3PahsLWrlxqmIy+HHPBQ/8eOtPOUHhPUJxmDl/MvXsnnX1jCUQ8M8CArKzgtnFDhgIlXFdoxbQPtOWj9KQI30RyAIQdmy7bym03Zj5lVROI4+f4fFUZJKjcOKfp6RXwUcRJbgJywKPPAp1sOxk+VkSIYQ11AMZCcMI+zjhYy64Z3hRvZF64/00ICKxuk5XeD++qqViE3E5m+kDi0GCx50T6iqLsD8QjLTzNn5xvZhClPwSfjD7cgBhj8RhNaztP5BX9tPauAvWQx1Lsyxx/ejI51uQktLGzB3Wd4YTHqCouarATDGBuEkv409x6kO2wQE70bFTh7MinDzb2enxTFpNOvtrjeaFxs2dtIPyyEJOAOPGZG1HcUnmp21I22JNysPjtfLNl0DzdmhZzCBb6B9e5Zjv2XNVT2f0jVPJNrOXsXNWVd/2OpmQ2QSHwuljJu2BJxXbfzN/5AQBWDhEBG82Dkz9Co40vbDysaZ8EY/dmWv/kR8+mQzWUze0do8sd9alDEK2247wFKBdx5oLT8rH/ixfmCkd8crI3ybj4bh7WMQO4YAU4M7iNLHTqjOjj0mY6BidBSF8YIPnGukp4PSOP9rGU7YdVoZNa9S/XBq7hIde9eNe8mZ6X9qoypWDiZp7bOOQGQ+DjDIlwRqMihYdOP+WORhoaCDDaxRzGz69Zuqathz7XvcP5arovR6nXmouS9+9bCHLXoiz5GwOIVbTpi2b5K7dg4uYBW4WO2RUqQDMMTyPOGgGVwPAU3/8FxWZ89Xi7BkEKAwWCZBXEDJXEie1BFc06t5T0fwiYILe8ETgqszDAyrlch5pzWnhZ46d0mg6GU0FVtHo29vsbTYkUGXbXvVndePefYfKugcBCz6E3IpD8GzdNxwG+9Y9kC+YMogkK4W3V+AdRDWVgE9PTfANg9xoqgc2A96biaupNG8f/4y9TWKS78GpJvFNyq0SJnVjYOfCCSDrjF+8DUVJuEH0dl29iQpje0k0faTppEe8qT51imT8pEZzeMcZNfdAtm4L55izllXSYH8g/wkFshyLJFauAB7MUs+7XMQFzRUq9nE6ZK5U+sJbFjvX+EEPEyCpGrcm9O9R0aeKDo9+kbejsgaHJC1yGHxwTSNPg581r8S4aEeAOkvQ7zgu3Hwg60VlMsKaAJ+uwhAtV6E3ofKn8hf2OuPwWLy932CIzKJDbcnspwZTbhD44mCzIwOC7fYRIihq2GTQp91JHq4CtYlqk/RqLeCkPwPqK8gzz+zi2ZKF/z8TVrHtVs9j6g89wsgokIQ+D16AyZ4tJnjflyyeTNin/D3WKQBxs1Hz1Kgt/gkHb8YO4AjqAILoM7i4z23y6j6MTWvyVTIL8lHk7Sbvt5BjtU4VP8xYup3m23BlJAb5iXHfWkZuR0xk7j8DxzgOUDwr27iCkXqXcrpbbXDLVz6MchKNxZrBi0vWIgctv2E76toQF17ZLZilmi/g8TNudaDOD+/P9GGAB2cERQuXaEtKtAim1cl0KE/PWe234G5xFFmfrTsLw== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1250f69-e32f-4645-c909-08db8de33b52 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:49.7343 (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: bjO1E+Ik1KPJXtrnk5+xy/+gd1ntkI5axFl6DFJtpRgQNkgbxJO2fiYF0BbFKzLvAo5KIWXKyzVhmE+06KeHTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: NLJ25Ps3j332pG_tE-wHXuFajwGgvTNk X-Proofpoint-ORIG-GUID: NLJ25Ps3j332pG_tE-wHXuFajwGgvTNk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org MigrateChannelList allows to connect accross multiple interfaces. Add MigrateChannelList struct as argument to migration QAPIs. We plan to include multiple channels in future, to connnect multiple interfaces. Hence, we choose 'MigrateChannelList' as the new argument over 'MigrateChannel' to make migration QAPIs future proof. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Acked-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé --- migration/migration-hmp-cmds.c | 6 +- migration/migration.c | 56 +++++++++++++++-- qapi/migration.json | 109 ++++++++++++++++++++++++++++++++- softmmu/vl.c | 2 +- 4 files changed, 161 insertions(+), 12 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 9885d7c9f7..49b150f33f 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -424,7 +424,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) Error *err = NULL; const char *uri = qdict_get_str(qdict, "uri"); - qmp_migrate_incoming(uri, &err); + qmp_migrate_incoming(uri, false, NULL, &err); hmp_handle_error(mon, err); } @@ -705,8 +705,8 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; - qmp_migrate(uri, !!blk, blk, !!inc, inc, - false, false, true, resume, &err); + qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index f37b388876..be8cdf0fa5 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -466,10 +466,33 @@ static bool migrate_uri_parse(const char *uri, return true; } -static void qemu_start_incoming_migration(const char *uri, Error **errp) +static void qemu_start_incoming_migration(const char *uri, bool has_channels, + MigrationChannelList *channels, + Error **errp) { g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + /* + * Having preliminary checks for uri and channel + */ + if (has_channels) { + error_setg(errp, "'channels' argument should not be set yet."); + return; + } + + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in " + "'migrate-incoming' qmp command "); + return; + } + + if (!uri && !has_channels) { + error_setg(errp, "neither 'uri' or 'channels' argument are " + "specified in 'migrate-incoming' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; @@ -1497,7 +1520,8 @@ void migrate_del_blocker(Error *reason) migration_blockers = g_slist_remove(migration_blockers, reason); } -void qmp_migrate_incoming(const char *uri, Error **errp) +void qmp_migrate_incoming(const char *uri, bool has_channels, + MigrationChannelList *channels, Error **errp) { Error *local_err = NULL; static bool once = true; @@ -1515,7 +1539,7 @@ void qmp_migrate_incoming(const char *uri, Error **errp) return; } - qemu_start_incoming_migration(uri, &local_err); + qemu_start_incoming_migration(uri, has_channels, channels, &local_err); if (local_err) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1551,7 +1575,7 @@ void qmp_migrate_recover(const char *uri, Error **errp) * only re-setup the migration stream and poke existing migration * to continue using that newly established channel. */ - qemu_start_incoming_migration(uri, errp); + qemu_start_incoming_migration(uri, false, NULL, errp); } void qmp_migrate_pause(Error **errp) @@ -1685,7 +1709,8 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, return true; } -void qmp_migrate(const char *uri, bool has_blk, bool blk, +void qmp_migrate(const char *uri, bool has_channels, + MigrationChannelList *channels, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, bool has_resume, bool resume, Error **errp) { @@ -1694,6 +1719,27 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, MigrationState *s = migrate_get_current(); g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + /* + * Having preliminary checks for uri and channel + */ + if (has_channels) { + error_setg(errp, "'channels' argument should not be set yet."); + return; + } + + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in " + "'migrate' qmp command "); + return; + } + + if (!uri && !has_channels) { + error_setg(errp, "neither 'uri' or 'channels' argument are " + "specified in 'migrate' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; diff --git a/qapi/migration.json b/qapi/migration.json index 6b97ce9633..a558a4d705 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1458,6 +1458,34 @@ 'exec': 'MigrationExecCommand', 'rdma': 'InetSocketAddress' } } +## +# @MigrationChannelType: +# +# The migration channel-type request options. +# +# @main: Main outbound migration channel. +# +# Since 8.1 +## +{ 'enum': 'MigrationChannelType', + 'data': [ 'main' ] } + +## +# @MigrationChannel: +# +# Migration stream channel parameters. +# +# @channel-type: Channel type for transfering packet information. +# +# @addr: Migration endpoint configuration on destination interface. +# +# Since 8.1 +## +{ 'struct': 'MigrationChannel', + 'data': { + 'channel-type': 'MigrationChannelType', + 'addr': 'MigrationAddress' } } + ## # @migrate: # @@ -1465,6 +1493,9 @@ # # @uri: the Uniform Resource Identifier of the destination VM # +# @channels: list of migration stream channels with each stream in the +# list connected to a destination interface endpoint. +# # @blk: do block migration (full disk copy) # # @inc: incremental disk copy migration @@ -1489,14 +1520,50 @@ # 3. The user Monitor's "detach" argument is invalid in QMP and should # not be used # +# 4. The uri argument should have the Uniform Resource Identifier of +# default destination VM. This connection will be bound to default +# network. +# +# 5. For now, number of migration streams is restricted to one, i.e +# number of items in 'channels' list is just 1. +# +# 6. The 'uri' and 'channels' arguments are mutually exclusive; +# exactly one of the two should be present. +# # Example: # # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } # <- { "return": {} } +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "socket", +# "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "rdma", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# ## { 'command': 'migrate', - 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', - '*detach': 'bool', '*resume': 'bool' } } + 'data': {'*uri': 'str', '*channels': [ 'MigrationChannel' ], + '*blk': 'bool', '*inc': 'bool', '*detach': 'bool', + '*resume': 'bool' } } ## # @migrate-incoming: @@ -1507,6 +1574,9 @@ # @uri: The Uniform Resource Identifier identifying the source or # address to listen on # +# @channels: list of migration stream channels with each stream in the +# list connected to a destination interface endpoint. +# # Returns: nothing on success # # Since: 2.3 @@ -1522,13 +1592,46 @@ # # 3. The uri format is the same as for -incoming # +# 5. For now, number of migration streams is restricted to one, i.e +# number of items in 'channels' list is just 1. +# +# 4. The 'uri' and 'channels' arguments are mutually exclusive; +# exactly one of the two should be present. +# # Example: # # -> { "execute": "migrate-incoming", # "arguments": { "uri": "tcp::4446" } } # <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "socket", +# "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "rdma", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } ## -{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } } +{ 'command': 'migrate-incoming', + 'data': {'*uri': 'str', + '*channels': [ 'MigrationChannel' ] } } ## # @xen-save-devices-state: diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..d811f3f878 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2651,7 +2651,7 @@ void qmp_x_exit_preconfig(Error **errp) if (incoming) { Error *local_err = NULL; if (strcmp(incoming, "defer") != 0) { - qmp_migrate_incoming(incoming, &local_err); + qmp_migrate_incoming(incoming, false, NULL, &local_err); if (local_err) { error_reportf_err(local_err, "-incoming %s: ", incoming); exit(1); From patchwork Wed Jul 26 14:18:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328192 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 BE49DC001B0 for ; Wed, 26 Jul 2023 14:46:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfMO-0003kX-Oy; Wed, 26 Jul 2023 10:19: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 1qOfLt-0003Nf-PD for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:58 -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 1qOfLs-0001Bz-25 for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:18:57 -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 36QDA2t7003674; Wed, 26 Jul 2023 07:18:54 -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=DroMgIIs1Plyl/97uQxKwblK2nl2ndcV7NeEK7PMd tI=; b=zrmgRHik6cpTOSbmxCGz5/rUFZQ3Fukt/3S3r9DCeqsPqv+fxEgLJvCmP 8627VR0Se9EQ+n/0NgmXlfaZ1Xv1lJEK71YQpnrg+sKZWQC5Cl+NzYL5TAHNNUEb dOYu6w5bBiCIR+J9VECUbNiQu1042Vbf8YWE6htIBv+FpnyZ43p8UehPrr4C33eY QoD6Czy/zaEyXMssGRsxnmjIV16b18m281hxL2bwlhjG03PrSJsGsp8pEyhcz9HN gUqu9qeh44SIXT51JFG8qEdJ8B1PUhpC0rIMz3Mb05ZKIBJmI+XyKQOYCb7ekGtT RkAujYWc0YS1RphMRz1+iX0qhKWVg== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2172.outbound.protection.outlook.com [104.47.59.172]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0e6dfyrb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AjrwmUZAE7A/jH6zaZpqlbpczzgZuJA4U5u2yHxvtuYFure+ANGnWDGPh9H87IWH/p+j5R+vcfPCAVVWD/al5lpf4f+L6rMB33ZD3YmnhYiqBcHeUjpPfGPHMMmm45ilRXCoys0MG3WLFs+9c4MVK82pF/EN6xXPTyUcPDknAYuaq39sqORzNSmdevzyZ/lHJ2L2bYbH0Rfs3DvCKBuf6rEENPKY+KXjJ5NnNCgaGCtQEUGpSt4jA0b8T1sca1Nr8O5i8j6pOCvEuD2Icg30yGcQeq8Hnv4lCF5oJPs5ABvpkH/i58PTT1E23mZclTNSbI5mQAgCJUWY7j9Tehhm3A== 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=DroMgIIs1Plyl/97uQxKwblK2nl2ndcV7NeEK7PMdtI=; b=K8AHufyvdS2tCzYf7JGznTO/B9Oqk1pX3RreGfOBi7y2jSUMNrYSdSURIoDNsEN5oVG4M6A2XTetJX0qmYVn1De4T2yWkdjF+YipC47/AEHE23Rz9bC/GsJLP4yK/c9Q0IFUPKrx3gJ/2aALNflW+5CrQ68/EPPWIJI/mxTI9xbxmo9gP2kbC81QUWkiOb4Sz5u8T1zyoQHOrxNyr0ajCAGc8Y3yT+8i228V/vWeBMb3u6JlLXTC4GAI9garj9Fy7ai/WDCXqGvJJaU+v7EI+0F7aX5KNu9EmmOlijMgmO0yE607qx0ZUhnlo3ctw70fPWxDtF9i/7iHOcooStAiuQ== 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=DroMgIIs1Plyl/97uQxKwblK2nl2ndcV7NeEK7PMdtI=; b=F21I+RZYGaW0G0vYgkwZvrYBXl52ybKChKGXSzb+51GP+FmuDjifS70v6CmMD0JpVeolOMwUSrBROxl8bajY5Gn2pW/u0MGlmmh05pTTeUzgOcCam9FP+i7khrr0+h8dYcCV4XFQocThF2rFqrBTASibOTYdv2v4D8ge4h0KgDlMgQvTMWtBchTpNr94f8Ne4zt0u9HziVItpYgGhf5VWOnKTcQh4dOT8vGxrlYrjs3zgNG6IrcHx3pAIVgU7mCK6BwpXLwjkh0KXqNNW1EKW1qYXB6AQbSbXF06e4mNbYWi0SjuAjkbknZ5QeoyESBX2TaEz1kix2FVlyXNxglF8Q== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:52 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:52 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 07/10] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Date: Wed, 26 Jul 2023 14:18:30 +0000 Message-Id: <20230726141833.50252-8-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 40ab9df7-f821-4456-3fdd-08db8de33c73 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: IGRo2w8aw6PuMwuhD/30ir638w/x5HxMrSSr+iUW5S1lWTlii/MRdo16HqEdcMbiQqNXwp1YwrPE08WtnUEIDy6W8Qsvw4QHLHRcIqXIN3K4xqwdwlb/xFQhkFgG+3/+AKEvlpKON5g6Ux6lPaAAmCeCcpWr+QM+gsOGeSqEsr/Q5bMY3PXoY/7fb0SooOikj1p3AeNDjvZDkL2exB03GyMQ/yTvguZRpBTDz1g4cLtLWl5uS0ZgsOADDSLIjo3qdrjEKR1zwmZh4g+YQxvsEdxVCOwh4hWCA7nA9uuB+9eSLjEHbHjUsUBW8Y1TT9kpY9629RDgH/lr/Rlo9ncniefXFouI8/mVQHi20Umah8nqwcRXUxYnHOiTYidUZNfxintia4gr3/8PcxPtC1QXPbSetrhLBR7xA5svUkUg7sVI+lGC9TaVWJd8Bd8eBLf8LmruXTXke+u8u6WGdi5SIfxddKaEEnwJo+/q2w+9iL+ofpApUg7LYMvvEjkQAXiCCNRbqbPc+BXA93RG6gaLG5M2e8oPtVQYwKz0RZR2Rfw1HZgc4MEAzwIhgpfLNKi60t5tJ2F697IiDzrXqeNxbZ1sEeSroYdl42EmljpjiVSYfwOKgzXJvdXFnA3K17ud X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?T8o7OIsPqDOpIlAR7YVy784Q0QrT?= =?utf-8?q?8YMuJpVZnIVN8RfNn3PSBLtX3lqE45NbQ71+II8a3qQNDPHJjPx8Rlb9VXgD5ZIiM?= =?utf-8?q?V+bOX/V347yB8gcq+LR3B6p2xPGPPL0QNNiVLwXroFK1Gq0VK4k57askFSAlMRQ4c?= =?utf-8?q?Vknb2rKC+OLNtg6ahsbM5Y4idnYpAFDMByR1rmJxeOyo23i/Vg6BshCORSDe160XK?= =?utf-8?q?QUOomP4FY/94T0GrhXjd94o3bPEjSlX+Ps1EFPgBsJ7Jd7Ns2czJeiv9FIWBq1lRJ?= =?utf-8?q?Ee2qqIZZQ/uoGw03i3B0q/pF9QacRMUqQa7GPd35ySfxCXbTqiy3P340lrXNBhg4f?= =?utf-8?q?fR8Jn1G4mCFxisVL4PIdd327+/xEo0PYHsR3sDMLruM0E5viISoiVKkI1p4BfOQRF?= =?utf-8?q?ziadu6J0BFDxrf8SyT8kEwdOf5EqUoHwT08ppDUh3UIN55fn8Cj0dRW5rWRt93uA9?= =?utf-8?q?wWkCrKipvzjTAYi8zzm5J1M/1FmNhIr1imyc1lEneswdNjsWsnwgs6qQDqssJm6Qw?= =?utf-8?q?dE+lMCv7SYO6zu8Lx5//lT74b0lejR/GSySJC2svIaqoWS2/eROceiRFcmv25WOAP?= =?utf-8?q?S6ZqWxoUGmlskob8y6ZenIBfnTmrNf7irhBsRdr7kt8YQ4f7N8eib4AgAGlrNAvU4?= =?utf-8?q?Yfc0xYzduf8cw/W94ff1dSdZ1+5aRh2y3EYD/aOusHVh/u1SduhKnxvzfAZ3WMCNB?= =?utf-8?q?WMJ82aqKhsqv8Z03jQVv05m+kVSTCdEslHsWW3F8q+hHFN1L5QQ+1Kyahs1y+MtTE?= =?utf-8?q?/FxVKDuDDmehgMJNgvAEqhaRb8SSubRxlIe1H8IvXaVGbiy4HD7hff07ErG5oSkvW?= =?utf-8?q?ykExASRiyl0KIkmetvpqIAoTe12ltqrdVkh2UjEOsuTqL9k4UGmpyteWWoAyH0qzW?= =?utf-8?q?+//q32r1qQxOOREgHkKzwILB9XtYlw+GuFCZyslnecOPIHjXJLtYxumrkQWPpGg7T?= =?utf-8?q?2RNPuZF1S0dqRc0jFqS9tbctJOh6Npaj0lWBSqy7jIlWKGS5VOMirezCNAFrnvN3+?= =?utf-8?q?vJjsY80wk6FaZBvia4MCzqZe1TyMiGYX90XD5RX1WAcSairQxDnxM5VYplMkKLEtt?= =?utf-8?q?oscPUzuMn+0fdoEwIfw67Qzc0JF1mrvKb70mZd2I7/nvUISLdCRAsFXewy1tTjxL9?= =?utf-8?q?dCWyvbxM/aAJ7bnINlDW3rbHalO47J5/UwP+oEf2jVXnjbAnpjNRBefmhjmz3SdID?= =?utf-8?q?bhEql2LE2Th6xibrnGbhr3bN4ptf5jao4aVCh/6mSpEd5/jOqspfQtNSsC4BKwXHI?= =?utf-8?q?FCC1iEFPWjUhpE0bWAqnPyWF+4vB/MydHawvGk+Rdwa/FZP1wkjeVRISNrySRo/eS?= =?utf-8?q?S87Hka6+P9Psy1xzXDdI0oc5o8VJ2CT94X+6gRyHwTN+iFkEgA0JI8MzTLQznNADE?= =?utf-8?q?ivlxlmBJ5N9kV4P5ZoSLa3T81MJZnnpNe7QyL4+KFKrR+POqwzaI6Smpiw/hTKJsp?= =?utf-8?q?SYOaC4PRa3OYvOwLsGgeJncPFD2nZfYUcjazE9P1d7GNrf41XeAoYw5Rq6PbdRf8d?= =?utf-8?q?dn6VdeJ2jXwuyNp0Hhf6Y+xrdoyZapX8bQ=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40ab9df7-f821-4456-3fdd-08db8de33c73 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:52.4319 (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: PQ7hh8p9asmQs5yrGlPPRpjBAh3Z0+1jPeJ3Lb4hRy8sE46RHX/ImCDmwBm7prMNmukYh8JOuByr0WuTXayWlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: DGLFepSkHKPhG7YcIbpuj3VPGRpkKQML X-Proofpoint-ORIG-GUID: DGLFepSkHKPhG7YcIbpuj3VPGRpkKQML X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org migration_channels_and_uri_compatible() check for transport mechanism suitable for multifd migration gets executed when the caller calls old uri syntax. It needs it to be run when using the modern MigrateChannel QAPI syntax too. After URI -> 'MigrateChannel' : migration_channels_and_uri_compatible() -> migration_channels_and_transport_compatible() passes object as argument and check for valid transport mechanism. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index be8cdf0fa5..5720c8ed4c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -104,17 +104,20 @@ static bool migration_needs_multiple_sockets(void) return migrate_multifd() || migrate_postcopy_preempt(); } -static bool uri_supports_multi_channels(const char *uri) +static bool transport_supports_multi_channels(SocketAddress *saddr) { - return strstart(uri, "tcp:", NULL) || strstart(uri, "unix:", NULL) || - strstart(uri, "vsock:", NULL); + return saddr->type == SOCKET_ADDRESS_TYPE_INET || + saddr->type == SOCKET_ADDRESS_TYPE_UNIX || + saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; } static bool -migration_channels_and_uri_compatible(const char *uri, Error **errp) +migration_channels_and_transport_compatible(MigrationAddress *addr, + Error **errp) { if (migration_needs_multiple_sockets() && - !uri_supports_multi_channels(uri)) { + (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) && + !transport_supports_multi_channels(&addr->u.socket)) { error_setg(errp, "Migration requires multi-channel URIs (e.g. tcp)"); return false; } @@ -493,12 +496,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; } @@ -1740,12 +1743,12 @@ void qmp_migrate(const char *uri, bool has_channels, return; } - /* URI is not suitable for migration? */ - if (!migration_channels_and_uri_compatible(uri, errp)) { + if (!migrate_uri_parse(uri, &channel, errp)) { return; } - if (!migrate_uri_parse(uri, &channel, errp)) { + /* transport mechanism not suitable for migration? */ + if (!migration_channels_and_transport_compatible(channel, errp)) { return; } From patchwork Wed Jul 26 14:18:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328213 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 14764C0015E for ; Wed, 26 Jul 2023 14:59:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfNC-00048A-NT; Wed, 26 Jul 2023 10:20:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOfM5-0003VY-2Z for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:19:18 -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 1qOfM2-0001DQ-5k for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:19:08 -0400 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36QBXhfN001667; Wed, 26 Jul 2023 07:19:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=XNzGBqA4MBlWjw8uZrEUnsjB0DC3N0RcobDGFvrH5 mk=; b=yi9LexROwDxFV6cHzaoGFsLq3mqJqp941NfXZyQ2UYlUA95XMg91jznWB rXHCUM78DAqcm13Ei9sDCewW2umJxP91reOaG/rUw2684L/0e5Fp+deeNuZD+uYs xkA+sK8z2NboTicnYvpWDc6BR+Exih2zqYwJjZ/r4qWcDbCvtaiQmPd77y8qYwkW O1GGm+rFKuTXqfOcGsjb8MkY6CkTvyJo4zZx3+u9XT7NI+PL+EOszcE678eQlPI/ PnTa7Uo9n+cMr3EzAPaMrbB0aXv0ppVjm7d7JY983pZDNe66EG2wqz7LWbncwdDv uhs85Ta55/rXRCC5RR0SKpGCO77JA== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0envfyep-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WysQ5GETmReGQjlDS/BVRMb7SPG3THQNKZihusFZ4OtrUY5TPUr+jCkuYiL0LDXd8P9lP4MzDlhh8m53W5cZ0ClerkchecJpuZSIsr1X1Z38ug5vzjQcJVCWtZ1k8p3PVlBinTf4BxJXeBcq7Wtcsxw3YOikn7G2zx9VMHstDC4Dxv3AgbnxfRS/lpq5B+D9TP33Q/U8Xz6Ywr3MOlZHwtpGK1XgBe6CIh0hcopVvbP8WSZ2AjuWM29PwDfTrU7UCZEM3yhdmr3cpuduK/TJntsg4U6/xJgDh3Th8cQvRsnFfUEJ3umUQx8VcDWG3hmB8jFKYRD627mUWfr2GwITLw== 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=XNzGBqA4MBlWjw8uZrEUnsjB0DC3N0RcobDGFvrH5mk=; b=eg92r8RGxzGjToLVgps/2fjpEP6TdEEiy2OoeDMU5qBmXKoap5AyQJ/MZ8Zj2gQEOZWMFlAW0wpF1Tk+B5TEKP2ExJKlPsE/URGBE+WfUfl9OMMxAHuLk/xy4BV7HBO00IqpyVvMonohHwvbPdEBiWUE45ZdrlId/3oqzGmRVzxbjMnC39V28cliMOgs2J8QMwxO+0KeujhKe76h3J7hlD9PhhGRJAiyUhHv1ZJjtyHdpELUzQdDiGBAGvZFIlfilDvl/pwpkCW9A4WQgKEKIkD7aTkkSNJohtzFwjbb1BhMb0t/bpEQBi3SAIdrMDqwb321jmSH+sjDhMhWNpByBg== 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=XNzGBqA4MBlWjw8uZrEUnsjB0DC3N0RcobDGFvrH5mk=; b=FiZKC6RjQpJpirR/AaI92M8Sj7yJbyTNHr1sZuTeZEnxeMxCJtj8U+Pyo52qht+SNgzaEaboK8QPctmY6HcYRIju+QezRImqIc1epqgLZ+cOyafSDmSITPdtaow4iyzlsuO6bX42tRmypUztOos8eNzUdLGCK6KiR6qUmP8wMnV/eg0rxhiaXfYX8GUkhOMU2u9+7P3NE1v8EBXW7VQV/kT0D1F7u4SXVjkR0BG6JNc8SNweREwl1by7ANdiAM2XbC7oaJRQ1byygKiaI0gcZaK8rNvQl61Jg/S57bHogHn5+wM3kO7G6Pl5y8QF6IEud1xveoZGCGdkf/WU+SEWEw== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:54 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:54 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 08/10] migration: Implement MigrateChannelList to qmp migration flow. Date: Wed, 26 Jul 2023 14:18:31 +0000 Message-Id: <20230726141833.50252-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e72812a-5b3d-4096-8596-08db8de33e27 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: y43uL7g95ueIFxrJYBcd2K64RlVQuVtjew/CgC+0/2UkUIpDGLm1nXaMpg/yo5UnANW7ynV4inrkRKHOhRT0qdddO7saYhAayadqM22ahkzwZ00vNNkbd2FmnDtxoVEsyE4Xj6fUsjlYYl0Qhpt+7QqVKPNOJjhmPOGaZ0XyyN2LE7idlxUtyMIt3QkWwvwR6AYZlWb1dMNbfepP7edyGIYg+ZSNfK8/VOMgrVw1yMks6iJcCuRUahsxK/lxM9QGPElcJFDjYSIJ2mI/LpwbX2gg+zlbdmBEoRSMElNBzafaGQt2Nl5Uh3F+Uzq9ix4mPwXYOM+zVtX6hvvlET/BT6gQZ1G7KWMVH5aeMd+ZRGc0l28SHBThNnp6gK/gEa1UgKMhmShniYGkVXffe0E4e+mmts/JxFNwNe4tBftx79Op/IhO2h9nV0N9BjhK2jYl7ICt2ouB8vHP5dGftsySyQTe3RhOjAcUT/7Vgp0RFu/GABW9dH6x8V0EgIzb58NOwOSvHSWksF+YpvDuCO9985tpOklXtuYoUT5mhROzR/jCONQbAb5fKSqQjLDjgPOMpybYG5wTK/kCffvCSqZsQkqYQMmVsSLlmZxQ+GehumUU5HRrB7V+yndULwrGwmMP X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8nioRwSzHZ9HQThLTkSTUQidKXcILXo77x3VsH0e9f3IlyHvGumZ4YABQF0dNR8DfrYUB5f0N8rxbrThAyqyP99gX0nepjtB6pt6KpGrXeZ625r6v37MRvqjpXqKvDO14O1M7/72GPpWpU5s8k3pmfm8SyD76rU7LdNCp+Dm7bjYUFl1Pn2LfyvzVtB8nglLHVZYpn8aOijq37JiQ+hpqtH/hktRbqSq80fXTteZOpw0R+mAWjA1zzXMHaPwWR6u97qH95/8QPA65Km3p/OSBKsWH+pEqStKpJQQ4fjkf1AJx4NPK8RYaZcYk0LxlG7GwTdPdM7ZCOoy5FEp4h11VDECDxlygwOoK20+GEp1gnEGKwP63RACzGfZ4XNa0C2tZ88QO4Foe+w/Wr+xzRdoLeBmyN0XULAUBE93OuhAv9nZNFMUO20Fd1gOKYUsCMPEBmiaNrFtrldlmhF9QaVwCrasqsbybzx7okI9tSZVcUMn1X3DaUbaOSqWDc6ES/P/qb8JGCCAjTu2om/1FgvUaSJWMbZvQkVisfjgRAcE8aRYP1/OO+sFZ+icnpQ/EADf0ZrKySaophPKntUGxrCy4J9AnEHIQsYJb+ob0D7UukjcAz3uiFT+Jbl1Ny0mbDQKYyAFz94dD0iaFEEp/xeG21zhjFUSY5FPBJY/PvCDJXR8iFLpzWIGIITq7LFt3rtvH+UoSlrsbZU5nNMRS2MJaTC8IFONWAD+cB2GOOtdKosSITRajdVbuCNi0XVitOdkd0dOuNaxBhuRdSitZT3xTcHiOZa1JQN+Wjjq6/9522IGEHB+O+lD0Dy7Qf0/GpZdpbgTHA2yExQAPEW/gocnFuVmg9CCIg6yezqiNFlQgLOarQTFrdzQvjeSGaoOsywfzuTQxJf3LPjZVDWfIozCPcXvHy85I8cHUk9SQPRPDJoZi7GUQVuz37EflCyRF/KgCfK72KvTQbDPABJSlp9sgoj5u909fEz2q3Dak4GSOiV+VibaQ7scaS3Lw07FMOgkC6MKoy3/Um0Nv3rve+LwDMLCs5WTU1odU8zBVbHPjPJO5/z1Qo62oB2Ha3Kjm2xqos6uQ7iBeBZQe9vy9VNgzMdnDv5TluRvcP8uddoTZOTuhUwLSA0LfQqImqo2dh8zjegFZ1u2sChq2CqP/90SOG1zx2XDe1mPvFqNulI22DkhGcXXNmseIDbG0zu1WM3X2jaGdsQbvB+h/p9HIEzzxXlwkMYtUxBFWy/ES3dl8munzU21q1RL6IWHJ2/Rj0LtUXr0PZmY5g1MdPSUgjImviSvkf9l+d23NddqhOH0Ri5q5NU3qUyFZ1LIFsENTn0Pdyp7M764GpIRRNzwt8HuevTIJOBcgRsrWAprEjfowN9BO/xSQwTy8vNfLkD8YdmTdlCFMfNdR+9GjhE2IGdkQpRo0teLQv/ywOScLDR/bxwpJxeBR+hxl4HpCgJgFnpA9mJ6Jg7DV6JOpQ+yTzIVS7Hk8Uu8lA0mBRbTmv9Yq+B8VwIJPufy11dc9q693KBMRFFrcWgqI+db4pddIL72MfIElhBD26Kf/wsu+eW6Ex1AZRgcbr42FOOQAVN4dvfkr41Cm+dO8h8SWaJdMXupbg== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e72812a-5b3d-4096-8596-08db8de33e27 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:54.4856 (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: DJRKnFV7OfnMZGPa+Fi0950pWnpQ0jCgI6Yinpg0b+o4KT/+YaMI8BzVo9+S4ZsTaYoj5PefeqSIa5B4O479Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: QLN4scOTokjqeeJcb8QvDOla7CsNncRU X-Proofpoint-ORIG-GUID: QLN4scOTokjqeeJcb8QvDOla7CsNncRU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for qmp migration. For current series, limit the size of MigrateChannelList to single element (single interface) as runtime check. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration.c | 95 +++++++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 43 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 5720c8ed4c..d54ecbb00d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -426,9 +426,10 @@ void migrate_add_address(SocketAddress *address) } static bool migrate_uri_parse(const char *uri, - MigrationAddress **channel, + MigrationChannel **channel, Error **errp) { + g_autoptr(MigrationChannel) val = g_new0(MigrationChannel, 1); g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); SocketAddress *saddr = &addr->u.socket; InetSocketAddress *isock = &addr->u.rdma; @@ -465,7 +466,9 @@ static bool migrate_uri_parse(const char *uri, return false; } - *channel = addr; + val->channel_type = MIGRATION_CHANNEL_TYPE_MAIN; + val->addr = addr; + *channel = val; return true; } @@ -473,41 +476,44 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, MigrationChannelList *channels, Error **errp) { - g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); /* * Having preliminary checks for uri and channel */ - if (has_channels) { - error_setg(errp, "'channels' argument should not be set yet."); - return; - } - if (uri && has_channels) { error_setg(errp, "'uri' and 'channels' arguments are mutually " "exclusive; exactly one of the two should be present in " "'migrate-incoming' qmp command "); return; - } - - if (!uri && !has_channels) { + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel = channels->value; + } else if (uri) { + /* caller uses the old URI syntax */ + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + } else { error_setg(errp, "neither 'uri' or 'channels' argument are " "specified in 'migrate-incoming' qmp command "); return; } - - if (uri && !migrate_uri_parse(uri, &channel, errp)) { - return; - } + addr = channel->addr; /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addr, errp)) { return; } qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (channel->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { - SocketAddress *saddr = &channel->u.socket; + if (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) { + SocketAddress *saddr = &addr->u.socket; if (saddr->type == SOCKET_ADDRESS_TYPE_INET || saddr->type == SOCKET_ADDRESS_TYPE_UNIX || saddr->type == SOCKET_ADDRESS_TYPE_VSOCK) { @@ -516,11 +522,11 @@ static void qemu_start_incoming_migration(const char *uri, bool has_channels, fd_start_incoming_migration(saddr->u.fd.str, errp); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_incoming_migration(&channel->u.rdma, errp); -#endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_incoming_migration(channel->u.exec.args, errp); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_incoming_migration(&addr->u.rdma, errp); + #endif + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_incoming_migration(addr->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1720,35 +1726,38 @@ void qmp_migrate(const char *uri, bool has_channels, bool resume_requested; Error *local_err = NULL; MigrationState *s = migrate_get_current(); - g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); + g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); /* * Having preliminary checks for uri and channel */ - if (has_channels) { - error_setg(errp, "'channels' argument should not be set yet."); - return; - } - if (uri && has_channels) { error_setg(errp, "'uri' and 'channels' arguments are mutually " "exclusive; exactly one of the two should be present in " "'migrate' qmp command "); return; - } - - if (!uri && !has_channels) { + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel = channels->value; + } else if (uri) { + /* caller uses the old URI syntax */ + if (!migrate_uri_parse(uri, &channel, errp)) { + return; + } + } else { error_setg(errp, "neither 'uri' or 'channels' argument are " "specified in 'migrate' qmp command "); return; } - - if (!migrate_uri_parse(uri, &channel, errp)) { - return; - } + addr = channel->addr; /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addr, errp)) { return; } @@ -1765,8 +1774,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) { @@ -1775,11 +1784,11 @@ void qmp_migrate(const char *uri, bool has_channels, fd_start_outgoing_migration(s, saddr->u.fd.str, &local_err); } #ifdef CONFIG_RDMA - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_RDMA) { - rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_RDMA) { + rdma_start_outgoing_migration(s, &addr->u.rdma, &local_err); #endif - } else if (channel->transport == MIGRATION_ADDRESS_TYPE_EXEC) { - exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); + } else if (addr->transport == MIGRATION_ADDRESS_TYPE_EXEC) { + exec_start_outgoing_migration(s, addr->u.exec.args, &local_err); } else { if (!resume_requested) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); From patchwork Wed Jul 26 14:18:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328191 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 57317C001B0 for ; Wed, 26 Jul 2023 14:43:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfMk-0003ue-84; Wed, 26 Jul 2023 10:19:50 -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 1qOfM8-0003Vi-8I for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:19:16 -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 1qOfM2-0001DT-Fz for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:19:09 -0400 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36QBXhfO001667; Wed, 26 Jul 2023 07:19:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=1RWg++S2pfo96T5lilV6dKQCZagQS5NWNDQurhkmL Bc=; b=gRdxrFrvjnwRvBqFvZWO4gVWN7FKkBYmnNxRUz6ki0MKDt2wTQ+ktbPSc nalT/ofdkwChaN5eCbXZSweThZLGj2ptyGAN/Jqsg14iU72EkJSYVylhQN366p2t zt8Gn2+85qp+XQcYqhJOFGei7BKyDzmnXk9KoB2/AisZa1sk4kxwndyAnPPi6PIq nEzl5urQA7JF3hQtEzZ7JQXvJSoepe3a6q588vqVeOva2u22feXQ8ZWw1nRlywD5 tQnBYDkIdOM8+krpIiwannNY9YSH9pT9VSUusT29BhH5p7P5O5fxekhCSp8jokC5 Hsxz7IaX02VZTXSvLp1XzT4FgKPeg== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0envfyep-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g9+bJayZx3+PkuOWPnP3qsp2ENKvRANFSuI39ww4gz9wR0htB+sjP9kuZwbPQPOgtysvDibA6BoaSpS+XqLZKV1PiGWZwYH+Id+4i6Cbg2JjjGPNHEMWNz43PKRbvir/hGNkwnptL1N2qURmMBmNd8bRRpXWaNRUjf5csWtGtwHVn43rylNyMpFmmvvfwPDTQYjMpm1TZWs15OvY9jVU6p1sJGg0SyE4OIiIaJRpNm+PHg0gVbdO9/Wjej9LiXtbqJTAYpPpzy+WiO7ffLX0JcZzUy2KSqZ2nf9d6aVMA1YagMXE4oTnVJaFdDKpsz/SLgPnsfbq0sE+s3W9jDANCw== 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=1RWg++S2pfo96T5lilV6dKQCZagQS5NWNDQurhkmLBc=; b=Ui/GXJewcjCGFKzSmJco/AsAZBUzkjpluQA5LvYLbCbXs1I6FVDCcJ2MW5Z9ATvgFnNtoyHloAYC3y/T1zWdAcBtJ99nT1vkbb64NEZTizMn/5wT6ZfH3Dvwkq4GIRRX3wvdEgBzCbozE1gewOCnqPjGIYwpGW29PGEn2PVvNu9KqZeF0vgNPFUEmgyNZ33kNEMldO9Kdg0eHChlLemtcLCwvYfs4Jt5eZuXlwFYT3o5Ai4oetVROQliqiRJ/0bEywsxobneaDO7jR80px2YZF16AaY1sDlu5gBZnPgPlPM1lEYRei0BgHHs/J0wMoch8mtuQOHBfU1HI2mo/34MaA== 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=1RWg++S2pfo96T5lilV6dKQCZagQS5NWNDQurhkmLBc=; b=e2XkNXHxKT3493gqBNXQrzUhparPQRhDe7e25O/GJReADpoWVRlq8z+/JCm+O7/uvMxtKyI6ngf5qHfGQGTZEFaHgWS2gqG8OxsrI9kKrWW2w8mDWu7DgwdH9hPihfHbLId6zsHNrbKE0cxXeYB9XMtXnI3fLopWTdz3bZT1rQXZm+AitX9MK8bti0SnINVY9tEWEjNc9rVr6Gm45GKKD1dzWrUefUIVQO6WSoOSDNW9hMf1aiGZSuYStV9/QEAkSyiAZcjqD7A6eDmaQ7K6K6h3bAkUxh+DzUGDhMjjSbYiVZlsklnQiJAugorFT8KzO/GfkPwiKEE28BvKE2TaFA== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:56 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:56 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 09/10] migration: Implement MigrateChannelList to hmp migration flow. Date: Wed, 26 Jul 2023 14:18:32 +0000 Message-Id: <20230726141833.50252-10-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 869ce140-305b-42a1-0080-08db8de33f0a 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: LedcK338KB+zKZr3phyddsb9WBq2go2Eg5vppj67WC8GOylebJDMOhdce1MtA8/5Crqoe55lS+6VqK17L2ET4oSSgx0n9+wQOPDdQUhuinpkYCw6lnmZl2WlvmXhdD/RsAWHK6pOqXlMKt3teAQneAwV4serURnpont0MKT80HUmrK/QEX+aILgF7P1ZFMjXEnTUp0gZ5nQBjtFSvjDrJ+MeY5Vurt1eLpBVV6lz4atGrE3yyAVbSmHMygg1RQKvsR1TNziK6r+Onr1LyfUmHuq5nMDm2v5dXy2ygXYfi6QL2o3bfES/NYZpoNbPj60Aqpla1Ws5MWjShhxgrT8KsUfQ7kcuQBQCUE7bD/mXqVOyTpPQeFfdZesMOzg3aNDY7pBH/Fk/K3vBVW0/PQ+nG7SPhVNlDrcyBLNg3HciAf81+kvoNE5bzATh+FI6JmUA5dAVsjDRMTyLHPAlrYeKdC1Qksh4HBWemylaei/W+itCFeynjS/QEHna1lDEvWf1ARcEYUzwC6JSooW2qagFMDzRBSt3qd1tFl/F81Ne5bZEtn/orb9r0rwOCf4ZVEZiPZIoXekwBQXEPRq6K8jcp+io0yUPCZwtIJ0aOek9YMWFEPG9xYMfhdwjN5Vrq0EX1WDsXLBb09S4lrdIeoUpLA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(66899021)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 75broSeaYtQ1ePlgMOFBNJ3xS47jMSVjmWGef/HubIvQgVT6tMflgTehfPTM/xK/N3rJYPYd38G50rnzYyOHsgErPvASvv78oJmUtbDdIV0usRqzA8xETvBhS4Z3ZDCjTUfZ5VhjTS0L1pxjUgSBy5znf76K8NA0Ez42Unc8djXB81by5Vlar2wKXY0LnuwcrQfpVSeXfSZp7mVIQmT29Lvmo56llv6Iw+IehRDZbVZreiQKfxtaR7BxB1sX8oNR7ne6rWQXzThPqchteCpJTCfocVvh0iGksdLcvXVmUonDs1t5LwjfXH1uf9aQJOCB0lBDxK0g1uui5s2/ZrAyvuOCn9tBPH8n1X8CWYey6OKqqZjr14C9w8cOEv/ZzTVraXQYOaWx4LkX0nvjjEoaveiq+VICZnmN48DfldlgVK9yBX2JjTBa52DZJohO3BZhIfY1mOXxyy9Ya93nj16ktaz9a2kyHKn0M3Qx6GF6W29GU73sVR5M/gOsRzWGzSzMzAqhyb46qwv+NVG4WTafd/kcX46zJ0snqohCeh6g+7x8G9T7eGxxU/EgOHQf50EFXaECCLBkGNoaqd58QvEfB1WrcEq13zkwEnPti/ka5vcWLC+wf1oTN2uP2flKRc/ADrai3W22oaJade1maSfUBXvi68ZksqWL56aTZem3rjxz+yGJBqXoqMl/+v1hwcWL+Cp/6vUY0EAGHrKTOIUeB5YRUjl7KLVe4vdH17SPnr3eLZY0tuIcfUg+dMz9rAsSBDJWu0AltZl+MznzBjBNsH6Nxwf6aKLrPvv1zPZwhs2iR8PkOS3sYTMJXiaXUIi58M9wokuJ1pl4xdUeqId5Hcv0OZfflvo3bfgRhRMPkFfgIxpZThRqf/COe3XxkA31IoxHXqsyTVsbCNVQk8wsWpedAfyncLpdMqajWhU+559dH1oFDm02ROFesJmMKyMhMpczQ8vpqBTrWO0hrdAGoTfi+8l15pwDhqc5chdNkLxznIY9QzQWHpxOYrLnei8gNs7FASTiNt6HfJlOhXC7FBi15cGSRZ7SQAy5nr7TaRtNizFCXAd5Pw06v+lsvWNTqOG0hqJHMi5fW/CSrlnKetQsXHM10V897YehlNmzliXUEVOlTSVIJITItfY42vhHZNkJUjT9rhtUlTFLwVIIw0mhgCAOJT1r5Lhr5FDSTSk/lebJk0/2zztDzPxN+xxTY4Zdk8gdHeE0uxx8lKNwbse1lN2e6bR2jaIzUg6q0fskK2UoVOFVYbixC7nP/zeWT+ByA5jT9NmJ0H3j6N3W9DPao8DTae0uFJt+k0Vb3MNNVVJEZ0UyL++EfURUWwZHfWdKjQWVzo6gzRvmnqDJ7UMcZ/0fphVdma+hcMD4fRYtuUactkjtBNtzBDZlOJLvrFEI2KHO5fTQV3yWopVzt7NZ1Y5oPtnZA/fKnRxwZ7lLgwpkc8jLW7ERLJYleRj2O225PfIT9Ftlbfpzdo/uTPMXRbcVVpuZOme3kPllq1lTTrcKITc510NDECEyHcvTVhdFkquH5mvXnX8hWudbmuSMHHEJaG3sd5RO8cQJcdUEpywXL2bnw5vmcYxHFl0Mu6IFZWS3MSEWHjmPunVRLQ== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 869ce140-305b-42a1-0080-08db8de33f0a X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:55.9739 (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: qzMZzTIW5KbxGniqLEjHEMIeoJhirZMsuvGk9rXW3PB1Rk8Dy2WiMm1iGtiBluCKFTJlVJKidOIkEGm5Dygdww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: hu2x96EUSAnBqrxJ7HMLddUCZTmwSQTY X-Proofpoint-ORIG-GUID: hu2x96EUSAnBqrxJ7HMLddUCZTmwSQTY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Integrate MigrateChannelList with all transport backends (socket, exec and rdma) for both src and dest migration endpoints for hmp migration. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- migration/migration-hmp-cmds.c | 15 +++++++++++++-- migration/migration.c | 5 ++--- migration/migration.h | 3 ++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 49b150f33f..42463ad31f 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -423,9 +423,14 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) { Error *err = NULL; const char *uri = qdict_get_str(qdict, "uri"); + MigrationChannelList *caps = NULL; + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); - qmp_migrate_incoming(uri, false, NULL, &err); + migrate_uri_parse(uri, &channel, &err); + QAPI_LIST_PREPEND(caps, channel); + qmp_migrate_incoming(NULL, true, caps, &err); + qapi_free_MigrationChannelList(caps); hmp_handle_error(mon, err); } @@ -704,9 +709,15 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) bool resume = qdict_get_try_bool(qdict, "resume", false); const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; + MigrationChannelList *caps = NULL; + g_autoptr(MigrationChannel) channel = g_new0(MigrationChannel, 1); - qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + migrate_uri_parse(uri, &channel, &err); + QAPI_LIST_PREPEND(caps, channel); + + qmp_migrate(NULL, true, caps, !!blk, blk, !!inc, inc, false, false, true, resume, &err); + qapi_free_MigrationChannelList(caps); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index d54ecbb00d..213832670f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -425,9 +425,8 @@ void migrate_add_address(SocketAddress *address) QAPI_CLONE(SocketAddress, address)); } -static bool migrate_uri_parse(const char *uri, - MigrationChannel **channel, - Error **errp) +bool migrate_uri_parse(const char *uri, MigrationChannel **channel, + Error **errp) { g_autoptr(MigrationChannel) val = g_new0(MigrationChannel, 1); g_autoptr(MigrationAddress) addr = g_new0(MigrationAddress, 1); diff --git a/migration/migration.h b/migration/migration.h index 6eea18db36..f833e02b6d 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -501,7 +501,8 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm, Error **errp); void migrate_add_address(SocketAddress *address); - +bool migrate_uri_parse(const char *uri, MigrationChannel **channel, + Error **errp); int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque); #define qemu_ram_foreach_block \ From patchwork Wed Jul 26 14:18:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13328297 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 83041C001B0 for ; Wed, 26 Jul 2023 15:34:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOfMl-0003v4-24; Wed, 26 Jul 2023 10:19:51 -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 1qOfM8-0003Vj-8x for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:19:17 -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 1qOfM2-0001Dm-GL for qemu-devel@nongnu.org; Wed, 26 Jul 2023 10:19:09 -0400 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36QBXhfP001667; Wed, 26 Jul 2023 07:19:04 -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=RdgxwxeGbHHnnEjYoUYHgW6WKRbn9x9SsTaVbo11m YE=; b=eO20EN1DdH3hZdKC5qGtyRjwTYevN1ovAHbmqUMWWTeNyAy5gzlcyMVsh BzhMohGGZFcHfji8dSdtJu7nCecLobqmNb8AJbKenR2Gjj76H1ZN+Na0YHRCvTop 0YZ6xDmgRD2vvctlUsUKjXgClORxUgAh9GTxyz8SnXxkaDTVDks0F7Aj3NJkvBbD T5akomD1DBYhs54reOH9u/oEnNXFWNcii3ZzBtlWAByznM4VmOJPwvjOnsmUt+Jk FoFUO7Z9moNF45Jy/NTgohoSfwIYbRbm78kvz8z62PjHa5Z6b7AK/e4wbK8pslKo R2wuGq4v9Wj2kZIYYc97ahMmEDIXQ== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3s0envfyep-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 26 Jul 2023 07:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KvuUZ9ROCT+mpieQG+4T/1CNuLcKP1X0lIL/oJoUY6D8V/fJ8iwGM79tp+xpDjpzme7CE3fhe0ATIf/K2OXFh+jBWpB8eUCCXVjNp386aYoXsBOyA4Lh7CjoM/xF2TmQ0lRAFhDUOH9I52ursSaoBD6z1AZOZh95rOs+uBsK9AD291PFv5W5YQA5U+aCgUzlhSaBmbc7AHAy2wo+3YJJjoMdZcQS55AaGX4/dMYxYmLlwi40W7xTqQdBdWXI4sUr1dEoZGV4edaLJbL1q+dnbCUg72fgnBw0nT+B3I5MnpmADeH6nqOxDXRWj9FlTO6Zn3JOfyEfazD6y9AjWSwS4Q== 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=RdgxwxeGbHHnnEjYoUYHgW6WKRbn9x9SsTaVbo11mYE=; b=ZcyDsEsqsIbfH9Te584VyQ1nFSNgPqac6+HseNQXO4PZBwGBkr93CimJz6yzWmjbm91/FLDHLX3iHKnwFznRBg1af3R3cGSRsb42Ox2d4thCWkT0fYqZxiTP5YnXcGnTAil4V02+ox5fAcaKhpAFahCVL+O12VdWH+Rxttzh11rbmpBSa7atxnevmUWFBjStUdloznO1ZTohCrcietD4b3YvDPiRBxXJxZCeyy26qSQ2FgFy3VDrE1T/1wUlQlx0SFBab0KuGxFxB+OYZ+8s4goDUROctrTTRl8n8HTU9Emk+Izms+rOXjZk8XSniLzjtqCnuL4Docsrl/asYa/huQ== 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=RdgxwxeGbHHnnEjYoUYHgW6WKRbn9x9SsTaVbo11mYE=; b=dWhRbLjzAzzCO0TO7CAZY9b6UrwfcPV9eEWF/dE1vP9+UqnHqI8VdM4WP96x56ocwp3D5zWfM/ibgJ91sEACypTc5ealVsb/5QG1Vu+9TejzdnLoIy3UDfOdvcev39/RoF/ArdSIMen00XClqLvg5sgLWZM/68CVx+aAHcgg3/Mqz5m3F6h63E8PfDcqG1QckLcQMytzRJsj+Ijv6DFfebySMgfeioJKxG1aN+VgEY3ScSyE6nDUQtLRc2Tlhi2fpStdvFTl24V6X9o95voVCl02RZP4g09RXXiumsNbnTlKAbcT56lMJVg3uBKiTlrZCfPWzB5Ba5PBceWkJeh4rw== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by MN2PR02MB6861.namprd02.prod.outlook.com (2603:10b6:208:15f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.24; Wed, 26 Jul 2023 14:18:57 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::2c:438b:2b97:26ad%3]) with mapi id 15.20.6631.026; Wed, 26 Jul 2023 14:18:57 +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, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v10 10/10] migration: modify test_multifd_tcp_none() to use new QAPI syntax. Date: Wed, 26 Jul 2023 14:18:33 +0000 Message-Id: <20230726141833.50252-11-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230726141833.50252-1-het.gala@nutanix.com> References: <20230726141833.50252-1-het.gala@nutanix.com> X-ClientProxiedBy: BYAPR07CA0096.namprd07.prod.outlook.com (2603:10b6:a03:12b::37) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|MN2PR02MB6861:EE_ X-MS-Office365-Filtering-Correlation-Id: 74920a2e-4258-41a6-7b71-08db8de33fec 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: HMSRqPJIh3tqzTsXxZquwuVqa/NbswpY4k/MApmXSDgE0Ru0i0vf3FSWTVFDweXIHf1ZdCcfr/QsUirv2m8RJCXyys2wWDzzvDQwcD27b5cNCbG2Kz8p1xvt3CNRppOgC6bh+w+rQ9WitE9Mjp/hM9jt2tr8uXHJq329egWGjYGuuIikDSGETr1bCxAdkwzsEzqmjptxJgQxNzra0RjZ3NPA3FWPlifoZsAb/G0NdNHFbnKNhKl7xFSfbbEk27MhfxzPJXuruv/uHkcfhVZjd4aBH7jrv5K3IQ5pB5RTfHtygLJPW39KgRvOdUDZlsTbUO0SFopD37qw3c+bBbOX4F329jPqU4u+qoCdsLSWafZ8dHwUQZeRlUp2JTUG4/ZJmM+FOc3wWNKgyJrb58JLKI84dRSvXqBlV0urk1giyltAHV8bCDJc46BqNI5cxlaT0xljqiXtDjGz74oEzCWUGpHqn+N5pYggCWC+lf9BJR5gC158Uf3vNkbOOjhvgr9Nk6f27EtGq8zGCEtUVSZjNkKaE/BsuEa1PPdmwJrhmS2CabTALZmm2bGloRxbyq2/g8EJDmqQfD2YP1zrv16NWchd4UqO8EqpvCbaqmi4NaJPZgOKTRzYUw8S5FunH/BK X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(346002)(39860400002)(366004)(136003)(451199021)(1076003)(26005)(38100700002)(86362001)(4744005)(38350700002)(6506007)(36756003)(186003)(2906002)(44832011)(8676002)(8936002)(5660300002)(2616005)(83380400001)(41300700001)(107886003)(6916009)(4326008)(316002)(66476007)(66946007)(66556008)(6486002)(6512007)(6666004)(478600001)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?t7HzPZ2L8WgnmDG2xEmmTtQbmqW6?= =?utf-8?q?EsTuKTsKpAvKBPcl8MHr1o7WFqZdH98QOgK02R++yF6A1yW80IxWRKEMSQ7Lq0MKv?= =?utf-8?q?xRlXB+vNuwARzlCft7bW2QosTKWgYYqsneJc57o2kODM2Dw2oSh1OSHR7GriwFCs8?= =?utf-8?q?vBWWru2fa6QUFL5+ZdJujrIg1WvpagXcxPKYHDfSlrigcFY1jnIsRsiATO0Rt+HQG?= =?utf-8?q?5URsWFXOIvoG+qL5YzblhZOLq9FADvev9opevWh0oGCl098sOg1sV8ZIpuneZzfX3?= =?utf-8?q?W3eugCMMhYSu9dAAY/r+r1WoSRiPzHpujiXnJmL4v3zy6IfOrGVBlnmAqgR6d2MvA?= =?utf-8?q?aFAN4+Mj+P6cH5JHvi60Ism668VGitOsyWsXAb5gqHr0kNBJe+pNTepBbaqjxcJDP?= =?utf-8?q?6Vb3xPKh1c6ePDdU+zGqUygpVW0Yf6Fse5ubZOReW8vxWRYjMOwvqZekiIrWwZfta?= =?utf-8?q?vaw5vqagv9XnGnsyi8Bnn6Hp3v4mhKWTLWatAkZyCIbazxpLDPo5JQ3uHmmb5X9lA?= =?utf-8?q?WvqNpvjwyCtS04qQfqhdIMt5YPxM3uWKXCzIfM/V5o/5rOBN12BbK1Iv6jXsBXt31?= =?utf-8?q?D2HmcxehNiA5nTdtFNOE8kzbcOGLmySbmGgbtgu1sb6j3KKvNpnTQE1rQ3jKyTsxs?= =?utf-8?q?Zx8eAkIeYnixUfi3yw2iQ2NmdzM5t/8SFOjPqr+t6UZChMirHCCgBRUZKZW/JvSe3?= =?utf-8?q?lZd5nFDK8/iVUscprz5a/wn4ofco+KVN/OjPA3vhX1qNy1Ip12gygPo/+F52+YmSw?= =?utf-8?q?I8DkZEADrpQa+F0X1QHCxJNNa8VNA6ffa9MbmYILx/oBdHr4skx2fN46I4l5nS9Fp?= =?utf-8?q?XfZ5NKp8HXD9arEA8gHAWT6HyozGfH1S3iV3S2/YISYZ98o/nx55DPhK9giE4S1l/?= =?utf-8?q?8iPWhIR85+H+iphQ+bQGT4EwoaPSjW6DTz847jU96SmuIHUiJsx7gI/STz40MBjrY?= =?utf-8?q?DCQHZZi+sPyFLLW/WgkP9JEku4GIJIGMx7ISPbwgLsU5n52OIyuDyzwju2JE3ldaT?= =?utf-8?q?wDNJac0WTpo5LFAlL7qynadOjBQJceXicrSNSmN65fcQIn6rwPjufL0uG1DRcD9w5?= =?utf-8?q?9hB1oFZLpfBjKvpgUUDM1SSkoWB97fd/ZuidMeESr5G7Fj3JR2uEOvtEFzdTv3p2a?= =?utf-8?q?hbtl8Qak8eF3PCYlRwtA6kIpgnZvPD6abufJis3oLCjQ1+LMMRV5RhSILpuxQmo2K?= =?utf-8?q?LNkdZ7Jbi/0upHUnipJ72pDXtXMa2tgUY7JN2MnMpv+tcNk5OYuHophQMjy5VQuPj?= =?utf-8?q?xaHSy7wogUBOXWrTE3JLrwkcBlEZ+eHxS1a4YyYHWycDgavy1Rc5X+qSNEGwiqViY?= =?utf-8?q?rlE3SWSwoobOnS0kt3qZNsohYUA4WBE9ro5HVk/exdBAFLAuiht9G88AVTiZJQIou?= =?utf-8?q?m+i84dIDV/SzTMX8fdMu7r5pLNs+Ms+4iV21iufuKppECAC2ItBd1k40pCQ4hnmWJ?= =?utf-8?q?nf7bDx/uI+loMYBos5ztQ4yTP6bDxQej48ezNjdAQCCaaXzbwKOZzvl28Qp5eOyQv?= =?utf-8?q?IxUCyYG2qV0wJGJP6hHk1PJGv71qUy36uQ=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74920a2e-4258-41a6-7b71-08db8de33fec X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2023 14:18:57.4513 (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: dMOzxEzHr0YKhSSq5xONh6SPZYSyyS5qmIWHGP+tH/j0o+skMawiPzyOGsEse2mIzprK4sJm2Px2YKm/bU3Pbg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6861 X-Proofpoint-GUID: kiTKG2aC5K7ooBym4mnJmNuEkXgRTVkB X-Proofpoint-ORIG-GUID: kiTKG2aC5K7ooBym4mnJmNuEkXgRTVkB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-26_06,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org modify multifd tcp common test to incorporate the new QAPI syntax defined. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Daniel P. Berrangé --- tests/qtest/migration-test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index e256da1216..376fad8311 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2185,7 +2185,12 @@ test_migrate_precopy_tcp_multifd_start_common(QTestState *from, /* Start incoming migration from the 1st socket */ qtest_qmp_assert_success(to, "{ 'execute': 'migrate-incoming'," - " 'arguments': { 'uri': 'tcp:127.0.0.1:0' }}"); + " 'arguments': { " + " 'channels': [ { 'channeltype': 'main'," + " 'addr': { 'transport': 'socket'," + " 'type': 'inet'," + " 'host': '127.0.0.1'," + " 'port': '0' } } ] } }"); return NULL; }