From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489715; cv=pass; d=zohomail.com; s=zohoarc; b=jEM7p4k+NnzhVo8qjIVSkezSL0ICpKwfVPWum5yldHgJBtTA+jrqmCRSSDQoHZIq3enDF13QLCT0GMGK5aV+gYVwGqbZ/gcSN8zd3jwdSD+eG1+r/x2jIFqDn0YMvRL2db5uMj/6xYFQFM4vmiHx+Pk646nsAW73MLkBoPYXLVc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489715; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PWv0dLSW9skaAjax9Lvcd+8+cGRLygn4rK/llLhQdJQ=; b=Y4rmqgFyGvLVnZQIh+amxKewIVJimRc5V4gtK9CGQk75JvisF4wrFwFlZ3gWKB8Afst0BpJSjJNhZdC9yBuXUsFnLBhxxA+voVDBltUbydWhOw7bdvWqFP44m3LTTkpUmGuF3jFkIC/mQEJkp4pTD/qAZPp0JrixkluCq1zQny4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168448971499796.58588146117177; Fri, 19 May 2023 02:48:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwh1-0000AN-NF; Fri, 19 May 2023 05:46:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgx-00009H-KB for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:32 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgu-0008RH-Sg for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:30 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J5ECPH005134; Fri, 19 May 2023 02:46:26 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw0vda29-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:26 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:24 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:24 +0000 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=PWv0dLSW9skaAjax9Lvcd+8+cGRLygn4rK/llLhQdJQ=; b=e3XoJU049PEQigJlbYfBBHzHaAxc5pizBaMUCHwHPMJdgx30xZbHWZYOmxg8ZY3Koznb xXv2e0+c0KqRlTj0rwzoKnXDotcE4YDDnOY/gRQn9eR/DDuCD2Xrc2RtOUThQvwN815F AcpYvS6AcM7VQA316c83uwsMFAbUwlZ6eHrfxr/7ZSBGiLsDoCrlfUF06gOpmRo4zXwD QcK2QG0H5gcpBRRLfMsJTsQUp3vGjhObvPUE9mhesTqWh7LffpbkXozL64d42L89TUl5 8nNhVzCeDZBFEEVcJNQsYGtY/CNeZYk/5JHPUSOOje9CYRzoo1ctmfML9EeVAiBvvwE3 WA== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZuJ4tiHAjAPSdy7MIOTm7fyexd9Y4dwf071ghQSlDp9Z+bavQ+U5Ufy/JibWqG0S+KaAboDcNrmBbFLCGDHXA1jE68MifHLqHz4UHTLdokB6IwVNPaaGQmQjCBZqmpAnUC02WUkyVtUDTvyK0raf/lv1pG5TES22TYGous6MWLe5dTIFRk0oNNlIzq0obhHfMz5JpXHz1JNWMy6SBJO8FcdgDGk3NUbSk/dAtOvQFy1z9gYbnoE+v9K7o182fagToPYCc5Mt5e8t97G+GhNxYHFWE5SzzllwHWsxrqBa2P69tfiFKa4qc01okP8XOJysLJJS0uGBjVMtEh79m/6r4w== 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=PWv0dLSW9skaAjax9Lvcd+8+cGRLygn4rK/llLhQdJQ=; b=Y7xg3ew4hBrOb6I0b0EET6pavhHrsjSpLbFP5x/Jxlpbv+JYeMit5RnkxxqQ9S9+xmqlEKCeXwHTFLp/Y+b7CUjfOBuFYGgpJFG1xJ+5xSwhI+enu6lk+8Op2ZXbDyQEICIHW5psmQoiA9DlbIZoY7V0amwfeBdV7Cy6vee52TrQcvDQBGpZMPDggexUwtfeJuPwow0aa08Mh5PKl+rZkttwRwchEDfS7pec5hpx2QO3sBBQdWkaZuKcrSn1+wl8alHQM2Shw7W+c5STVkKupuuqes4TMWQ3VO+Se3UKZJzZ529gJP0bzHqGHXYJdrGBt+n5k8+Tv84FGnX0AiqAjw== 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=PWv0dLSW9skaAjax9Lvcd+8+cGRLygn4rK/llLhQdJQ=; b=RQhOxibmIPJnXjlaWYNuw0mPXTrjlgRn9Yhf/qCGFlO+FYpAx/wxiOu/FeGthJsMaCo+j+EsGkz4f62lwPxcAT2U3LiwZZ6YtNGS4mwwufVO7CA3mZzkAFz/lbXYaK4zoz4lW9Tec0LAxmcXUH7+YUrTyFLnrKM480izKrqsnBzc4WiX2K33GF2HyRGIsX5NOdgMX9hRsolm4+dgPafJSNzMVdqOEbUj/m2lcFoa8T7EO0GCDdwU3+c6YZ3SYNU6LVh7rnBFTi/WeCCNCN39/PpKuE2gqmuVuosyB8fDPqEobWCQgdkhk4XEEFAri4ZbQiCO/59lBuL1iDao9zdOYw== 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 v5 1/9] migration: introduced 'MigrateAddress' in QAPI for migration wire protocol. Date: Fri, 19 May 2023 09:46:09 +0000 Message-Id: <20230519094617.7078-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: 8350c28a-3208-4189-7a15-08db584de895 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: x363LYGamy/23Pib6JotCCGvEKECBgOB4Ah8HPLx7Fuw1F5CIpDgVXjDWE6xAqIwfAmTCJ5COODhb/d5An+kZ7WyUpYvC/7Jx8f9dpmaPpoV2fgU5iJITv7+ebLbNfHDcNvK6wPag3k8DETCQCiMfe58rWysJeTdLN5lDi1KSUx5kGKai8VQDEWdwZMKxJ+ha1szy6CgMEJmXsPP+veAIVbSCl1+MPbGbKqSj5tcLtWyyB6z32M68u2LK6QPAwcsVL2XFBfSct4ps0h703xp+7jmaKR+WGMWvDgXNEbkBPvH9NpbAdERW//x452hzlVSYO6+CYaREeCZNmrIi0LO6JwvlqjY+auyH8RMdvEezJZgCj41dDhK2Q7M/DKMjIJFxrRhbFzSOkyUkDkxZfXD9QC1RBCZ5Zefw0dn3mwTSI1BVCyzZRIVksMZ4PN1n/YAqIpFkP/3lLVuMvvzkmi0KHp0tTyGG7tGnbeWZpQRgaFz66sG7LEEb1m8+TIMI0oYzXHDOxHPFOGexGwJQ4X3M4eW4MUdq/Iqgh8IART3JQISWNQYeajS40BGXo++rbc7P1D/qk3+RjPcOYlAiy9fk6m+QfR0w9P3gLQ+69u6waqyrQjHZbS/Agcn7KRkaGEQ 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(66899021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a2lCZ3ZleStkUHAvY043eVFMOVllUERwdEV2OFB2d0pIa2xxK01Ibm4xL3dU?= =?utf-8?B?TFU0TU5uNkNRTzZKd2ZabFJmRjZ2dkNjcmRDU21lWmkxMDgxSGJLK2pla0hD?= =?utf-8?B?UGUwMEpKY0g0Z3FlaUREUmlIMGpBSHVvbVdUaE5hTll3czZNUHpqRlZVNzY2?= =?utf-8?B?dEhHU2JlSTA2MVd6WmZZblp6SlhwbHN6UTFzcXJsLzU3SHpBdGh6ZTMrNnlC?= =?utf-8?B?cVRKRjM5Z1FFN2NORGlQeWhBVzZmdlJDckZXdEFYcnI1ajFVUlV1Q1lFZDBI?= =?utf-8?B?UHZ3R1VkSzE3cWhReEU4bGJCNUtQY0FISlpXN1hHSmhUU1FocUUyMnQ5RnNP?= =?utf-8?B?L1k2SGc5K2krSXN0WjRUQVpESHZsQ0E1YThCam9NU2dyS05lRDl0MzZjWWtI?= =?utf-8?B?MDNNbmdkT0Rkc1padUVOTzdidTIxeFBKUm0zQ0w3WStCa1BUYytEVXJSMmo5?= =?utf-8?B?TC9SNmJqQmhKR3JUQjZpejN6ZzRwR3d0WmZkaGUxOW53Vk93L3lPRXh4ejA4?= =?utf-8?B?R25JVU9pVTZIbGw3SWlJOFpXcUl3M3Z5RDZ5aHBRMXlQVTNTT0dTeW55WEw4?= =?utf-8?B?WUw4VVlMTGVVNDVEUlpqbzIxRncyTm9oSm1aRVExdHhnN3gxSm1zdTZvblNQ?= =?utf-8?B?dGRZS1c4cDE2amRLSHpGYkhCbTJyRDF3SHJnN3V3K20vVEliU0hoNmk2TThG?= =?utf-8?B?UlJ5cFB0cUJhWGhqb1pYcDBGZXdOMk5BT0Rqc2loTENNVmJkQlF3V2tQK1k3?= =?utf-8?B?RVl4ejVVQ0pGM0ZTd3MvVXBGd2JiaHdaK2ROMXZXSzE2WWEzZ1dOeERSUWdp?= =?utf-8?B?Tmlka01NZUZmT2hEb2JjWjlzeUhnbXhYV1NBbFdvdWJjMlRTK2pxMDEwdEc0?= =?utf-8?B?TkxBVTVjQ050UEJBN1RjOHBqL1gxcGV3d054eEFneG9Ed2JIS2ZEay8xVEI2?= =?utf-8?B?ZUg0TVdPSk5KZmdUamliS2hMdThDQW5DSWxuc3dzdW9LU1NYK0x4SndzWHBR?= =?utf-8?B?YzkvWnVIeXZ5N3RlOVlmZ2J5ODdHdEJnVHpmeU9KNUtYemtzcnJvanMxZFV1?= =?utf-8?B?WWpRaE9wVnROREh1RGgvSkZBOUpieTd1dlAxWHhZYkFsbVpYSHlhZHFLOFo5?= =?utf-8?B?Ym1SRGxMUExReGd3NFBydEtWakFWaE44RzJTNHZES2NyVDlJY0xYOG5SbW9z?= =?utf-8?B?MmxRcFY5cytHWU5YVTNDU1laYlB2ZHNnOHpqQk52VjVzWlZwSzBvaG5kTi9y?= =?utf-8?B?aXBTdTRvMy9WcE93MUVYb2VHQ2tMZytuODUxWHF1S3lUamxReHVEUElGMUF0?= =?utf-8?B?WTVvQ1hRalBOTWNCWVRnYXpLNFNnbzlDSVozYXorODR4K3BHRUE4M0V1TDlm?= =?utf-8?B?OXpvTjE3Q0EvOEN6TTJHeWxGa05vNTBWSG9CODFrUm1YK0l1bHQ5d2dqSG9m?= =?utf-8?B?YjdKTGFITm13dFcrODlKdXVrenNMS09YN1NQeXYrY2crVDNLdjBEMk1jRzk5?= =?utf-8?B?akpUTWZMQmZvVVhRTkxzQnlCWkdCWG0wbVN4RzlrTDdYcHh6Q29nNUN3bC9k?= =?utf-8?B?aU1NL2k1Z1BqT3Y5aDh2eStZbDZncFhmN3EwV0dBbFdidDErdTNHODJqVkg5?= =?utf-8?B?emp2b3dDZzkwOU41QXJoak1Rb0VnckVuVjFlbHY4TDNvMEpXdlVBdTRoRnpz?= =?utf-8?B?M3VMdmhtOXgzZEtZdTFoR01RdmF6a3N6Q3NlUTg0VmRHYTVBYXNFYkhNTW5l?= =?utf-8?B?YmhObFNnRVY1anZqNnJTSW5Ra3RQa0JNdzZqdmlMemtnNlp5T0YrRWdaQlZj?= =?utf-8?B?USt2NGsrVkNnOU1yUDlZdFZIaVg1NDRGY0tNTFN2QWlqbzRpSGN0WHh4alNZ?= =?utf-8?B?Rk51WENFNHVHMTV2YjhZczh4MlRXMG1qc2xZSGVJdXg0bUtNc0ZaQ2hUUkNQ?= =?utf-8?B?ZzZmcmFUVksxLzBxcituNnpaWUo2RlpsbW5PS0g4UGQ4WHY3RjlBUk5wdU56?= =?utf-8?B?amRrZHB6K1pscUpBRG85Ym9GeWZ0c2tsNnk0TkpjQ2I2UzlyZ2Z1WFZFZUhq?= =?utf-8?B?dCs0TGszN1EwTGx6SzR3clRvVjQxTE1OYUNJQkQyaFFLSXhZM25JQWNTbE0w?= =?utf-8?Q?zzHs42+23k+qu23BNFPhIwyB1?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8350c28a-3208-4189-7a15-08db584de895 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:24.3380 (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: xUVKbLjIHYTmTK8kZ7CraSdecbRVhUkBZYHErSHL2pnDinpk6VDlWvYrNTfwUW37AN/DxdmnhTofrQcHc97EgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-ORIG-GUID: t1xgrJC0m_lF783KDlYVBdNEitTnT_9o X-Proofpoint-GUID: t1xgrJC0m_lF783KDlYVBdNEitTnT_9o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_05,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489716789100004 This patch introduces well defined MigrateAddress struct and its related ch= ild objects. The existing argument of 'migrate' and 'migrate-incoming' QAPI - 'uri' is of string type. The current migration flow follows double encoding scheme for fetching migration parameters such as '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. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Reviewed-by: Juan Quintela Reviewed-by: Daniel P. Berrang=C3=A9 --- qapi/migration.json | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/qapi/migration.json b/qapi/migration.json index 179af0c4d8..c500744bb7 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1407,6 +1407,47 @@ ## { 'command': 'migrate-continue', 'data': {'state': 'MigrationStatus'} } =20 +## +# @MigrateTransport: +# +# The supported communication transport mechanisms for migration +# +# @socket: Supported communication type between two devices for migration. +# Socket is able to cover all of 'tcp', 'unix', 'vsock' and +# 'fd' already +# +# @exec: Supported communication type to redirect migration stream into fi= le. +# +# @rdma: Supported communication type to redirect rdma type migration stre= am. +# +# Since 8.1 +## +{ 'enum': 'MigrateTransport', + 'data': ['socket', 'exec', 'rdma'] } + +## +# @MigrateExecCommand: + # + # Since 8.1 + ## +{ 'struct': 'MigrateExecCommand', + 'data': {'args': [ 'str' ] } } + +## +# @MigrateAddress: +# +# The options available for communication transport mechanisms for migrati= on +# +# Since 8.1 +## +{ 'union': 'MigrateAddress', + 'base': { 'transport' : 'MigrateTransport'}, + 'discriminator': 'transport', + 'data': { + 'socket': 'SocketAddress', + 'exec': 'MigrateExecCommand', + 'rdma': 'InetSocketAddress' } } + ## # @migrate: # --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489718; cv=pass; d=zohomail.com; s=zohoarc; b=P/9+IFi8x7LHyqyreAEHlwY+FleCP7svjcoCwJiHJZVoHAeNIFagR4AhNqqWBk2F1fEoEpjIxxqpS3qkZHPUnmlWOyOKIcvdVWsCVgGiHa+kM/sCGpqIdcaRFjNCU/R4lG3KYrq8zJFmw8eoSlo7Bm8E+9IPdX06OrqlP+6Zx/U= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489718; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8kLFhBy8xrHkyhdB/+w2R7EJX1c38C6ixHyMREzOmLY=; b=oIUX6Q+bBn5IUS64iVwyBnlq+PlWm0mPOvMUWKOoeAPdEeLWDJEMSGrDpbXYSM75UdW5ZwtYgNKoHGaJm+479KJ7Pm1WA+D1PUuu/B5HjKY7bs6nqBqS5ZDuvKAKQHiF2Et0v5i2oYNmQ7RPDzDodNTe/OkjE2yXuyl49CaahTs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489718920562.5167722929137; Fri, 19 May 2023 02:48:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwh4-0000Bi-03; Fri, 19 May 2023 05:46: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 1pzwgy-00009W-IW for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:34 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgv-0008RX-8r for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:32 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J5Jq33003348; Fri, 19 May 2023 02:46:28 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw0vda2f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:28 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:26 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:26 +0000 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=8kLFhBy8xrHkyhdB/+w2R7EJX1c38C6ixHyMREzOmLY=; b=D5bT/3/Y9vUwsqYfokkrXziozt1l7ZzCc4dZPBwwOGo1be9Tv+5b4kqQAROfz6CK5Oi/ NdFr/WiEkd8CjgLKIq1soyrCzQFXhBCpouuGZpXcyntc2+1RPDpc1IZ8TxeqoFHcD210 kVvCLWbhCCxbTHFbh2twZoDAhpvrBF64y9vW5vs5GxyfPaFg3lYjOmw2R4NO/B1ynu4z h8FaFLA0dKc/BPCCAii3BgP3Van+DMV9+HLf9iwtRnFQ+Oi06DXoZ8I8zRtfNCIt3+vD rfx9PSHf4GXQR8TpOulL5M8WvJP33j/F1MWBlCOqu5q9l+NPaIVP1k81VvsRR3FdTDGh ng== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dyMxkReaA/8Qzec4iv972HZPx9A6vEra9p024J2FTYrCkR/Ki0Z/aqDMn4ZqmSM/z9VPJNqOUuOM2cq7D4Yg4p69JJfvbrhU4jxZa+CTS8dasDETcPYmdSXgNm6Yi3OEKzLiTnBfwfFASzDC3t3yUf046/1JqKbrro7eKcOgP6+IBIGTF7NdDumbiypieMwnmg9FKZV+96XDp5tpcFK2EbySXR+w8vg1ND4+9cx8EbnfKuDz5qSB5bRcXrwlsKsiMvKxjo8pGhiRJk3RSApqvUaHC6kbDMfMQ1o9Gm5nvaN4Cql5P2o8w0ixlVDIUHRndkbtb+jpQ2mhXBlLaJ9g4Q== 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=8kLFhBy8xrHkyhdB/+w2R7EJX1c38C6ixHyMREzOmLY=; b=KpVbmYmTJq2lFS7s1eZkXUHqlC3dyTcKsrR8ghb49fcybWE0N6FNrUs40KoUecl5Oi01m61LT3YVC3yjUwP2oTp9SXdEStGjQ6Ct+pGbmTd/ZDo7m3xb/7s7XvR92X57IzWFq5YmRzFcdS0uo4lSvtlWvN7Dr9WjSttDiGeZ8/1x7bvm9lvOeLazWKmELYvTgjuM6rmThHVajhqlrabrc/9GdwMlSGbtqLzqEbDS0MwHrEi0+yHd6Ze9FMvIyWbkj5i+rRirb1n8GfTdIwdbiucScj+1tuB+GiMOAxe+EbMj98nYMKmbj86L3/2KFBv9JKnNHJxL3idKW/wrR1fW1g== 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=8kLFhBy8xrHkyhdB/+w2R7EJX1c38C6ixHyMREzOmLY=; b=onrkTXW1JBZS2YTT2mfOZCRhEwG1XRteiN4/Sl7ZbmOpkoKsS7qFydiArytcULWNau2tIU7RXmbd+7XJnAmWdrYyoqAiYRT2h7kbZOtFm2Yb/7SyaMqp0TVlqlvdUUhyTYBB5+zMTXWfEx0XTWjP/xOwzBaHzNaSMWuYEUTnL4Sc8AjiN1DzD9eJPXFELq97GJh78+2k4YI3sNFN657EIe6LQ5IBQZ8aaj2hF/CoqQNMEQuRz5Yb2O9De5nDgtB3SVtbN4ftZp4nPW8h7qZ4wJJI/Q1k/e3k+CKvs5QUmv8Jd1f8gab6QyifttXXVE6DpA17lYlvJepKLcI3vNI2jQ== 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 v5 2/9] migration: convert uri parameter into 'MigrateAddress' struct Date: Fri, 19 May 2023 09:46:10 +0000 Message-Id: <20230519094617.7078-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: b7b33fde-9f61-451b-69bb-08db584de98d 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: eMUp2sCNHmtJ7OZzvUcsn7YoTJrOXK/7lZ02hG+qXRGVF6HLFAEqGU9fHS2RT/zcUOKxG/WAU7hy+8jYgkbsnnOOUTz+iBRuYm2V8KFY1/czLvc+GJcGP/OEW/StuBL2qV21Zwu4UVO9Y58JfIWP6kPagXlU62kGZb6jUr6UrVjAwrO+B5aE1iubD+hUA+TI5SWZ2K347WhlRCswX4A2e/hmOEhFNSBG2WGhQKiU4mY59Z4nPsHVO3+fT3IymEyGyIQlu+ygooxzXGmwKXv0ZVHTBnEpXon13mtbr0y+czcFP0GEF6T59aPHFr1VVFDMU4msQFmNbZaFHDmdnsdh2+ne89H+WdyrCHNoiFG8ura5zlOzLI3FBBVqOMBB31ELZ4wapDVz6vgtsU6hhv7yedbdWatjgjARRP4UsPTN+EO3RtLHd5q3Ev4ScwH1J6ezlGqmbQH/a/Q5XNEc/06m/doIaMpltHvEZw2O+cJVl5rg41kl/nRuwzEm3kmFOKyF5F/uE7mXKtOpF7hTB3SDcliBj4Z3uQyIt3HKaBIsiZjCZcormbqYWvilLb+hbkOXFK4WsWmFdjDYDHchAsIR7XM41i8RXoZfMYEdfp/s3xjsaG5sEg25QCm6W5lrDuQI 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?zZXntn0Zc0bg7BWhcfozDGIYFswiJXF6lPY+d/948bwiej/WwhTIADRtDaii?= =?us-ascii?Q?yAP+f2arv26ED4BsnLJ9EINUq+NaUuUfI2MQyJYuLh916AUENMi2EDaU22cj?= =?us-ascii?Q?I2x+zix1Ru3kjE0IcQFzZBx5FiOtJnuYZ8avUVJIYSAmLF4EbL+fUZjGF8a2?= =?us-ascii?Q?65eNBvlpN1U8Q42xusVLOzTn2uNMts1zRHhhtWwNYk4RofTjNFPKMCvX3hEI?= =?us-ascii?Q?rG174C37cAwDshgzbXZQohei+Q0c3i5qgKuQE3Tu07AF/pbOkDKgYT+DGJrZ?= =?us-ascii?Q?q8CTu8Te8p+fAmjkAoHXi9gq/EW09elr6jWsqJ3GSc2AtKXnqGNXUWSrht3V?= =?us-ascii?Q?+Syck8qnYE6vmmm8+UK3vMOT1asiXZh4rNZg4h5FDglKfBQJ9Y8FDD3Ild87?= =?us-ascii?Q?puIiwzVwmcC5ys7NM7g+Y797KnJGY75Pjf3uaHmYk6tvK/vrbj5WL2srAWuB?= =?us-ascii?Q?B1KWjlIXeMu9mDf6G/aCie13APafqZglCbE61mfAfT52sZ1hUja1+0cgO7Vi?= =?us-ascii?Q?S/Hpc20DH2JEB99N9HmE39iZBYQ1KDRqe/h0EyhbrfjV6UrIV/gJ16MhbvNE?= =?us-ascii?Q?aKd9q0/Yr3OAyxx+OqAU2TXtrMYZT9H+J+yBnUw31qMafRJ+ckfQWkG0ccGa?= =?us-ascii?Q?hwi0VlD/74ExD0vBSJClSEo7zDJ55q8EwcR1oUTspFYJR6ew5JqLlqNgE4JJ?= =?us-ascii?Q?/l+r2FM8DuilbqiLNkcBzoezVUNdnEc+5YLDvPS2btMc+OqYjrJDxRsTz4vo?= =?us-ascii?Q?/WQdri4InQXyBdGzXOmYZBIOZPxZDEOqQpKWbESBd+biMiHp2b91I93kvldO?= =?us-ascii?Q?5TzF5BrPlO+pO0JwJpsCcztuQ8qvmYQwpJhvwaLGXeIajMqxfeejO4V4epSC?= =?us-ascii?Q?0eQkb4gX/Q4e80rk5OAL9C9gHeZ1Fj2GcPQYJ3T6aNt5TFb89zkAxaEqqcff?= =?us-ascii?Q?hKmtfYZP95DybqPDEH3A+9ciX1f7q0PCyoekDhMfJQWTmmXK3Zii4BO8cKrP?= =?us-ascii?Q?2GRn8vp0OWch6dA/wIV4FhLfcwkRqjtzOqLNs2A6GZJW9sDW89kL+gSyGGrV?= =?us-ascii?Q?vfT1enQVSssy6d4N/78sTD6LT+YWE8DUZj32q50o9u3wS/NYCFKedN1pqQU5?= =?us-ascii?Q?0JhWDC3lkeZ8RYG4wKTJ8sSj5V4QWv2VlN+hbm+E5IV0GjlhHycNNDozzgIz?= =?us-ascii?Q?F+tPE7kvlWk9NvbzZhxXkj1PY8IVqjUqziy22mq0T0NT6lE9AnI+IY9Se/Kq?= =?us-ascii?Q?/1l/hUIdLMq8sBD4Zx6VPhbDliigL5Bes+dzgNLxvcdGb/vBO7LeLAZEiOi8?= =?us-ascii?Q?UKA1GT1+PumkfSmOo3z5QWGiflMQUl8HUxswdG5vlJXSdh906FuTqM1+5TOg?= =?us-ascii?Q?dQyUbTBQu71deugwFWhYZJxfUQ76DHsJG6TBTzUdTcoQkUsbtDWhYiIyTYtC?= =?us-ascii?Q?Qn0PxHYlHcTT79Q7ag15DJBRKVqvYGV89iPHt2hmkws7yOj2+UjFybjeByke?= =?us-ascii?Q?ur972Av+OYjy69QOSbh9jlWqc8daOV6F7qWh2ZfLsPBhizH75dzSreiBTD6s?= =?us-ascii?Q?7r0DMqt0Hk9X6zuCAWeLbGBOCQWlrFfIWS2flAeE?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7b33fde-9f61-451b-69bb-08db584de98d X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:25.9043 (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: itCdgdON5r+IeWE5G6YawYX64qYza6Bwo8waydA8xeelkiMzkpdEWnAjHSTtSl3ncvG2iOQ8TJ04JBg/bYVK7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-ORIG-GUID: G16XQVepJp8cSAWQ628JGutAI_s555an X-Proofpoint-GUID: G16XQVepJp8cSAWQ628JGutAI_s555an X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_05,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489719422100001 Content-Type: text/plain; charset="utf-8" This patch parses 'migrate' and 'migrate-incoming' QAPI's 'uri' parameter with all the migration connection related information and stores them inside well defined 'MigrateAddress' struct. Misc: limit line width in exec.c to 80 characters recommended by Qemu. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/exec.c | 4 ++-- migration/exec.h | 4 ++++ migration/migration.c | 53 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/migration/exec.c b/migration/exec.c index 2bf882bbe1..c4a3293246 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -27,7 +27,6 @@ #include "qemu/cutils.h" =20 #ifdef WIN32 -const char *exec_get_cmd_path(void); const char *exec_get_cmd_path(void) { g_autofree char *detected_path =3D g_new(char, MAX_PATH); @@ -40,7 +39,8 @@ const char *exec_get_cmd_path(void) } #endif =20 -void exec_start_outgoing_migration(MigrationState *s, const char *command,= Error **errp) +void exec_start_outgoing_migration(MigrationState *s, const char *command, + Error **errp) { QIOChannel *ioc; =20 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 @@ =20 #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); =20 void exec_start_outgoing_migration(MigrationState *s, const char *host_por= t, diff --git a/migration/migration.c b/migration/migration.c index 5de7f734b9..4c9ecd521b 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" =20 static NotifierList migration_state_notifiers =3D NOTIFIER_LIST_INITIALIZER(migration_state_notifiers); @@ -420,15 +421,62 @@ void migrate_add_address(SocketAddress *address) QAPI_CLONE(SocketAddress, address)); } =20 +static bool migrate_uri_parse(const char *uri, MigrateAddress **channel, + Error **errp) +{ + g_autoptr(MigrateAddress) addrs =3D g_new0(MigrateAddress, 1); + SocketAddress *saddr =3D &addrs->u.socket; + InetSocketAddress *isock =3D &addrs->u.rdma; + strList **tail =3D &addrs->u.exec.args; + + if (strstart(uri, "exec:", NULL)) { + addrs->transport =3D MIGRATE_TRANSPORT_EXEC; +#ifdef WIN32 + QAPI_LIST_APPEND(tail, g_strdup(exec_get_cmd_path())); +#else + QAPI_LIST_APPEND(tail, g_strdup("/bin/sh")); +#endif + QAPI_LIST_APPEND(tail, g_strdup("-c")); + 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; + } + addrs->transport =3D MIGRATE_TRANSPORT_RDMA; + } else if (strstart(uri, "tcp:", NULL) || + strstart(uri, "unix:", NULL) || + strstart(uri, "vsock:", NULL) || + strstart(uri, "fd:", NULL)) { + addrs->transport =3D MIGRATE_TRANSPORT_SOCKET; + saddr =3D socket_parse(uri, errp); + if (!saddr) { + qapi_free_SocketAddress(saddr); + return false; + } + } else { + error_setg(errp, "unknown migration protocol: %s", uri); + return false; + } + + *channel =3D addrs; + return true; +} + static void qemu_start_incoming_migration(const char *uri, Error **errp) { const char *p =3D NULL; + g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); =20 /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; } =20 + 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) || @@ -1632,12 +1680,17 @@ void qmp_migrate(const char *uri, bool has_blk, boo= l blk, Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); const char *p =3D NULL; + g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); =20 /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; } =20 + if (!migrate_uri_parse(uri, &channel, &local_err)) { + return; + } + if (!migrate_prepare(s, has_blk && blk, has_inc && inc, has_resume && resume, errp)) { /* Error detected, put into errp */ --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489630; cv=pass; d=zohomail.com; s=zohoarc; b=JxrCtOrQydfT+53dvtRResbWkYWAvBv4SNjxj8oW1JoYQ3C008j43+f+aOJv3kEUj2gk5zgKlo+ORGV+kIn+07e1Z3LLmMRXvJ4iKT2nDoMsu0jpF7rDvxFGyw1+WQcevVgESdF3pGQfpr7EyTSSW57o77OuOerxiK3hjE8YftY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489630; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RZJ/ECXJccVQZPzOfM3CWxAHJVk11v6IfR/PzTdt964=; b=GDpUdXtAGujHayLbHQExSDVv+eFmGT0BkmMiQ/ltzi6prTtuqAYPnNTJoXdZGVjr/yubPHiTvcEVw0asiEnzhneJFQcH1zjv/TPn2gmSPqYlEP7ov4CftZsan9wgYYpZF6/h34f46fzCgxlvzva/kiID/YpcPeBZFu1Fy3Q4GCU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489629976759.4679514977418; Fri, 19 May 2023 02:47:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwh3-0000BP-LF; Fri, 19 May 2023 05:46:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgy-00009X-Mb for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:34 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgv-0008Rb-No for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:32 -0400 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J5Jq35003348; Fri, 19 May 2023 02:46:28 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2042.outbound.protection.outlook.com [104.47.56.42]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw0vda2f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:28 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:27 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:27 +0000 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=RZJ/ECXJccVQZPzOfM3CWxAHJVk11v6IfR/PzTdt964=; b=SlR4QIGsRlfvxI0RTBBXN2iWPV/0OWRHCNDQN2pCnANOrCRYh7BzZGtlr5E0BbG+CAIc cnuVuQLaJDpoejkKHLB/fGit7uhjkWPIba+GUE0uZVN+rrukP/UhNF9GZLmLwhedctUR aP32ajtyTYd6kt17xsbkYInsKETmQzfocBjSYcuf0mYrHijPgCzP3Vklqt4fyaGD/wNA sUR66qcsDfjI9AOyygqwkTHg7RIp1lnyCW4KAhl/D9awga6qswPD7HMoF3fvuVhiVz+V mZOJryDTZQ/FoOn8CmoLviiPP8B/Gdn12mBJOg93LSs16RRYqhPxRdt3gfZIv2shHWmF Rw== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQJCiNzfsgUKhOtTLA3aeGF84UHRViuRKSCi3rOGq228s3wzvrRtUnjeT14FzEZ7ml3/Fl9qNZv3+1eVK8ccUpS//U229D2nlIkLlYcy9inxEiXlaYeqCFYjkrBzK8tTmInzrlS7V731YtVLBKpDB212fNJkIwAM9vXnlpksPa2PfVSNrBWNprMd+FgJ6bB4LTa0PXnsOoWQBV833/EbYQuhKBbAkRLRKVVKzJlS88JkgYVcMMwEtnTBkwcaVRH+oowtMY5Z1AKwPj8W71Pj6XGL9gC/JxMWJWjdulRlo7j5w2BLvosB9RRxyUJmuJuKKKsnKPXNU186jz4fz9Tbuw== 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=RZJ/ECXJccVQZPzOfM3CWxAHJVk11v6IfR/PzTdt964=; b=ZiOvwaBXXGIEl6ypsiCENZWg3bZgQ1u8720SiXF+rjEcqDpeQMXwIxWOR1j7XcY81zsQvlut0vhWgqpDmiDb/lY+jGotNGCnpAiGlQwMvjx8D1xgJZMNMAwhvRRcz3oo5f4uyxLALlYKcm4HzRaZNAucY6lL/I44gZyv/DBju5ZpimyRaHxXLzyO+K9m7v/2mWSR7/MP/EAKUqB7pQUUcB3wxxUZRgGlR+56OO5llBI53PgINHsTFiknM69vzaBWdxwiAEFYE5vhq/4IeCKBd6yMlo8DHgfrsXqammkjPgoBDLh9q2TSAuuoruD1eQbAffA3T1/gCN1mK9Hsz2IcIg== 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=RZJ/ECXJccVQZPzOfM3CWxAHJVk11v6IfR/PzTdt964=; b=a7Fhak834gMRq6PcVhZBivrYEmKNCjFhY970ORI3fO0xm16iRZrjOmFCMJwYt8Q2mqpD/deERwKzmqBeUbF9sy6GLuADE4UM0BQnLuumZ8QtoVKSzPzHa+2Ceh9lRZvlTYLxRsrs/hRu5gGTevoJM4yRv22kPsikE6wcuho6qlPW6mXsg0Bfj4sLBgWYUi2AT2Viq0ekVMjz2l57wgOSeUWxRWeTQ4CmMXEKEeSKTuZOy/EvldOpsA4oHUPdVKYo0Ajs9qjTb3MVxDB/V62GcmXlIl1069pBjVSTz52jw7LBeHgQXN5S1lbQvzw3nUXZSmnyBw0BZtkdIBnz+sl28Q== 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 v5 3/9] migration: convert socket backend to accept MigrateAddress struct Date: Fri, 19 May 2023 09:46:11 +0000 Message-Id: <20230519094617.7078-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: b8a6af4f-cf29-42f3-46f9-08db584dea72 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: ylz+qWCaY08kc4azpcUldv2oBAWDV4rhSYkYEXV0d6Xg9J6F7jzPAiJU9cGk8QETX8E/AWbUylI3+Igvz4tB/tzefUiXHFD9zEpLbn/ReNwe12TjOj9i/B84pHc1XCvvmZvVSFaKQbYjJa/ggw5eXM2lp+e8Y8YyCdX2HhArmrTyWkLw4WwZBtPQIXc0e931x85IfJca6PBKc8jSksDmKql/hP2ANRY3hlbtB3N8etkMwOVeQFLKtU3/JNspa3ToIB5x/KEcbcbOFyqr5ETyRG4hRKoV4TXUrU8L3w/E7yKVQqSObPtNIzpQmTkHNRumsolphkvtQlreB+jL9jawAVclsev0w+iOppddOsYBivOwViwJI4/E4RPTfPpcgdAc4yNIWDRqHJvQkmPOin/hl4fOlNvYn/cgtEm1zFA6cdzWl9hM6UfTefZAmwE4SOYoB0HKLIrP/o968xG8o6qjjcHkrOQWbIpv7gEHQlvNU9LAW3v4dT+RIuQrBXMWAONS5weyf0Abn203X6PZYpHLluUXFqlyshG4vvslkWGFe1OkWoaHiGrCsjz7GArRagPVTcsKySX2k/s5dFUBcf3Sj0HhSiZQW+Y16Tdv+faVo16SdVjz+ZkfJFVDkXwHv/6/ 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oZiz77zbSFQagXuUT87B9ilYu+4+GDwV3rW22J7HNF0x84h/syumhrPAPJ/Z?= =?us-ascii?Q?+v+Lr6j1RE0HB59YsQmxqVTWR4Yz4rqeuAlcsUUk1kidGDC1OS7MxoYnXLoz?= =?us-ascii?Q?yQFvvoW1eCglDaPN7x7Uwz2sDOknsFVQNpjXIsbGgF6D/oebkOIiqZ8FP36V?= =?us-ascii?Q?osQfljpZgdVBAgh7+gLh2IBLZYse6K62pfaReBMo7qQLeyq5RUWTZTFZbnAz?= =?us-ascii?Q?S3j98iDIZX6eeD24/QyObRk2TcImxVDvLLO0f6TmY7mEQI6VGADcTggdrkfA?= =?us-ascii?Q?Twuq3E65PvFua2k1Wz/zRflSf+fHp/1SC4kaRVWBX7977uUW5BMOhT1SLQtq?= =?us-ascii?Q?t6zBcE1FYU+ywE223DR8/eVJE3fALN2VGFAN5rPgCjuOtQEf609H8HSqyxrr?= =?us-ascii?Q?aWXjD+u3+3xkpU5arr/DI3xCFFKvjY6q/aQCWpOfgLZQ2nXHpLL7vecyOByE?= =?us-ascii?Q?rXHV9jnlKcbxRYDfFXao6Yw8qDksUEcWTsPp745hXwSMoH4vrVPXeMnvfczr?= =?us-ascii?Q?0+ifAS52zafD/vJeE8TRY+lGlU/+dn7fNyDXd83DLXsGNIhkN1b88KME8cl/?= =?us-ascii?Q?kLjl6o5wNkzz2kHRuIWpFG2ziWSrarNxp3ChId+NyEc0W45NBq+2amLSjB4S?= =?us-ascii?Q?9HHdx/P1eW/4T7NJE6qNyWxRG18nECBmVrb1e7kIZVc2gl3YdfcbRzzuANf+?= =?us-ascii?Q?boN29xu+iX5bXyggIhXRgYi+2RCTSPOkAU9KcZ1xqbisDNDrssSvfYgYiuzd?= =?us-ascii?Q?GKZeC1Ykizkw4drvqX7A37qWH7oFn+oR6JMkVbkQxE06dOLAP79E7Y3QD//A?= =?us-ascii?Q?KK7Raja0td078MnKRjlex7S2c4rtLvPueabEwmvypC2HZF+KJaI63+XcdyUm?= =?us-ascii?Q?GPuT16aCOfG71JUPPgf9Vq5MQlTw7m8zHZG1e7wEHVbvzMaqxtEpGl7C1Ir7?= =?us-ascii?Q?KF/CVGYh63kN5x0YMILRuJEQ4UPc+ZyDlAoDN1PSogyd1OgMHi8sRExUd4SO?= =?us-ascii?Q?rrEEhF1AdYfYi++BFNm1xLfshUNi0e2V0tbBEsdOUt8FzSF0vqThhh13rzzg?= =?us-ascii?Q?hze4y3XjQ/y5udpfDth/WVRc5n9n+9yLcSdv9x40GYOkg4PKcXK1aIdUVsmK?= =?us-ascii?Q?Rwf5h32+NsstRxF5qdPg2gLMfllE2LyL+8WRrwG1jcSBVx+tZcL4jn+S4XC5?= =?us-ascii?Q?qhcvHBPjOhtarjxIQEtfYMfCzFc64X5eP4/PEVV8dWINz0AGf8rKl3kDzb3f?= =?us-ascii?Q?BWghKloafQR6CP3yLxBG6/L+j9R49pJnGFtGQoCLFjosdmtcqwc4yP3r4iWT?= =?us-ascii?Q?Nu88rtCWkartnPcpeoPnfGJUdBDlt6gkj5JuXpC7DZq573HUoJFvLgrQyCM6?= =?us-ascii?Q?OtDgRDWJS10YnhtgW0GPLIscY9N/elv8KVgfMTVb4S4O4NnqNK3MC3wMj0VR?= =?us-ascii?Q?3zoASh4714hwsyCCVDDxuaYtCSgvjMNfLexIvsGt/YsSwtkPP9EKvdHQ3387?= =?us-ascii?Q?0x6hcSewOInKUV3pAa3EPz6Rne0BgXa1hlq1kOKGthi37/qUgNbr89SGazy0?= =?us-ascii?Q?Z7d2/2eD0H73mXPn8Y5KiLko6UxHSQPD+nzKEa8kEw00g7oo+7WUyyGTPVkL?= =?us-ascii?Q?xg=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8a6af4f-cf29-42f3-46f9-08db584dea72 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:27.4405 (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: OF4o5RCPdvqGprQlic3kLRHHlkeNDtUqaDiMoUvSkXfVnzkir5n7asj+0vYB1cPavhkVUDqcDlprZ4EX7m2I8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-ORIG-GUID: tq_s1HjDHI-1Pe-Nlj2gLpY8lngXZ_yf X-Proofpoint-GUID: tq_s1HjDHI-1Pe-Nlj2gLpY8lngXZ_yf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_05,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489630412100001 Content-Type: text/plain; charset="utf-8" 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 --- migration/migration.c | 32 +++++++++++++++++++------------- migration/socket.c | 34 +++++----------------------------- migration/socket.h | 7 ++++--- 3 files changed, 28 insertions(+), 45 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 4c9ecd521b..3724de7edd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -478,18 +478,21 @@ static void qemu_start_incoming_migration(const char = *uri, Error **errp) } =20 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 =3D=3D MIGRATE_TRANSPORT_SOCKET) { + SocketAddress *saddr =3D &channel->u.socket; + if (saddr->type =3D=3D SOCKET_ADDRESS_TYPE_INET || + saddr->type =3D=3D SOCKET_ADDRESS_TYPE_UNIX || + saddr->type =3D=3D SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_incoming_migration(saddr, errp); + } else if (saddr->type =3D=3D 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); } @@ -1687,7 +1690,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, return; } =20 - if (!migrate_uri_parse(uri, &channel, &local_err)) { + if (!migrate_uri_parse(uri, &channel, errp)) { return; } =20 @@ -1703,18 +1706,21 @@ void qmp_migrate(const char *uri, bool has_blk, boo= l blk, } } =20 - 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 =3D=3D MIGRATE_TRANSPORT_SOCKET) { + SocketAddress *saddr =3D &channel->u.socket; + if (saddr->type =3D=3D SOCKET_ADDRESS_TYPE_INET || + saddr->type =3D=3D SOCKET_ADDRESS_TYPE_UNIX || + saddr->type =3D=3D SOCKET_ADDRESS_TYPE_VSOCK) { + socket_start_outgoing_migration(s, saddr, &local_err); + } else if (saddr->type =3D=3D 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 (!(has_resume && resume)) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); diff --git a/migration/socket.c b/migration/socket.c index 1b6f5baefb..8e7430b266 100644 --- a/migration/socket.c +++ b/migration/socket.c @@ -108,10 +108,9 @@ out: object_unref(OBJECT(sioc)); } =20 -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 =3D qio_channel_socket_new(); struct SocketConnectData *data =3D g_new0(struct SocketConnectData, 1); @@ -135,18 +134,6 @@ socket_start_outgoing_migration_internal(MigrationStat= e *s, NULL); } =20 -void socket_start_outgoing_migration(MigrationState *s, - const char *str, - Error **errp) -{ - Error *err =3D NULL; - SocketAddress *saddr =3D 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 +159,8 @@ socket_incoming_migration_end(void *opaque) object_unref(OBJECT(listener)); } =20 -static void -socket_start_incoming_migration_internal(SocketAddress *saddr, - Error **errp) +void socket_start_incoming_migration(SocketAddress *saddr, + Error **errp) { QIONetListener *listener =3D qio_net_listener_new(); MigrationIncomingState *mis =3D migration_incoming_get_current(); @@ -213,13 +199,3 @@ socket_start_incoming_migration_internal(SocketAddress= *saddr, } } =20 -void socket_start_incoming_migration(const char *str, Error **errp) -{ - Error *err =3D NULL; - SocketAddress *saddr =3D 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 @@ =20 #include "io/channel.h" #include "io/task.h" +#include "qemu/sockets.h" =20 void socket_send_channel_create(QIOTaskFunc f, void *data); QIOChannel *socket_send_channel_create_sync(Error **errp); int socket_send_channel_destroy(QIOChannel *send); =20 -void socket_start_incoming_migration(const char *str, Error **errp); +void socket_start_incoming_migration(SocketAddress *saddr, Error **errp); =20 -void socket_start_outgoing_migration(MigrationState *s, const char *str, - Error **errp); +void socket_start_outgoing_migration(MigrationState *s, + SocketAddress *saddr, Error **errp); #endif --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489622; cv=pass; d=zohomail.com; s=zohoarc; b=fmfna9h+kJsN9FivxUW19Qblflh2/sY+kKR4e30PX2zCltyRlVpzEpm/qr8o6IqwTg0tcwHhqhm1astRTZ7ooalL2JECd08LIpNLcAPjvQiE7tHFp8weatpjSg0L6Z2Kew72yz6a+YT218SeFR0AwY53+t9GLdgHf0ug1jeqMSs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489622; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gKRydWLyO6rRjilcS0ihsVSMD6klFbAP/dH/wGgCwfQ=; b=h2faOEx6Sj8yHQbRkP9ksKGpGs7AoZR83PhNg0uO2lfxFE4Kexz7N26/sLW1bN6Vikkk6g7lUPl+za0djj9ykYjt+uyYHdsJZiBHMV57whfoRTo917jRr+8ZyE2/3T4h0QbRNzWkaVS/aJZK+YDS4Uyj+/fr/6f7/seZ0E7U9d4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489622072592.7492670952568; Fri, 19 May 2023 02:47:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwh1-0000AS-UO; Fri, 19 May 2023 05:46:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgz-00009a-P1 for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:34 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgx-0008Rk-VX for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:33 -0400 Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J4mKNT015301; Fri, 19 May 2023 02:46:31 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmvtrdagp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:31 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:29 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:29 +0000 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=gKRydWLyO6rRjilcS0ihsVSMD6klFbAP/dH/wGgCwfQ=; b=Y9YQ8Ar/9EgAS8iyxcwyWATLKu4V6y/2PYPr1wINHH6IDrpqje9ogpJVZRmBA6h2D/Qf 31MW1Xsrd+53HJRNwyR+QwgMzx4AtZJFVFiXHsAUek/LDez6aWhfXVbgt++WPEo8SdzV +jQTMvxbcUjXc7toYYKklOe6ZoleyZgkeQhcNBQlPCdFlo5nu5xvY/4QIULQUjsyTBel QatVSnALPArrq323GpqgGLP0gswFUnpEor1If5rmhTCP6GAAMJi4zi3Y1SiuQSco70tP xh1H+RBXraf92YxtBXgaHFk2eA/3ctHfEK+YuFUc1ilyMr1WoH9nDTWrGW+Ux0XkzTHR mw== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hT8l5cLwh6/93RDdgAhIjNn2kFGelbGKK8noy/0XcNZYo3tV2cjePpOhDqTdt22Yj7ZhQjmwJi6hswmP1/bDFKu0Vwu2Xa98W/md/ABGu7Uxo4LEo6eumemBXzKYdRXrjN+fIOV21ltwzg3wKIOzpRPnpV5IcmM9UAiRNZYyPNJH3fu/HcNseCYVsDT0u7Hq996hFNttggtR9bdSksqFG/Hi6pXKVedDb3MmfeQY73O9DALg9HzoFB+UqlflcY0iY1LC5KFbvH7rbKLizfHmb5Kz4UPhTgMjcyBq3Sag0OhcycqA/sqOM4nChQUOWRH3iJx5iRMU4VrTMHqO0QJrRA== 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=gKRydWLyO6rRjilcS0ihsVSMD6klFbAP/dH/wGgCwfQ=; b=IddTfFwUUVuQBN4wrz5K2J/cfnWWlIGQNcV2Boqb6l6T8U2NYKGt+1DRoj/9rKO14RA69Bt7lwCKq+8zvrHou2FZlLbtlGJA3wxkEkJhhi1t5qQo/8AQFqauw2dfNi/4jHLwc3arWPxNssKpbSbNlpAHfJusEePjRwQ0SzElXU4cLLbLg7nKSvx01Yr2nmOu29LNvgZtVHZyKs1cYTIgK92X5d0cFxoTD6lVNGTVN+gfbrn+UxIPVXhjzVekJ1ZU4ZQkeWtoRVaYRa0ANabb7sJEH6rmRzdeR9AlWQbGLbHIiuIbFPkxOwZ98U/9uEI5OLO/cpQ74dPPOwMbK0tPjA== 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=gKRydWLyO6rRjilcS0ihsVSMD6klFbAP/dH/wGgCwfQ=; b=j2NfgpJ1NPVJHCrbdAl8Ovtnyyv/aAc1h+rcsJQmj7yj9hOzKLKkwlFs/ETdakXwJK+ww+3EMUDR1Q/nU8zwCgAklBpqqT+qbZeUeVegXBSg3mRPsMvbd6Az0O5Cjg3ZlO72v/eDpF6v2la1QTtri8F/JnRE2HUk9+CfKP0xzCRxoN7e3UQFiVrDhW/1Lwbh2ugy+WI0IMKtaXqZSKPg+8ASu5qJakHjE++1nYpXm+2vipsBkkSPAtWA9OruBHjIYMRezzJd/RO7oHP4nLWFq4FAVOwD8fzNWjoVl5iADCFwRZ7kfGbG0OUo8L3tDGquXDoEw5iyf472XOaP6IfNRg== 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 v5 4/9] migration: convert rdma backend to accept MigrateAddress struct Date: Fri, 19 May 2023 09:46:12 +0000 Message-Id: <20230519094617.7078-5-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: b8290fc6-d742-4c14-2431-08db584deb57 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: Kx5Mm9xgV90EZZWbYAF5qUogL11DtPuOFcZK+JECa9UDI5bY7IoxRzKDymLL/Qx7mtccbV0duzapjtis6goys949nsD/F6ON9SqRVWIPqMYmJsfm/CusEmPxIn9U4kDEW4jisS5WhF06X9cNGjxF4mI9ZiWaptrQkRcd7cpEZ5rd74EZ40Sxb4PfHOdz72sclMvJs6gnXGkv2Mh390DFSydtLbkIQBqziVwznV0rryLOTVZDdYvzsp2Kee8PBBuOx6/kR9T7vmRSfy5ipSF5jQuYqmPclJxTar9Ve2juGQc/hqTUPN/Pe8vIEiMrsriJrWfYUX4uFXznvfXqE9TL4idG+fAug13Qa0mhHKHmjK0USqjH4bse3ZSIAyQdOhgy/iDEgXwbCkRdifwordvV/umlgmhd6KU9ZpqrURLGHfeX5Z1fCvGpPn11z4I7LCGVmAHCpoun4xPr4t/jsHc0KVG2KzqXSGULCKroxIDoMy8eqmf4JGyQQXvLRSDiQbkvTkYzcuprTMHN6wtjpkqeJ21uNZiixh+1WY6ZYfrgposLe/VEoR5yNJtPF4ZN0vtqUrMf09sha12F/UTp/p13XkfcOeWOYS+gvtghUuWaVvAooNKJU4tfcrXxi4OgVB+G 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yfQMRsAAmjDGwSa3fudAkouO4LXuhcs4a/cquSckCVkS/VGUMAuX9Erq2F3W?= =?us-ascii?Q?6aCfTmrx+gd0QbF74R4VT775vfHofnRL6y6T6ZDLJSZRnMbNUuwtKM7ACYFh?= =?us-ascii?Q?IH7Ce9LUjFTYK8jI4YTO7qvL2Bs8GuTtBBhk/nR86TaONk5su0c4qYeFumi2?= =?us-ascii?Q?xA313xSc3FMz2HcHrOPbMbwiZ69R2ucHDJdJau6dMfGxPplw7T3i9tkC/F35?= =?us-ascii?Q?RYrcbaPlKhucBi3LE1kDsapzGaV7RGZou2USLBVS6r6vebejCjODNikD0jlZ?= =?us-ascii?Q?SorPGxF0SOeqBlJObZ/VyEj/y8oK9PxlzS2wcDRA0BfiV1Lyx1Q4m/Adlp7w?= =?us-ascii?Q?E7wRATJXOqOgh7X7t06bW5gskDBAl/5r9Ip6mQQeOrVSMy+mpywQvyg/CEBy?= =?us-ascii?Q?9HpmhjqdekzjDlqkmaWy2y1H9yCV8NXvs65+8SE9i8zVwGFwAjXtb0eHEGcS?= =?us-ascii?Q?N1osDaiJ7zGol/k2Z4YjzrjG5P+Ma/MdW17iYim5FdC5fRGPYaeUTtptmKCw?= =?us-ascii?Q?cvdaWiiyqwa1mR2/iQdDdCJAwSvJzayS8tV32eSJH82Y2RzGd15i+gVmatsK?= =?us-ascii?Q?IK4FHr2GnEPIK0rHqN6Vr6RzUPc+QrxPz9DeP81CoaWq8TK6GCxQYRksMWCh?= =?us-ascii?Q?I61epVml/GaW6cbXCCb0yVfol7CnRfH7DoYAS4Td5n384VLj7AjcFU62Mc+0?= =?us-ascii?Q?j81NIfJoVi1AGIcjK95nbOh4bhlpDPzGZtlEWrW/LkGnvoX0HhomEwT79cJS?= =?us-ascii?Q?Cf+puwJskxSJsQbf09pjyT/gkgfht/NMC1ZF2XU+CgIA9EfOQhZgNIJLkMNP?= =?us-ascii?Q?sOYHN3Yns77pEYSNpnxfWBc+bVjhz4KG9G+eliZdE5D5m+9z+2dCLgT/GDBQ?= =?us-ascii?Q?f63jtwH9UbCLQQsHA916Jp0ZWw96ecHC/Pr4p1YHhwAfWPqhtO+Le9QC4mmu?= =?us-ascii?Q?o1E/R1ZB2C/2t1G0kKt4zYV5+UI8IX9sIozZNomzQAIjxwB3g6pLZ3Pt8w7f?= =?us-ascii?Q?riOTgbdbjGkZkw5FmKsGynrTTbd8ps5FmV6+5Nclh/r5mQNkbB4UvgPMnLBG?= =?us-ascii?Q?ZninAOTcjv6QQpb2jfwJ5beiBnU+SMrkcBzRA7+a7kmvT7oeFEuRyAwxLEyq?= =?us-ascii?Q?ty58BogJr8QBkIQum+87E07tKGxs5SDQqNNQbFaz9Cy0K8pTJBtP+V5WBBWm?= =?us-ascii?Q?u8Um6ZaADovk20lcv81oRlnSK5vobfJPD1w0FwAgRKy/6BMKaQAlKd2yItg4?= =?us-ascii?Q?Ie/7ZkqaZqG3hvnotf7DqeS1587O0isono41reXEhL0Cs25bs58owxWRvPp5?= =?us-ascii?Q?YSiKcSyAuG5wvHuZE3pXF1JxbH93bz4VHLFlR1sMFALeKgcVcFu4a5zERZvZ?= =?us-ascii?Q?XBlpl0NWXeqYSvrDemW987nEY3VUet7dkdtZ4cw1WoEhP00vc/+knjWlYWe7?= =?us-ascii?Q?py1lZVs+HzVqiyqre2OuLb+Q5Mla8p8jmG8At11enpYpShP4vK9ah0dDkujD?= =?us-ascii?Q?YAq13VmUGZVLO37eB2DkjYkMEZJWX1xr5nkCi5YZJ+x34VsM8ZYC/6emmiaX?= =?us-ascii?Q?+SWdJ9QYsSP2+Ats81TSRj0RAYciUJkDMl0cNmuW+TDWLRp458RowAQ65AWb?= =?us-ascii?Q?aA=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8290fc6-d742-4c14-2431-08db584deb57 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:28.9330 (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: SSfD87pkDAtwaShVuYgQxjLhHDdk749PwPeYNHrpK6rSZfV5+0H4bpcmg3BskAmqCN3Q7OpkAzK8vSxYr0jkNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-GUID: EQYXz6ejXF0nT3_0qtdVaX877f1qpehJ X-Proofpoint-ORIG-GUID: EQYXz6ejXF0nT3_0qtdVaX877f1qpehJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_05,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489624626100002 Content-Type: text/plain; charset="utf-8" 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 --- 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 3724de7edd..b7c72fafc9 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -488,8 +488,8 @@ static void qemu_start_incoming_migration(const char *u= ri, 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 =3D=3D MIGRATE_TRANSPORT_RDMA) { + rdma_start_incoming_migration(&channel->u.rdma, errp); #endif } else if (strstart(uri, "exec:", &p)) { exec_start_incoming_migration(p, errp); @@ -1716,8 +1716,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 =3D=3D MIGRATE_TRANSPORT_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 2e4dcff1c9..966a21151c 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; =20 RDMAWorkRequestData wr_data[RDMA_WRID_MAX]; =20 @@ -2455,9 +2454,7 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) rdma->channel =3D NULL; } g_free(rdma->host); - g_free(rdma->host_port); rdma->host =3D NULL; - rdma->host_port =3D NULL; } =20 =20 @@ -2739,28 +2736,17 @@ static void qemu_rdma_return_path_dest_init(RDMACon= text *rdma_return_path, rdma_return_path->is_return_path =3D true; } =20 -static void *qemu_rdma_data_init(const char *host_port, Error **errp) +static void *qemu_rdma_data_init(InetSocketAddress *saddr, Error **errp) { RDMAContext *rdma =3D NULL; - InetSocketAddress *addr; =20 - if (host_port) { + if (saddr) { rdma =3D g_new0(RDMAContext, 1); rdma->current_index =3D -1; rdma->current_chunk =3D -1; =20 - addr =3D g_new(InetSocketAddress, 1); - if (!inet_parse(addr, host_port, NULL)) { - rdma->port =3D atoi(addr->port); - rdma->host =3D g_strdup(addr->host); - rdma->host_port =3D g_strdup(host_port); - } else { - ERROR(errp, "bad RDMA migration address '%s'", host_port); - g_free(rdma); - rdma =3D NULL; - } - - qapi_free_InetSocketAddress(addr); + rdma->host =3D g_strdup(saddr->host); + rdma->port =3D atoi(saddr->port); } =20 return rdma; @@ -3359,6 +3345,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) .private_data_len =3D sizeof(c= ap), }; RDMAContext *rdma_return_path =3D NULL; + g_autoptr(InetSocketAddress) isock =3D g_new0(InetSocketAddress, 1); struct rdma_cm_event *cm_event; struct ibv_context *verbs; int ret =3D -EINVAL; @@ -3374,13 +3361,16 @@ static int qemu_rdma_accept(RDMAContext *rdma) goto err_rdma_dest_wait; } =20 + isock->host =3D rdma->host; + isock->port =3D 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 =3D qemu_rdma_data_init(rdma->host_port, NULL); + rdma_return_path =3D qemu_rdma_data_init(isock, NULL); if (rdma_return_path =3D=3D NULL) { rdma_ack_cm_event(cm_event); goto err_rdma_dest_wait; @@ -4113,7 +4103,8 @@ static void rdma_accept_incoming_migration(void *opaq= ue) } } =20 -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); } =20 void rdma_start_outgoing_migration(void *opaque, - const char *host_port, Error **errp) + InetSocketAddress *host_port, Error **errp) { MigrationState *s =3D opaque; RDMAContext *rdma_return_path =3D 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 @@ * */ =20 +#include "qemu/sockets.h" + #ifndef QEMU_MIGRATION_RDMA_H #define QEMU_MIGRATION_RDMA_H =20 -void rdma_start_outgoing_migration(void *opaque, const char *host_port, +void rdma_start_outgoing_migration(void *opaque, InetSocketAddress *host_p= ort, Error **errp); =20 -void rdma_start_incoming_migration(const char *host_port, Error **errp); +void rdma_start_incoming_migration(InetSocketAddress *host_port, Error **e= rrp); =20 #endif --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489665; cv=pass; d=zohomail.com; s=zohoarc; b=i//A7k3emdC/U4T+sJk4X5THvc9AQdaGwVgLPemreB3fJXhPTjwbuliqOk1fxvEqCtFDqr9HpjyTFupG37qo44VDLmo6EgW1njKKaRKPeVkeXlB5P3QO4DxnXbCdzbtbcf8w3STVgBoUju37DNvCaQN53SZ0RGdZefiwLYnY/Zo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489665; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XtTp3GLHb6VPeCAKCjNOD5FusDvZRctVCIVx+o5tH8A=; b=jA4LCzUufGLMx2IyHNK9owb80N5auRkVUl2CnB2OsX3+eFwUUi9lx6JlOg8xfjHQ64neD7acwBY6E2mdCyZIv/Qp7A485FiETE/IukSMiy+ouQyFexs5o6d7pc8+iF59U7fxq+4uRLu4T9z+B6A3OOteToOgMGkKO9mjvRmSKVo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489665096945.0544850441722; Fri, 19 May 2023 02:47:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwh3-0000Bg-SS; Fri, 19 May 2023 05:46:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwh1-0000A0-1m for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:35 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwgz-0008S7-7g for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:34 -0400 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J50Jod031984; Fri, 19 May 2023 02:46:32 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2041.outbound.protection.outlook.com [104.47.56.41]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw4fna3g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:32 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:30 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:30 +0000 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=XtTp3GLHb6VPeCAKCjNOD5FusDvZRctVCIVx+o5tH8A=; b=jYZs8VhbFUvzZ9OhIgK9POwD7gb9oahuasFwvKSE9iqRjkCk4aPeZKMLSJpQAhIIQ87G wPdRVz9XEZzm/j08JkZFt1B+izsxphGSWL7AgPeSZcltnMNLcw3EHf6Mlcydt0odv5vQ Vjt6xDiKu5ce0EXXaFzMmuSBJWdx+XoURa7lKBEB8ztW8nF2oiH2k46bVs9lua0BdOKr 5sbPt9F1LR5gW4umL96HQIYiArJgjmTnrvf8phLeFf8uVTcIPw4ss7zackCtrvufdRb8 y5DLU/CYYgNnK9uRJBSypfAb6zlLXe0Ss4lpEmQimEz8qeNqOSOpjjtBvxP/bYQw0v1d OQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hg+QU86Ae30bh38Bql3pd8l1UFdD0TAm8ZIGDemgJYOB+exwfhb1tdujhAsmwFVzkU5i1y1ddnnT/HgQVfxe5pgcsjRPTEMW3B4qjERjjMpCqYSJ49dR0UFdqcEMZgWqM/7Rgx+3Oy/ShF/+WnDfglZ4oliP89M4hYbtqhpTodMVn9FbRLy1eGEUhRL8urhzbLDb3iVAJDIj6KIBhyNvwBkBK0d323El0y4zjpGrgZQCcIwHYINbX+h8rhoxUf8ILkPAfBA9GmtUiJmM/b+OkFCdyt4BQkar+PzeuO5ulEZrcOk/OjsyTWWmBwuSURWijHaYUZPO8jFoHd108Hjfhg== 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=XtTp3GLHb6VPeCAKCjNOD5FusDvZRctVCIVx+o5tH8A=; b=EuyjyNX1jsqC1dmrQWW2o3XqF0dIuDbIForJuXYClh2AAD97KvBpawTCSuZGLwg4cW4bI9W46/XjVvSEamagVrdCCCOBDe150jt4yEJFM3134p0fKZ8XdNgJg0TyoXQItofMbJBSuU+/IaBoeDnOd2jfpoTLO519SCoMXE7hMio4WYlBNuk55uE6hI87arxKP3WyDr1WbspA6jG3PNJhb4lX2SGwcVaB2nHoOyCS69E/WaJQPqvAqSBwyGPHXFsWyXkcVtazFOhK5NiaOyFbQscnHexqAv1/Dppdke6o7Ewr9lHHH3Lkp/5JQ54tJ8TZMTp8x1CoCMAxg4yxxWvZgQ== 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=XtTp3GLHb6VPeCAKCjNOD5FusDvZRctVCIVx+o5tH8A=; b=s7cX26giNV5qZ8AbkbCmkRQlTMsWXNisPZQGKqNxANJuzRJpP5NlEIl1O2RqdbkhDPqz6fRDXQsMZ/wEOAHVBV4MvV0EakneWXFoo5sqAolkrH4sgYPLB2luX9xenBnzhPShTAfRPux54CgfmPjxZDKb0XnZZtJn2wmvQRns2n9xNZUbRUtMUCyfVcg+2vij6X7TlG1jpouRaSkm8pret8yWX4y6ajQdT5jNl4jCwxb9mF13pUAT48LGiAXk2myeyEODXv/D7Chy4d8eDgEVu8TpDS/N3zurcTRvMHhSrtj/P0jhYL9vStkpnGRWQG+n1WPiLeMeIIQEvpf8zLgbZQ== 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 v5 5/9] migration: convert exec backend to accept MigrateAddress struct. Date: Fri, 19 May 2023 09:46:13 +0000 Message-Id: <20230519094617.7078-6-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: 920530f9-9c79-4399-b188-08db584dec4c 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: 4fhEu1X0Y4iwJr3twLrKuLpfw3cT8lC7DWAJ0IcdPNHUGqksJF2beU4Ir1Jod3PE4SfCX8GQ9PrwhXDazNrgpBFXdddZbj6ZbkaIrL00xAxkDWxKGnSWJ4c0oxsNO7vJPKlErMXC51LC2CPySkQ0yDFTfWkjqjXouH+mQ5lM98nSbqnL8rxeM8b+c3Ai0mptaKl64WlAmiQ0N5+gTCc34HwZO7b/Puz2JIqGVQhzrl+AYolxioPFe8FxZRhx8axzWcKwBh76iRMoYrEgyds+su3kwCjrTUKUrojU6sY/V0i56a251McO/nnngjvR/+jEUVcLPkRsQH63oEdJycRIShxisc1lkGcAutQqgPUrhyOkX2MChNJDhQ7dj2Q+kIm9SgsLREQfpHAUkIXTgjlbRGJjLSINGFqdZehLPO9GTv0VpoReJ6FPw2ccPJ04uGxvJoFAqWaoUmtXXCAexOgvpmgom+MCcBiMFMSz6BScK47esLHOcbstArV4aIX1HGWcAfal0ncoStCN3NRGMIylgnaxzogE2DePykV4Al1AcbGiudIZOtQSKQ7dL/170ze0G+xMEB5HTh8PYny1+JNrUd3kb6l92ZPPYZUOJrd2UZhPs1jPN7K/tVoZLNMtnzC+ 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ne4FZSN/qJvU0SzdDtQNl2P5FctXQO0vC+4wJGF2AnCPXqT0cB/xSC/tQ9Sz?= =?us-ascii?Q?ELhvre5WhDDYnc7v8XJ3xfuJ00bZD6nTwK+BpWyfE+gue2wPqEYnPLcLZLma?= =?us-ascii?Q?ktSg3TnxWsLlOfgCTrM8yZygaWOB968H6dD+dU59MUxTvH41hLqky0l3Jh3N?= =?us-ascii?Q?kicpM5V0bE2HaUennYd2YgKg89iM2wYi//2e0QZteUJnhe+rMiRDSOSce7Ji?= =?us-ascii?Q?//1UZSp7JmLnZXMklCu4UYsbV14s4krbMO/uZc6tlPTFsEty0uAuFRCn3j+y?= =?us-ascii?Q?dDw15pqDp5BD0xMA1Q8xAvMQ3aa+LcTapnFHYB/6gMtes6amilGpurTPnANZ?= =?us-ascii?Q?ozVn/prKe2UmREXtvIjZG+JcMHpxWHTtIUWp0Zt6AChYUey5hum3B3p60+S+?= =?us-ascii?Q?y9JmpCrH944kz2ZCvEahqhIvzgwFuYgR9VxCpgFFECrxlCJpqTzdqtuPcbrj?= =?us-ascii?Q?ivZe/kABcSf9iviUqgihnOZF2IQ9saU0qtK1vbKzCiJj1+u+HuxyWJs3lQyM?= =?us-ascii?Q?iVcbmYSagfkQchUgAAq6avv4N896BdsphWZ31QeZU60J9JTi6ue1Ro8NQdvl?= =?us-ascii?Q?LAsZhv8htf9D0zsvWrYdyGFTRn3dF3bfCT4S9THyXWlxzYNhViPWBkoPp9nn?= =?us-ascii?Q?yrVJIoBbIjofmgPwYUiQrPl2m6wWx3QdOOQ8ChQ1ERnpkbQx+wvr/WWdiVoM?= =?us-ascii?Q?HTNWuvO2jUaNVhpJMx/tRbFEzTK8zcyp8HuII/+u2SLm/iT4CLzzxqkwTMRG?= =?us-ascii?Q?htkOx7Ppnvrm0ZyI+GfQPRBdOvCPo55s0mvDkXxqo60KY/dCM1EeeTp7slae?= =?us-ascii?Q?eSxPQ0lS+voMyN9nUt7ajg1SFpCMZYrQHGW/RmKTiiCfJ22aReXn9B33Lj/h?= =?us-ascii?Q?nrJ2fwB+uUR9KeNO1TLEdOXCNvSem0/axIMTp+XHQk0RvYog+0ih1jSpbUeE?= =?us-ascii?Q?nPlSYLtJJRuDu2sPg1f1lXJ0o4rdJE1taIvX3Ga17VaH5T7+Reau1kA1V8r6?= =?us-ascii?Q?uWJY/9t2dmvrZOK99ZRRWL3Rsuf+ZZlsm02UDmb+JFC9SwxOr5/S7maQj/X4?= =?us-ascii?Q?QPrvfAY47HTkBBzv2PDJM61n6FvL1Mfl8Qiu1ex6tKPjFxtgH+SqHbFzyuNn?= =?us-ascii?Q?1b7X1RBaWHu4WG5iPuRt1gADWLbRHNZ2L9ApOb2/YhDurLvYci6IxR+XaJYA?= =?us-ascii?Q?XylF9WfbiXh4xuaL/eAbKqac58S6va8AaM4DYfurVW9V4WmzDVp+heHKeZ7e?= =?us-ascii?Q?5hIpHxyl3ZgFkRTuKM8uRRifoSnu6ly8Ae4pwkV0Z92Y0uz5ABPyWYAe4SVy?= =?us-ascii?Q?60Lh5My5YCW02G4iH+KRInc5Ylkcqrr3ufYQfc9xncP0zf18xYdt0Dq5D2UT?= =?us-ascii?Q?vRvwvhfS5bsvK5cTg34pBZa+bDESn2H/OAgWh2GuMvlNiOVb9ZAuc8WJ0FmJ?= =?us-ascii?Q?vjWf+bCLW4kmuiThf8duaVLJE5CP8NAh39OmZvju9yN0/rxD+mdvJSyT2k2V?= =?us-ascii?Q?o5Hg1aknp76m5hvNsnzDv9meEbPLhUcywqt4zPDF3ktGSrQN7mXOWn7BvaYB?= =?us-ascii?Q?MnS9lJ2Bb9uo4AnvTAa1BYZYsBT2fBgqqOOhhFg3rPF8+ksNHiTgtJ/ZJO0q?= =?us-ascii?Q?1Q=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 920530f9-9c79-4399-b188-08db584dec4c X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:30.5261 (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: R6cfvjtavLrVHuD7EAiPNpu3ZvSh/rCdaGi1qbS7LyPJZyP9MEfcQtsrz+tpdVX5FG7eKNSPxRgMeV4W8gtN0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-ORIG-GUID: ejfaiZONexIkTLxpDxbR53liJklXW57V X-Proofpoint-GUID: ejfaiZONexIkTLxpDxbR53liJklXW57V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_06,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489666619100003 Content-Type: text/plain; charset="utf-8" Exec transport backend for 'migrate'/'migrate-incoming' QAPIs accept new wire protocol of MigrateAddress struct. It is achived by parsing 'uri' string and storing migration parameters required for exec connection into strList struct. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/exec.c | 60 +++++++++++++++++++++++++++++++------------ migration/exec.h | 4 +-- migration/migration.c | 10 +++----- 3 files changed, 50 insertions(+), 24 deletions(-) diff --git a/migration/exec.c b/migration/exec.c index c4a3293246..a4f02b207f 100644 --- a/migration/exec.c +++ b/migration/exec.c @@ -39,19 +39,47 @@ const char *exec_get_cmd_path(void) } #endif =20 -void exec_start_outgoing_migration(MigrationState *s, const char *command, +/* provides the length of strList */ +static int +str_list_length(strList *list) +{ + int len =3D 0; + strList *elem; + + for (elem =3D list; elem !=3D NULL; elem =3D elem->next) { + len++; + } + + return len; +} + +static void +init_exec_array(strList *command, char **argv, Error **errp) +{ + int i =3D 0; + strList *lst; + + for (lst =3D command; lst; lst =3D lst->next) { + argv[i++] =3D lst->value; + } + + argv[i] =3D NULL; + return; +} + +void exec_start_outgoing_migration(MigrationState *s, strList *command, Error **errp) { QIOChannel *ioc; =20 -#ifdef WIN32 - const char *argv[] =3D { exec_get_cmd_path(), "/c", command, NULL }; -#else - const char *argv[] =3D { "/bin/sh", "-c", command, NULL }; -#endif + int length =3D str_list_length(command); + g_auto(GStrv) argv =3D (char **) g_new0(const char *, length); =20 - trace_migration_exec_outgoing(command); - ioc =3D QIO_CHANNEL(qio_channel_command_new_spawn(argv, + init_exec_array(command, argv, errp); + g_autofree char *new_command =3D g_strjoinv(" ", (char **)argv); + + trace_migration_exec_outgoing(new_command); + ioc =3D QIO_CHANNEL(qio_channel_command_new_spawn((const char * const*= ) argv, O_RDWR, errp)); if (!ioc) { @@ -72,18 +100,18 @@ static gboolean exec_accept_incoming_migration(QIOChan= nel *ioc, return G_SOURCE_REMOVE; } =20 -void exec_start_incoming_migration(const char *command, Error **errp) +void exec_start_incoming_migration(strList *command, Error **errp) { QIOChannel *ioc; =20 -#ifdef WIN32 - const char *argv[] =3D { exec_get_cmd_path(), "/c", command, NULL }; -#else - const char *argv[] =3D { "/bin/sh", "-c", command, NULL }; -#endif + int length =3D str_list_length(command); + g_auto(GStrv) argv =3D (char **) g_new0(const char *, length); + + init_exec_array(command, argv, errp); + g_autofree char *new_command =3D g_strjoinv(" ", (char **)argv); =20 - trace_migration_exec_incoming(command); - ioc =3D QIO_CHANNEL(qio_channel_command_new_spawn(argv, + trace_migration_exec_incoming(new_command); + ioc =3D QIO_CHANNEL(qio_channel_command_new_spawn((const char * const*= ) argv, O_RDWR, errp)); if (!ioc) { 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); =20 -void exec_start_outgoing_migration(MigrationState *s, const char *host_por= t, +void exec_start_outgoing_migration(MigrationState *s, strList *host_port, Error **errp); #endif diff --git a/migration/migration.c b/migration/migration.c index b7c72fafc9..0a6ab9229b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -465,7 +465,6 @@ static bool migrate_uri_parse(const char *uri, MigrateA= ddress **channel, =20 static void qemu_start_incoming_migration(const char *uri, Error **errp) { - const char *p =3D NULL; g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); =20 /* URI is not suitable for migration? */ @@ -491,8 +490,8 @@ static void qemu_start_incoming_migration(const char *u= ri, Error **errp) } else if (channel->transport =3D=3D MIGRATE_TRANSPORT_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 =3D=3D MIGRATE_TRANSPORT_EXEC) { + exec_start_incoming_migration(channel->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1682,7 +1681,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, { Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); - const char *p =3D NULL; g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); =20 /* URI is not suitable for migration? */ @@ -1719,8 +1717,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool = blk, } else if (channel->transport =3D=3D MIGRATE_TRANSPORT_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 =3D=3D MIGRATE_TRANSPORT_EXEC) { + exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); } else { if (!(has_resume && resume)) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489683; cv=pass; d=zohomail.com; s=zohoarc; b=ax2NwgYx85LiIuLHAurWs9PLbNtnSUSUwoVCI2H1+f8f/k+MlrHOsPAbAxwzkDuk+tlrenrvZhKgL9DIKwis2af7L3JH9TY0m6B4LYlQgk3jYjwvC1UbmP2dGsQK28CxRmJkP/SnAymim4n5s7JYkRmh4u0eVvD63psH39uzhYk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489683; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=nDdoYy/t0hOZ081DVTBqbp7lBYMx5Z4qe0SmmVB4zIY=; b=T8EIBwcxd7IQQOItzfKt3+iWix7mZXv/wxYuX24D6ZYJ9eTqbNvHm3lcUTms3pDx7cJMf/yJJIJvfvIZpeuvqss/ViwrNvXa4ewao41r/aC8jvtiiF5iIpZWCFp3L7opEvMbMgJ+rKspimBiyPzys5hqJvMhli5wMNtUaf6MLXA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489683725172.2348730277913; Fri, 19 May 2023 02:48:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwhD-0000DV-SZ; Fri, 19 May 2023 05:46:47 -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 1pzwh3-0000BI-Dm for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:37 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwh1-0008SN-8h for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:37 -0400 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J2pJKn002052; Fri, 19 May 2023 02:46:34 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2045.outbound.protection.outlook.com [104.47.56.45]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw4fna3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:33 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:32 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:32 +0000 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=nDdoYy/t0hOZ081DVTBqbp7lBYMx5Z4qe0SmmVB4zIY=; b=SBL4b0HoP4vWNqI+lm/IfjEpgEzZkuvi9W64lTTYo6pm8oBcponZetzKy0aMNri3DXKe jH8vhzPXgdvVqD38F52cVMB7J3O6vNbgXotIrgK9ZIWOhTw30lPb7lUm2O6JWZ4vuMss OhoOOxRgmkCVm4PrGC9bugE1rxFX3SXf+Fa6bHImx+2Btl6qj3ZctOdGRuyyUCJ43KPQ EhtV5aiGLJUEVrKSXDsfQHvpHd0dZBIBejVIr75zBlxXSRsgV+/KULgc8NAaum6TUwAY 1A8+62CuBGcf1HyV8bko0EJGzhqSkIB+n3LkrWgRZRFAFwwVtVnCSB+GmF5peujPPBQB Kw== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fKtbrpcYat+6aNyKm7FHhjfxXMzUe9Pt3+mwO1XmFK/bIaHqA+42ebD5IGymnNkiqIMhcClr0DC5A4vbnAsgYPvpxARsSqTG4QjL8RtmJK47UI6/m4m03hlkQq2S1oBS8EokPnCTkixNeHk7u58iLjwpHrKlzkRUvtv+pHcH2vY7s6fchZhxz888vo30QQeqhEkRY7vmjnlmFaCUYCIOXSyWxnGhFI/DrSsWMdesmAFJVg0DCHTUmZ/yzgrvWjbicHwc5oc0uUo5KkoKVXwk6yE7BAM9rVklzN+IiC0zTd89krh/VroKSjGuP1QrSgPF9GXU5ieKp6vxDM/TOS28WQ== 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=nDdoYy/t0hOZ081DVTBqbp7lBYMx5Z4qe0SmmVB4zIY=; b=VFaKhx4qF8+oDSc8VAIxQhoC8gVBYZuBzay3uS1Y2EUTaZnzrOpfQlvufsNPpA1RIgHur6D9bn5hChsa2pEKv5iO/B2aPyPs8UYX1sZg7vryheits5MupEOewjPFK2siDaQbvIQ6diivFRfcjQQIITA7sK0B7tY7AxLY28KBNEwvUSlOz2181ntJOcNQl62y8QtAMLOh+Y6GJy8ZukpDrCBipviB+Gt3H8LfLDVHpMZ7Xt1RJmwO2xm0GVe82Y9rmCWUtjuC5sLzwbJxd/xWT3ZdQRXAYEtzODebuAKzKnmDJ1tiAw6xStqEwqTbpzrqnFOXLIh0WBmGmd/PQkeHug== 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=nDdoYy/t0hOZ081DVTBqbp7lBYMx5Z4qe0SmmVB4zIY=; b=cpdMWxjzgLeE9kbiyXK88Lib+3GD3DlQbT71KvqDlI75Y66QZow50a8b0H4YyjwecUEqqMZ+h9ecLgDu+Ma1S9+b0f3c37f3nlrWcUhRDT9lpguofetJnCtljUsSL2l26uYTw1HEmfWMOfYupMG6Yaj9Kmq8T1lpejTmcwJEaoJpXkzzBrQhDPYIei64zld7m2vh0qfSgHNGooT+l/JpZxLlMvSNgPZ08hXWE19kv3mntGojX27ygpiJVCW8ftJNzeBLBr19xHewLLqL+RzR2BdyUQT34vg1mSl+hMEphDCvTsn89s6f91Eu5rFZXIlha95d1bZUjqy75D0h5ViPbA== 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 v5 6/9] migration: modified migration QAPIs to accept 'channels' argument for migration Date: Fri, 19 May 2023 09:46:14 +0000 Message-Id: <20230519094617.7078-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: 97470706-bc40-41de-058c-08db584ded28 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: PjBrWHG5YkxbmBkKJtgS1vxEyF8cq9lznbpT2ibqDsUkPhUew1BOF2P1pZtrn3e4egGIKeIxUIuLHS9UqE3pPXlIqQFA7X1OfMTASc3YYtrAmnColQbd1DIg0Y7I2meNOP1Oe2vv7q6n2/34gPONO2v7xTJ9qBxZoXT8x3qqSq3U5jmmZKEpIglNCxv+YFFiTdRX4eHEaUjIQXcbw3R+6z+QbYqwMJ/LdUTy7WGh8Cd55MOvzViMIgWFXGA+jiJpmlosUsTjyTugzcRFywMJFi2Z6yxEgsTr0WRb+lZBn/REwwVr5qsAJk6knQqsToxdySoeWDTd02j/V/9ZttOKbuKVC3EP0g8UqSKCIvAadS9T8UKBoA4L5l30HozSuLC/IIjwY+c+/Sc0KVrKVc/hxeaVrgyCf4WsFJwb2rPM85Le7KA7WLudz1Yisqz+vkmuZeBxmdtLju9X+/1TZmH/9YjLob5fXsJbliTbfXywtPn7rWjLPqgu5soNIyqIycaePVhp9owhHdCP6jTfD7Xe4UKHrIf/VYJi6V3zOGTbSAMcQlKcQYvrGGIKBgr4oiUvTcvgqn9V6xGIlkyrllKLubsOVVvzIzy8iwBh61pwbxrm/SpgGIw/DYWgalNAhakNNVxXEFqFZNIU86K6MMcGMw== 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1OFSKPGZHEwBlXhbyl1kwNCzTkHSAHsjyjyYjpP0zIkdt6kAzHJTMpZTy0El?= =?us-ascii?Q?aM0H2MoNMUiTgd2cvsf9bxt/7T34mrjp3g1+1QRuMBDUPGtZXlU73GpQSCoL?= =?us-ascii?Q?wYANtf9gld8fceYebYzIyPEn19Vlo58oN7PHGB5Vjx31nEZNVD31I37QcHRm?= =?us-ascii?Q?I0MrZ5Jib2vvPjvc96Exuuf5n3Io9gzwX17Y6LDFgOjKoemzu629q0QQtz9R?= =?us-ascii?Q?yUbWyWsX9Jt/8gh2oQv4mQVTp8o3thlhWT9d0lQzZXxmlwX8CZPGVM5/7rd8?= =?us-ascii?Q?5Hp4Y06FaK2JNqpNDm+bRWoARpxD7+faJIewnKa9fIPdFodd86zfdKiCY2V0?= =?us-ascii?Q?av7nwExLHh9xuVq8l4pof2oAEWsLKbYe0Bd7bNgeCmsh4OeCLY2WmA73PV5h?= =?us-ascii?Q?6II5mIJGpqw9KGuP6aHve54LC3wr4uOZqX4KGRgbrGlj+aT5SQlSfbVvaANC?= =?us-ascii?Q?e/JA/AL3Z2nd5itkxxFueAhGOi9deIEJ1+XzrfFzROemk8Scqd0a3auam2eT?= =?us-ascii?Q?Zp4oKBN4pS0CaDXEqOMc9icHpCLbRH96CLncQwaztA2Il8pXvAxNp6YY8vIh?= =?us-ascii?Q?tncKeMHOOpQdCAxLrIEeKjbro++c+6T0dc7ZZ7c6PvSKjb8nrOSt2fHDO3Oq?= =?us-ascii?Q?aciK2x6q8HovvzszPF9yLYtI4TByB3qq+Gw3wfthR9UccrtoAx0i54jTwoB9?= =?us-ascii?Q?hODaoI0ILZIs8UPFldXBbaTNEyYZjHdAZVeWMvYcLVe5Y++Xys6yHi3Ytc+Z?= =?us-ascii?Q?uaX5K5yVTraa67/nKblO3TyOcnslnE4yi/MSVanrf+jtBQ75Q+DXkxJOXqMF?= =?us-ascii?Q?3Mg238qAbtE/Le9QJV/zAVxw5UhRPtn4K7vKHiPEHLLqjAJKaAP8zRmDj7pW?= =?us-ascii?Q?2x6uE8a1PxKJzNObJW4UM11OP8QNBSeK0diEv3WDiufwY3Eb48x2G5LKpzvQ?= =?us-ascii?Q?ya4eJ4PsE5s5RhZ8CRqMiTDNIwm/fL0PuEatvjep4uhqwa88GtQBr1ry0+k/?= =?us-ascii?Q?AMJkf5kyC6YiZSUsGVOADFxuexbh/jWssUl051pZxIMR/1TPdItj9hYDdree?= =?us-ascii?Q?pirG4YWvDlCQS7Ac3DlUelM91g5+yXC689VxslVJj3T/WxmsWwoJeJC1tMWp?= =?us-ascii?Q?35zaqd9yPm8rd6H547M3KbqBxqk0OapDO7rOx7hHCr3/NLKz0V3zvKj/ldGC?= =?us-ascii?Q?ip+ndOYdBN4tF1AEUbJcQbyViN0U2XgrFN+mcrFi1hRTO92MowVixjqDV3Sf?= =?us-ascii?Q?UovvULBuiUAF0yIxu6W72P0JM2XoQ+OsX1vxQRQetzf56JEDkf++R7dYQxHU?= =?us-ascii?Q?q3xPGwccUZHM/5yc+KLyhImrEggzMnwCZKsa4o4OMRp7SE6TkrX5kSAtQ0kG?= =?us-ascii?Q?UY/bGHtmbNiNhu/KpPTaCxJmCm0GB9De/jzMcnqWQRqBRoinplXEoefog3/6?= =?us-ascii?Q?JeZ7Rb65meiKaRkJhQW8iQYY/uSrVihZQEMWn3BGSyGEn49Z7Q750jNpMv9b?= =?us-ascii?Q?JIFgIeKT8aRwm3f0Qb7iRqh3499Lwn9w1tNzlVaq1gkWml2Ix4/+NU3MR4g+?= =?us-ascii?Q?dog4tKNjEkkGm+G+qev8TTW8GLJ/rv3u+yN1X41ylSvzqeQNPvZD66K7tzBU?= =?us-ascii?Q?YA=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97470706-bc40-41de-058c-08db584ded28 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:31.9988 (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: vEyE56kGxGn0l7rU/dzp8WK9HVR6haRRglmblt2/a45IVIU+7D4porimO5H1nb7YZztmt8NmIpkwt8tmDFcPVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-ORIG-GUID: lk28twIj2DWmd25lI_ujmQBkmT6f_-PN X-Proofpoint-GUID: lk28twIj2DWmd25lI_ujmQBkmT6f_-PN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_06,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489684666100001 Content-Type: text/plain; charset="utf-8" MigrateChannelList allows to connect accross multiple interfaces. Added MigrateChannelList struct as argument to migration QAPIs. Future patchset series plans to include multiple MigrateChannels for multiple interfaces to be connected. That is the reason, 'MigrateChanne= lList' is the preferred choice of argument over 'MigrateChannel' and making migration QAPIs future proof. For current patchset series, have limited the size of the list to single element (single interface) as runtime check. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration-hmp-cmds.c | 16 +++-- migration/migration.c | 38 +++++++++--- qapi/migration.json | 104 ++++++++++++++++++++++++++++++++- softmmu/vl.c | 2 +- 4 files changed, 144 insertions(+), 16 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 9885d7c9f7..8ddfa258ad 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -423,10 +423,12 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *= qdict) { Error *err =3D NULL; const char *uri =3D qdict_get_str(qdict, "uri"); + MigrateChannelList *caps =3D NULL; + g_autoptr(MigrateChannel) channel =3D g_new0(MigrateChannel, 1); =20 - qmp_migrate_incoming(uri, &err); - - hmp_handle_error(mon, err); + QAPI_LIST_PREPEND(caps, channel); + qmp_migrate_incoming(uri, false, caps, &err); + qapi_free_MigrateChannelList(caps); } =20 void hmp_migrate_recover(Monitor *mon, const QDict *qdict) @@ -704,9 +706,13 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) bool resume =3D qdict_get_try_bool(qdict, "resume", false); const char *uri =3D qdict_get_str(qdict, "uri"); Error *err =3D NULL; + MigrateChannelList *caps =3D NULL; + g_autoptr(MigrateChannel) channel =3D g_new0(MigrateChannel, 1); =20 - qmp_migrate(uri, !!blk, blk, !!inc, inc, - false, false, true, resume, &err); + QAPI_LIST_PREPEND(caps, channel); + qmp_migrate(uri, false, caps, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); + qapi_free_MigrateChannelList(caps); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index 0a6ab9229b..abccc6bf26 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -463,10 +463,22 @@ static bool migrate_uri_parse(const char *uri, Migrat= eAddress **channel, return true; } =20 -static void qemu_start_incoming_migration(const char *uri, Error **errp) +static void qemu_start_incoming_migration(const char *uri, bool has_channe= ls, + MigrateChannelList *channels, + Error **errp) { g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); =20 + /* + * Having preliminary checks for uri and channel + */ + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in= " + "'migrate-incoming' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; @@ -1488,7 +1500,8 @@ void migrate_del_blocker(Error *reason) migration_blockers =3D g_slist_remove(migration_blockers, reason); } =20 -void qmp_migrate_incoming(const char *uri, Error **errp) +void qmp_migrate_incoming(const char *uri, bool has_channels, + MigrateChannelList *channels, Error **errp) { Error *local_err =3D NULL; static bool once =3D true; @@ -1506,7 +1519,7 @@ void qmp_migrate_incoming(const char *uri, Error **er= rp) return; } =20 - qemu_start_incoming_migration(uri, &local_err); + qemu_start_incoming_migration(uri, has_channels, channels, &local_err); =20 if (local_err) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1542,7 +1555,7 @@ void qmp_migrate_recover(const char *uri, Error **err= p) * 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); } =20 void qmp_migrate_pause(Error **errp) @@ -1675,14 +1688,25 @@ static bool migrate_prepare(MigrationState *s, bool= blk, bool blk_inc, return true; } =20 -void qmp_migrate(const char *uri, bool has_blk, bool blk, - bool has_inc, bool inc, bool has_detach, bool detach, - bool has_resume, bool resume, Error **errp) +void qmp_migrate(const char *uri, bool has_channels, + MigrateChannelList *channels, bool has_blk, bool blk, + bool has_inc, bool inc, bool has_detach, + bool detach, bool has_resume, bool resume, Error **errp) { Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); =20 + /* + * Having preliminary checks for uri and channel + */ + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in= " + "'migrate' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; diff --git a/qapi/migration.json b/qapi/migration.json index c500744bb7..86bbc916d1 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1448,12 +1448,47 @@ 'exec': 'MigrateExecCommand', 'rdma': 'InetSocketAddress' } } =20 +## +# @MigrateChannelType: +# +# The supported options for migration channel type requests +# +# @main: Support request for main outbound migration control channel +# +# Since 8.1 +## +{ 'enum': 'MigrateChannelType', + 'data': [ 'main' ] } + +## +# @MigrateChannel: +# +# Information regarding migration Channel-type for transferring packets, +# source and corresponding destination interface for socket connection +# and number of multifd channels over the interface. +# +# @channeltype: Name of Channel type for transfering packet information +# +# @addr: Information regarding migration parameters of destination interfa= ce +# +# Since 8.1 +## +{ 'struct': 'MigrateChannel', + 'data': { + 'channeltype': 'MigrateChannelType', + 'addr': 'MigrateAddress' } } + ## # @migrate: # # Migrates the current running guest to another Virtual Machine. # # @uri: the Uniform Resource Identifier of the destination VM +# for migration thread +# +# @channels: Struct containing list of migration channel types, with all +# the information regarding destination interfaces required for +# initiating a migration stream. # # @blk: do block migration (full disk copy) # @@ -1479,14 +1514,44 @@ # 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 defau= lt +# destination VM. This connection will be bound to default network +# +# 5. The 'uri' and 'channel' 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": [ { "channeltype": "main", +# "addr": { "transport": "socket", "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channeltype": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channeltype": "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': [ 'MigrateChannel' ], '*blk': 'bool= ', + '*inc': 'bool', '*detach': 'bool', '*resume': 'bool' } } =20 ## # @migrate-incoming: @@ -1497,6 +1562,10 @@ # @uri: The Uniform Resource Identifier identifying the source or # address to listen on # +# @channels: Struct containing list of migration channel types, with all +# the information regarding destination interfaces required for +# initiating a migration stream. +# # Returns: nothing on success # # Since: 2.3 @@ -1512,13 +1581,42 @@ # # 3. The uri format is the same as for -incoming # +# 4. The 'uri' and 'channel' 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": [ { "channeltype": "main", +# "addr": { "transport": "socket", "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channeltype": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channeltype": "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': [ 'MigrateChannel' ] } } =20 ## # @xen-save-devices-state: diff --git a/softmmu/vl.c b/softmmu/vl.c index 6c2427262b..ade411eb4f 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2633,7 +2633,7 @@ void qmp_x_exit_preconfig(Error **errp) if (incoming) { Error *local_err =3D NULL; if (strcmp(incoming, "defer") !=3D 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); --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489704; cv=pass; d=zohomail.com; s=zohoarc; b=Bm8e+jipTQM0BHZOQSsKJ4h+gwdPIGt176TzFW5rGHxz1Pk/3lvgDbdGP548wjBI9sjoDLo+pkq/7Hp+PQ8JAlqUsGQCpywvHrcPIdUtm7ECPD45t14HhD00wYM7r4Pc0xqdF59yV1q9S738r0GNhF6uYOzNgDXkxld//EofiG0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489704; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CL1UKJsalFSKxW2mgL7YEqL+z4e/qcEiAXPCnFWtC58=; b=m70Qm4/UF/K7odQMNYDBpgo6k8hg3I8vmuaEVaVxg0yocODb8eB1hS6csPpHaLrKunxaaNZhNWESbrJd22Uge/e86Z+hzhl45JrXXfJuQraRS7AMx9+jIthNCeU4VrKlP7ki5TYalhif9vK/wIEx0V0nh9yjsJGG7pLmbvJEUJA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489704648743.3471183352276; Fri, 19 May 2023 02:48:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwhP-0000E7-AJ; Fri, 19 May 2023 05:46:59 -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 1pzwh4-0000By-CI for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:44 -0400 Received: from mx0b-002c1b01.pphosted.com ([148.163.155.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzwh2-0008SW-Li for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:38 -0400 Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J2p4Rw000994; Fri, 19 May 2023 02:46:35 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2048.outbound.protection.outlook.com [104.47.56.48]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmvu7dbmk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:35 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:33 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:33 +0000 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=CL1UKJsalFSKxW2mgL7YEqL+z4e/qcEiAXPCnFWtC58=; b=HAXpbx3aLfAazqUvQs7+vIToq5LQkUQwPpvLUzZI/8ABmglWxaui8WXiSluKLDZmu4tv CTSWW4/9u46Nm2T54Lbgliu7HiF9KtjAkNe9PHYJ/8ugrQmGMxbQKjtZn53WDjHBbRLc fYvyDq/WUxjSu+xZMLXfqwVgIGWi3LOz3sJrWij7L+N3gqIIzm5wUeWYN/1YFI92JoSY qCi8ousWe/3rpzB3WfiPghU3ttWGReMCuzE8/5QwHh/53p+Cq66CdR+HpnLcVOgMeygP vOPH/gLKdj/1sQK++GfxbQTP7hbhHOX9jz9F1Zur2l/i25Fh8qB6IXZguUZ9IfQPu8iG SA== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hkGokfEQ+MUU3fI7RXQCfa7usQ12QiC26G7uwO9hhlWvVoGUBaAC2mkUAA7HESQMuMGkkGoTKITP0UnvinOFiuokWG95THVnsrbt6rgA94iWLHRA6vaHvoys4cz751Q0/1WzdawarFlbAqBIiL6DBp1WNYmOGt8XTUfAXflp1NEb9QWJ7u/2ZC9NnLH8M11cR2lO/k+uZFxK5lSYCDwGPc/lezEtio6KyqPYQR7sxEDgmqA+lBWOZqBQq5xIKwknLSBM/8YDq2qFzodROHsjPzIGzEQPVwnYUs/a7VnkbUvBTQR8ujp+qNnc/jcl3ivpk9DLEMWwhMRlwsx37EwB9w== 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=CL1UKJsalFSKxW2mgL7YEqL+z4e/qcEiAXPCnFWtC58=; b=lo7cHCZ1Ks4wH5lhmPNipEshJ7ac6fF0fjrrE1e/w4J9OMQEHxwjh1KNXVBWMqGhpTFMD6UfSVdL1/n7QO5H+DNbeBXI1m82dVsBWNYs+KdooL0te2hu5oexCbK2ptTeXYXa4ooFN4frNe5y0HruT1UBjLEH7+BjIjWxI/LsSWvScR/CmC2W9i7eDyk8lgrX6lIdVo2RkVdTwwGzP18PRHAiR5ykjL8CV9smCEPVfcbx29QAb839KMXqWvntIk+i6zKs/Rl4XvKT1YEvcqB8nUQY6p0LQybe1oQ24pqm2wqscfFMleHEpwOOg+61dIBixwGqb1Vwd/Z7ltImVR5LMQ== 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=CL1UKJsalFSKxW2mgL7YEqL+z4e/qcEiAXPCnFWtC58=; b=cipLW7r4vRFgZfdkJMFFm9ZGHns+jGPkELTaXCRnc0P3htDBlacv0943OAMrS6kt9ukle2y5pOhuj5duPFyCC8jX7bWwJL8BwkHhHDFzm9zAI1WQx8utTDIfpaJS1ZhKlesZlUxa5uyLdTFQIxP6rqL2Fe2J7aFKVLuTtQOu7pUtgukSLqDKLkvDsmLPbg4hkB2HJLsZ9joLyXTMZ51wRcyfmfQighOTcGX+pH5R9e8y97t+heAQYwciDqSOsih4JZ3nvdPcPmKDs2N23fvbcqiWMLpfchV0SvzHllSJ6JkB2ZCR/OvOlTub7vV8aJeJ+NkY0TiooGtH/jeF8BkIgw== 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 v5 7/9] migration: modify migration_channels_and_uri_compatible() to incorporate newer migration QAPI syntax Date: Fri, 19 May 2023 09:46:15 +0000 Message-Id: <20230519094617.7078-8-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: 3c089761-6159-4bee-a55c-08db584dee30 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: mDFSMCRdux8bcTQB4JH5F21SHBBXFMB4cgkMy/pagl2ERDfZf9b4AAPbqcs4SFolhrM7petWu834gmrdKGRuUsHJLJHC88y6MN2uV76rrwkE9M+QIvpB05Bp51ckeSczxehSZNyaoALp+WIA44YVwz7z7z/Ap1c3gm9sfUAc+eW5mUFeaIW6YLKqXBWC5HTx3QDYnIO26mjtFchMczsA2l00hWy4LtGizTNtHf2NZK3XSj9+WkJPp1b5wpgg3TCEYZHn36SSg0g2iMwgqt/4Bcs80/uBpTC3vgLlhOr2Mpgh60yeVB38DhWU9lHaoOdluPWJJ6Zhdl5jV8x4xqvBUJTN93VAjN61XeKjjS0p3e5eVEgw7dHNH+DmxmPUjk/6AqrVUDhnQU+20Bxla4eVHJUZK6/jgU0eLYiCplWiVdDuBi3TEEiFtm39Azys41JRWqTetCS4a8GJn4JxvT9HpSgw8KZj7pBbgNDMgT2GqOo34bUvsFOSmUP7jjMkgdLWoe7OK67a5o7Nc8xvEYz+bd0yjWlkFPMA4M6x1n0zn0gLBRVE8c89RUA9xMMnDLEidNyd3SAqZPUpqTemhNABTqHoFYKLYnsait7cgJjRJEtxoYgDmoTCh7GVRNi1Cs2C 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SsaZrEtZgkTVaflv/RVuO592iRJygVz+e7o+4M6n278NTdqpzr7XwDy5UL05?= =?us-ascii?Q?tj4A6faL94o/dQ5i1fkelNWgJNlLihjDlVcbC/DjXWTW6lhIUzCQrEAyfhQC?= =?us-ascii?Q?H0Ep77KE/DVCJR+hPBZnHSyMdQJZmhfjlaM7e8vSluy/hpDRQDuBKcxlWtJT?= =?us-ascii?Q?tKpSH0EExcR+hjP58TNQSU+0r7H2SaAP5EN6vrhPXjjqhFyH8Xr1vfLCjNIo?= =?us-ascii?Q?bc61vOZ6M0uNToddTWQKwp5V8fEIuML0NJbiF+qwO7yH3NEFU5vbVI6wX0yl?= =?us-ascii?Q?APAIZVlK3CCQNMbp+AQsm5ZtzTwn5FmllRxgGPlkj4P28Usbm490p+ibTDb5?= =?us-ascii?Q?ueHQxmVcITtn44j/9ES+H2dKRn+LSmIL3MSsv11DlYFNJTBmhiJkL2iJqany?= =?us-ascii?Q?jrpgWG90dHcmS3J+4qm87ZHZthSd1tFUSA4y+82lbA718fmXsogrkR7zH80x?= =?us-ascii?Q?F8RcrA+pzjrEzvAXZCUP6NtVz1EScBpzNEci6jQb2rYuJG+x1Q1NGCwvJ1oJ?= =?us-ascii?Q?NeEDVR4Ou8k0/bzBZpTUaAe64SHxD0D+0B59eympRGhP5niftfjcPyywx0fg?= =?us-ascii?Q?R1wodbb15cFa/SkmEMzU/jObS8ZnX4iM/GgjZAYfnlZ3WDVgKbG8bqrNlanE?= =?us-ascii?Q?X2WXlzm+V3rUxyuXj7ayLJ5Rmsq0OjFtQtdCOJpx4QUsT+du6C5D87ZvsODT?= =?us-ascii?Q?9Xp51DEQpq7JoKf8vchiKjipg0/EXANQRBfJv1+28lCWgUc1+TYx9rwBpEeV?= =?us-ascii?Q?4k4rGoBEVBmO26BcRzcLo+O3jkVTpLO/Hm0lnTK1frY7j7ILNG1pohujWsFo?= =?us-ascii?Q?lKX7BviIJLachFOGltKGv0tmL5po0Zj9CfitmMRYYT6Cv+1pjcHrTfzSKvnt?= =?us-ascii?Q?6GZIkfiIIi+6o8+E7u6ubPeRa+VVRwElzt9P5eSjFdW+lv7uzTIgpe5DAh1L?= =?us-ascii?Q?uHk8FHTbT1+Z5umdmazjccwTz2StloXc001Z05fQ9dYPCx7noONHsaG+BPsf?= =?us-ascii?Q?CIzy1YQcymUIEdIOFGFW+fPg4w37mqionK4ONyHpjd+4tyNW5VRY366i+gQf?= =?us-ascii?Q?bAvuVM0Oj3KyaQgVcPPd9UDqDU9wgmFvmUYbUM3k83QUbGTj9uQ/3dFohGC/?= =?us-ascii?Q?etCTE86Fp65APtlgf4pt87BvHKNr21IRME76TaTI52aCBVLjpEBYJQ2VMZre?= =?us-ascii?Q?5cfEyg5peKCaz6YEtQsZxbfvtTMx9qiETtpsVwlZPvYnpSoBQdgc47ZmoIY2?= =?us-ascii?Q?LS1KJHTFyPiwP2IMwfr5+Y+3b2Fp5ftMnZ9JHXQScYzQOjjQKL5YrDV9WIMe?= =?us-ascii?Q?kRlqaePbVIoSJo+eWw1uY0e0QEtaVaZ2TayKBayAp66Sw2PsBWOwYwtcsm3T?= =?us-ascii?Q?IgcLG3lmSuzUSIrup+kS+Z7Iwd/1YDjuI8O3qwjRZadJa4MvGoXYNCKM76ic?= =?us-ascii?Q?/WZPVmyqxwhn5WQ9GE3HKzRrDifY0+FwW4tZK5aZOBv2QRCshlDDzp9Z6GQK?= =?us-ascii?Q?fspV2A/xi95mCpJe+fyiHKXZH3hTG8moIroUMzirEaMhEEL6O/PzOeXXc+S5?= =?us-ascii?Q?+xcg4224uPRqqtVJX9I29YfOUN9M01ilzSQX4D5n?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c089761-6159-4bee-a55c-08db584dee30 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:33.7277 (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: WNZ74nu+ah8ve/dGIlyNJGPSAmNa2HDaU9Hh3ImRfWkgEYQrEtEvk8aT0wRE/Ow0cuPInlkbhiZDkkkc0HGirg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-ORIG-GUID: 9TDzAZKN9cbwS5gKyZDTUL6GJaXbRSz7 X-Proofpoint-GUID: 9TDzAZKN9cbwS5gKyZDTUL6GJaXbRSz7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_05,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489704887100001 Content-Type: text/plain; charset="utf-8" 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 mordern MigrateCHannel QAPI syntax too. After URI -> 'MigrateChannel' object conversion, migration_channels_and_uri_compatible() -> migration_channels_and_transport_compatible() passes object as argument and checks for valid transport mechanism. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index abccc6bf26..8afdea4f91 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -103,17 +103,20 @@ static bool migration_needs_multiple_sockets(void) return migrate_multifd() || migrate_postcopy_preempt(); } =20 -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 =3D=3D SOCKET_ADDRESS_TYPE_INET || + saddr->type =3D=3D SOCKET_ADDRESS_TYPE_UNIX || + saddr->type =3D=3D SOCKET_ADDRESS_TYPE_VSOCK; } =20 static bool -migration_channels_and_uri_compatible(const char *uri, Error **errp) +migration_channels_and_transport_compatible(MigrateAddress *addrs, + Error **errp) { if (migration_needs_multiple_sockets() && - !uri_supports_multi_channels(uri)) { + (addrs->transport =3D=3D MIGRATE_TRANSPORT_SOCKET) && + !transport_supports_multi_channels(&addrs->u.socket)) { error_setg(errp, "Migration requires multi-channel URIs (e.g. tcp)= "); return false; } @@ -479,12 +482,12 @@ static void qemu_start_incoming_migration(const char = *uri, bool has_channels, return; } =20 - /* URI is not suitable for migration? */ - if (!migration_channels_and_uri_compatible(uri, errp)) { + if (uri && !migrate_uri_parse(uri, &channel, errp)) { return; } =20 - if (uri && !migrate_uri_parse(uri, &channel, errp)) { + /* transport mechanism not suitable for migration? */ + if (!migration_channels_and_transport_compatible(channel, errp)) { return; } =20 @@ -1707,12 +1710,12 @@ void qmp_migrate(const char *uri, bool has_channels, return; } =20 - /* URI is not suitable for migration? */ - if (!migration_channels_and_uri_compatible(uri, errp)) { + if (!migrate_uri_parse(uri, &channel, errp)) { return; } =20 - if (!migrate_uri_parse(uri, &channel, errp)) { + /* transport mechanism not suitable for migration? */ + if (!migration_channels_and_transport_compatible(channel, errp)) { return; } =20 --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489643; cv=pass; d=zohomail.com; s=zohoarc; b=BoGtyt9QXvyn7u8XBbawJeLH5SrEqqobc0iTar28vyQg5dPqHsul3zRo0ymrvXBXiZgoSuY9HCSxsu0F1EZAJMEJhyEZ/lshZi6yDubLJqvnAaWa7Qc/77IpkG73IKC71V3YQpnmJ9XG4Wzqay6HHJ1vbbDg8EmZDJjz/eTkqOQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489643; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ISIUxtMRlIOIJp0TeuSX/VCex3O11KEXuVzJp63I/jM=; b=CPHDouBdfL465CM0UYRXsz4zoQefkVnXCShXppDrn5fRUzYQcjB7r5ReGstDqBaihPrytJmQijusxvZpkH7CQRLWt3BVefMe4O1EXhALmqTpoAIdTTsVtCoaSM3b1nrn8kXHThw20S0C++JgiIUp9Tg/AmpCFDck57kLGantZnk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489643521591.6354921367137; Fri, 19 May 2023 02:47:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwhg-0000S8-Ub; Fri, 19 May 2023 05:47: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 1pzwh7-0000C8-Po for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:45 -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 1pzwh5-0008Sq-Gk for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:41 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J8qln1011300; Fri, 19 May 2023 02:46:37 -0700 Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw97vjca-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:37 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:35 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:35 +0000 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=ISIUxtMRlIOIJp0TeuSX/VCex3O11KEXuVzJp63I/jM=; b=LoTOsL+ooTgaEQjvk1Hph/gICQQ/tEhn8oiZk4q+Z5+xv29pDlbk9AlEpMGqfrfbE8fw 1kRJ9c5PoIAIQJrIc8zjXEqSZby5BD4gCQcSPRMOGxmyn7N1VXt9rl2IRBErS91GHb6U sdpa36nNb7OUYXy2tZNAmah3wWWbyuEuWUb6n06I6HcXxbEzbHXu0UxIUox8+/zSsnwC +pgfbRatMA32KuJih1r+9QA6WOGpVxAkrwYrgOc9pn5peHDVPvKSp7BGVymh9b+x/DRr jOoMUVq2ZE2vB0Svm+riwkXwH0rEroxke6hDC/d0un3MdNJbX7nU40snMuxXf38NKzni Sw== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GDZxl6JoDepuG9C3Qq4oGww9zbFnokk9p2qnMHNiJq0HSZb9brV9yFAcciKGcC9ZV7Olo4w6A6GmIyGJmZ4JjndEkIoSncXz/bq6s67UtPQ502FB26uZkLR1i4nOAhrDPjk88Wrla+Ht91G3mBKk6fxtOpajPcWLjqQgxzcg6ppRXIfo1KhdI6rmtNTvFnqC6BlmCwvqV2JgbfSWEnJrcsZ5Ess3UlbuMCQsIPoX4Ti+5fEpIKK17c9wbIdGTnY6HdtOlIaE6BuZTGkxyWVq+juc28n9nMjtc0zA8fb2yPgRlavV4BFZJ5VRIQvzZU4kC0S1PP+LeLdT/ZNgHS6hzA== 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=ISIUxtMRlIOIJp0TeuSX/VCex3O11KEXuVzJp63I/jM=; b=CGS90I9e2ps5om89uf+N/WlcvZW8yp5o4V92zjPWh6vkmSTjrunHRSoGgwVl4ObD+nPws2Q4GhKiObsFAV76g6wCP08nKmleYwKn+WdC9a9nuRJ25WTav+ORgoznOh1tr9ztrIVm6MRXJdQD0RuRM6lKkcaRicCnF7vd1jIUWQHScuw+eQcTBNSv8aE40/HJk5AE7JXBN4gOb8WyxX3Dnvl0rqwHbJxcGXjaFXU8jngiFboJSClqIy8zWfEVFRTwP+cuxoUXcofunss6xHBkbWlRm7OvTGDWk2Q/bZzpDlk0IFezXxnck+eOTiDruHbpzU/qLgqQgJfqhNoJ5XiRLg== 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=ISIUxtMRlIOIJp0TeuSX/VCex3O11KEXuVzJp63I/jM=; b=puPS4O6BVYFGRVyPLCpK7oFz6w/SNliMI/EGljjM2nYl1Iar/KK7Uwhn2vgM52o+84D7U6zpDy+7rFkkAMc2K91YncFSb8K6DInrYQPFIqLhvJzZKPagCPVgcbm9w0dzzys75op7k+6FrKDRXOdiP+YSOBpTM1ZP7NgklH9wi90GDX8v7hvNyu1LscEzncZNTQDxzjupHgbQRthk6/TmM6v5F4Wn2jxCHT91LnY1CGMeMemlPczTWuDr99LjXS3IKcRf9NSNvSoPs1Kox145jIVur4E2+85540eQdRKImaINk08oOTewGrEdGCgkCWID78YfkaKYFhbmdvmRlP8+DQ== 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 v5 8/9] migration: Introduced MigrateChannelList struct to migration code flow. Date: Fri, 19 May 2023 09:46:16 +0000 Message-Id: <20230519094617.7078-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: a6777e47-c924-4671-f95a-08db584def0b 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: VimLdLSfFyjb6wEQPKAoVHNL3bmGIx1t0dfe2zLK9CUFhpo+XY9fu2Um94MwseEMrPo2j/cAovhpCZRYBzWk2k1MhHA3grEm7woOjgiOLuODWBVxagtSckeTGvmGV5JFFTRsw/PiU1D1rrGpte3TCsFtmatkimGfF4DY1kI2hlUavmXCvGf7GmBpxzN+lELZ6OC+pPYnwYdrYSXOzdErPAE6/hJYWA17lKOPL3xSh8XBykfCb3m7gzNM7QCyj2RJM9K+LLJXFav3h0u5/jSS9+zAFKCz0eiacAFqH/9gytAsUsnD36AOL/w3NDbIFHpspUVzuZgogoidVDlh3di085kVKgV3UzM5KW1YSRH5Gv8eZR5yu78LhSwKQWHH4iTqImMmDemp+0HsqyizyTPHTAMHgnkBS25psn7x/oDCelshbqwslZjBt0IMtkajrDl92hl1OTReeOgmHwjJUoLmeG5ejb0zbsPvpQeXGd/woh+bDxyOzHizclkTv1JO/2oxpuhdBUQFMFdRtOo0EW9DIe2QyVCmJFkBLVruCOYstDPIhsnosYUWQal4IPVsgUF67e1/KpbDXXG158fFqrDhQu8BNlUbjxfVlI9Ty5EUKiBboxzT2U8FzffXDAHzHA0Y 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(83380400001)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ihqXE5maWL7PSZjIs/DA7uWYQfO5mrwwuMZiCVCXNE/CN4tvKnMxJfS8XW23?= =?us-ascii?Q?FiFi+Io0OM+EO1tQGkeCwvNhmJEsc+4Lbw+ydxqLAzydcJ+U8WRgMU0mBHtS?= =?us-ascii?Q?/z7tsffegXkcm/uuXRvxs96ErmHgpuarXeFpu1B/5XB5w1NRBH7QlCMx1W83?= =?us-ascii?Q?nnuDtOARWYzgdyZvjTucOwfNgBdrV6EK08MmUAQSRiOFzdA1dq8CCCMgYOOx?= =?us-ascii?Q?mRjP6GJDcC7URK/cOPytGqi1weiQ3j9sJOFset9IaOp9hefVPOKE6HjEGi4C?= =?us-ascii?Q?V47MmuEmoxO4GUALpk+KOwamgJz5CYjP5lj3RVQtQg3tjjtMJJxUBNv3dofY?= =?us-ascii?Q?xioo6TErcSSvtcXWvXM1ZR/MPTspAG3flA6SHZzF9k49LlddW9xRWdAFtoGF?= =?us-ascii?Q?XefGedplhUwCTL/fm+Dp5Lm/Xjqu1FW2/MrFy6HWZQDKQU2cJJFb/vbvxs2n?= =?us-ascii?Q?Bk86ym9codjqLk6w2Hgn8NYDnVYMI77qcEUajGcca7nEsUl3YEmEXdo0p56q?= =?us-ascii?Q?leaG7vhJJI5ewrNo4SDSYGWKbswT0DMBoV8t7yNUv0c2hZpLtGEGVK9YDuDR?= =?us-ascii?Q?mETQ9g37WvsPlWcAG/md9YhNmP85m9upxN9nZYUklqsuSKd8waj2JKYunH84?= =?us-ascii?Q?4803jpQkpOcNGPgwjMKevIjs6hv5UZbzIGDVKzOn4Jr0D+3Mr6aAomaRLkl2?= =?us-ascii?Q?1CvbPIJZCtwz6XTa0bmXxOBk2HB7sCl/ML7vYP3rJ0LMp3WghzWqyTIocp7X?= =?us-ascii?Q?I+r6a1O8DJdOgI2BiO6JzkfE7FNaCNLlNPE4RV7WwYaSVjaINalnT9Bqije3?= =?us-ascii?Q?KRCcJJJZ/gFrg0B4phBmzrvWULq5Qowe8j+5Pv2mjHOETLXazvk8T56m1aLZ?= =?us-ascii?Q?jE25FsFtxQQ//UuaLg6K8WWWq7WkDgBnJ5g+3IMJps90koRNWfHNg3iqdTkA?= =?us-ascii?Q?8LY3rV890j/j4k+NcWwKtmDix6hAnZUDBYp7YrmvLmMbMWvSw7EQMuSYZx3l?= =?us-ascii?Q?hC09OgPVdMi3FHaTY9GRcr0k2mbZ+SRDyt+vCXL29mVsi0bSVl5WYULuY5EW?= =?us-ascii?Q?IhXwRp39M2uY5cFUc1sniBeJZ6AJ3X7zGncTMk0rgfjDRwwkFqXnwwWdd0ys?= =?us-ascii?Q?vdyvWwO+iZuEfzaJ+TZU3B8YFM1aHbozTVffcyxe9sxIcDF26qJf8yndxisQ?= =?us-ascii?Q?02hwjiXhX+0V6qBD+RVzahYlOyJqRVreKjSBRZn8YJdtBFJdhWx8goNCHBDt?= =?us-ascii?Q?NzpGn8ixcPTiFE2ukfC8Fa/xH3eMzQXAdMPXN9Ea1UZRv/ww1Fgci/hHRi05?= =?us-ascii?Q?cue9VOSXe2Wb7+KaQ2gBvisHA7Mfbqn7MyTZDjmAYZaobbxjSlyTMTQVWsOi?= =?us-ascii?Q?1zFSGSRf91FsKIDX8kVSziuUggl3CPtffh8MnSgMY0kazd8OT5rmWWA7jHdq?= =?us-ascii?Q?Jmmyoz8vPSsHJ5yLU4ovIM2PPXrlKyOpf5DoRMcXH2gWYE4zRYrvhZL43q4b?= =?us-ascii?Q?zcreD6184Iz5XH0EW+OIamPM0NysL1Sk8Vz1+gNwkjL9r3MZH7Hpqtg32C/X?= =?us-ascii?Q?AdxaKGFZY+H3AAB3MecJXZdG5RxkbxTgGxUMY45O?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6777e47-c924-4671-f95a-08db584def0b X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:35.5109 (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: Nwysd1q03YXIq0Znx0ckWv3IeyXm4W5Z57sSrXhnemRFLlNMxajgPJ/m/NOXUV/Os41jYXl632KP/bD7BIYWNg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-GUID: xgmAJLvsx14-6ltS9YDJkbkL3ww_g6Nf X-Proofpoint-ORIG-GUID: xgmAJLvsx14-6ltS9YDJkbkL3ww_g6Nf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_06,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489644518100001 Content-Type: text/plain; charset="utf-8" Integrated MigrateChannelList with all transport backends (socket, exec and rdma) for both source and destination migration code flow. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- migration/migration.c | 75 ++++++++++++++++++++++++++++--------------- migration/socket.c | 5 ++- 2 files changed, 53 insertions(+), 27 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 8afdea4f91..57085753f4 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -424,9 +424,10 @@ void migrate_add_address(SocketAddress *address) QAPI_CLONE(SocketAddress, address)); } =20 -static bool migrate_uri_parse(const char *uri, MigrateAddress **channel, +static bool migrate_uri_parse(const char *uri, MigrateChannel **channel, Error **errp) { + g_autoptr(MigrateChannel) val =3D g_new0(MigrateChannel, 1); g_autoptr(MigrateAddress) addrs =3D g_new0(MigrateAddress, 1); SocketAddress *saddr =3D &addrs->u.socket; InetSocketAddress *isock =3D &addrs->u.rdma; @@ -462,7 +463,9 @@ static bool migrate_uri_parse(const char *uri, MigrateA= ddress **channel, return false; } =20 - *channel =3D addrs; + val->channeltype =3D MIGRATE_CHANNEL_TYPE_MAIN; + val->addr =3D addrs; + *channel =3D val; return true; } =20 @@ -470,7 +473,8 @@ static void qemu_start_incoming_migration(const char *u= ri, bool has_channels, MigrateChannelList *channels, Error **errp) { - g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); + g_autoptr(MigrateChannel) channel =3D g_new0(MigrateChannel, 1); + g_autoptr(MigrateAddress) addrs; =20 /* * Having preliminary checks for uri and channel @@ -480,20 +484,29 @@ static void qemu_start_incoming_migration(const char = *uri, bool has_channels, "exclusive; exactly one of the two should be present in= " "'migrate-incoming' qmp command "); return; - } - - if (uri && !migrate_uri_parse(uri, &channel, errp)) { - return; + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel =3D channels->value; + addrs =3D channel->addr; + } else { + /* caller uses the old URI syntax */ + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + return; + } } =20 /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addrs, errp)) { return; } =20 qapi_event_send_migration(MIGRATION_STATUS_SETUP); - if (channel->transport =3D=3D MIGRATE_TRANSPORT_SOCKET) { - SocketAddress *saddr =3D &channel->u.socket; + if (addrs->transport =3D=3D MIGRATE_TRANSPORT_SOCKET) { + SocketAddress *saddr =3D &addrs->u.socket; if (saddr->type =3D=3D SOCKET_ADDRESS_TYPE_INET || saddr->type =3D=3D SOCKET_ADDRESS_TYPE_UNIX || saddr->type =3D=3D SOCKET_ADDRESS_TYPE_VSOCK) { @@ -502,11 +515,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 =3D=3D MIGRATE_TRANSPORT_RDMA) { - rdma_start_incoming_migration(&channel->u.rdma, errp); + } else if (addrs->transport =3D=3D MIGRATE_TRANSPORT_RDMA) { + rdma_start_incoming_migration(&addrs->u.rdma, errp); #endif - } else if (channel->transport =3D=3D MIGRATE_TRANSPORT_EXEC) { - exec_start_incoming_migration(channel->u.exec.args, errp); + } else if (addrs->transport =3D=3D MIGRATE_TRANSPORT_EXEC) { + exec_start_incoming_migration(addrs->u.exec.args, errp); } else { error_setg(errp, "unknown migration protocol: %s", uri); } @@ -1698,7 +1711,8 @@ void qmp_migrate(const char *uri, bool has_channels, { Error *local_err =3D NULL; MigrationState *s =3D migrate_get_current(); - g_autoptr(MigrateAddress) channel =3D g_new0(MigrateAddress, 1); + g_autoptr(MigrateChannel) channel =3D g_new0(MigrateChannel, 1); + g_autoptr(MigrateAddress) addrs; =20 /* * Having preliminary checks for uri and channel @@ -1708,14 +1722,23 @@ void qmp_migrate(const char *uri, bool has_channels, "exclusive; exactly one of the two should be present in= " "'migrate' qmp command "); return; - } - - if (!migrate_uri_parse(uri, &channel, errp)) { - return; + } else if (channels) { + /* To verify that Migrate channel list has only item */ + if (channels->next) { + error_setg(errp, "Channel list has more than one entries"); + return; + } + channel =3D channels->value; + addrs =3D channel->addr; + } else { + /* caller uses the old URI syntax */ + if (uri && !migrate_uri_parse(uri, &channel, errp)) { + return; + } } =20 /* transport mechanism not suitable for migration? */ - if (!migration_channels_and_transport_compatible(channel, errp)) { + if (!migration_channels_and_transport_compatible(addrs, errp)) { return; } =20 @@ -1731,8 +1754,8 @@ void qmp_migrate(const char *uri, bool has_channels, } } =20 - if (channel->transport =3D=3D MIGRATE_TRANSPORT_SOCKET) { - SocketAddress *saddr =3D &channel->u.socket; + if (addrs->transport =3D=3D MIGRATE_TRANSPORT_SOCKET) { + SocketAddress *saddr =3D &addrs->u.socket; if (saddr->type =3D=3D SOCKET_ADDRESS_TYPE_INET || saddr->type =3D=3D SOCKET_ADDRESS_TYPE_UNIX || saddr->type =3D=3D SOCKET_ADDRESS_TYPE_VSOCK) { @@ -1741,11 +1764,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 =3D=3D MIGRATE_TRANSPORT_RDMA) { - rdma_start_outgoing_migration(s, &channel->u.rdma, &local_err); + } else if (addrs->transport =3D=3D MIGRATE_TRANSPORT_RDMA) { + rdma_start_outgoing_migration(s, &addrs->u.rdma, &local_err); #endif - } else if (channel->transport =3D=3D MIGRATE_TRANSPORT_EXEC) { - exec_start_outgoing_migration(s, channel->u.exec.args, &local_err); + } else if (addrs->transport =3D=3D MIGRATE_TRANSPORT_EXEC) { + exec_start_outgoing_migration(s, addrs->u.exec.args, &local_err); } else { if (!(has_resume && resume)) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); diff --git a/migration/socket.c b/migration/socket.c index 8e7430b266..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" =20 struct SocketOutgoingArgs { SocketAddress *saddr; @@ -114,12 +116,13 @@ void socket_start_outgoing_migration(MigrationState *= s, { QIOChannelSocket *sioc =3D qio_channel_socket_new(); struct SocketConnectData *data =3D g_new0(struct SocketConnectData, 1); + SocketAddress *addr =3D QAPI_CLONE(SocketAddress, saddr); =20 data->s =3D s; =20 /* in case previous migration leaked it */ qapi_free_SocketAddress(outgoing_args.saddr); - outgoing_args.saddr =3D saddr; + outgoing_args.saddr =3D addr; =20 if (saddr->type =3D=3D SOCKET_ADDRESS_TYPE_INET) { data->hostname =3D g_strdup(saddr->u.inet.host); --=20 2.22.3 From nobody Sat May 18 16:46:50 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1684489706; cv=pass; d=zohomail.com; s=zohoarc; b=hjXEJ4EmKA1tYBP9vUzVcJaaxulK5kUjpQAp4BdaC1HoV05O+Ap3c2Wc+s7znaMNf6OI2+t0Ku6KvbMc9xq9xzp6zBpj6XMfenCFh5Bt44s/oMYm4+2yD9gePqHzOoCNBXeT4e172D64QlPRI9WYM/nBoRymPN/DKo6HDlYNVPc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684489706; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WZHyegdihqSgcUIZLMoRoLOBn351tr/V+Ov5iI36Abk=; b=Bj//BIgIa3vIAz68QjOhFbcAnmoQTKrveJTBs55ILA9YgilKPfLeZSmAdcM/6lEdDJjx+leWD/r9fjEaf5XSE/4uQl5PKFtGNZjhWMPt4JUDk6sMm8wpeX0/JiHgovAyVAstQl+Vy+df9yCk1LgkoS2tJ+eChordzw0cqzOtvTM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684489706143995.9614246263163; Fri, 19 May 2023 02:48:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzwhE-0000E1-DE; Fri, 19 May 2023 05:46:48 -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 1pzwh8-0000CC-W0 for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:45 -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 1pzwh7-0008Sw-2W for qemu-devel@nongnu.org; Fri, 19 May 2023 05:46:42 -0400 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34J923xu028216; Fri, 19 May 2023 02:46:39 -0700 Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2177.outbound.protection.outlook.com [104.47.56.177]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3qmw97vjcb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 May 2023 02:46:39 -0700 Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by DM8PR02MB7912.namprd02.prod.outlook.com (2603:10b6:8:11::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 09:46:37 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::4500:569:a3d6:71c9%7]) with mapi id 15.20.6411.019; Fri, 19 May 2023 09:46:37 +0000 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=WZHyegdihqSgcUIZLMoRoLOBn351tr/V+Ov5iI36Abk=; b=fmxolm1be8F8VItX90FH9ZaF3EX+p9A7CkqIvdRzVJGDzMEryo6IQQmvbfaXEWJtGyaq RbPzhJYi9rwuwpINZWboJQsbsD709wp/LpJkllNAtXLEv9hnFs6uQ+jjEEKnSaZEn79D yQQi738DIXW1oYDupX+6UbqtY65LH/bGR94GR+KqgEcnDU3I9BwxQ7s+aI2LEKOM3sx3 duamwOEjqvj5oBH71tDrVLVQaDWtsK2wTyD18q/vcF7J5t+7UQNXTlwU2cewgMRXO7KH q+0GKNFBSvGSzMmZ1ROIcMfh5Ft7yFjoDRpcoGSOuZ/D0zdJrbZyxxC5HzaXmZbwJaDm lQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KhzrO30CA077J2tQasV1zoBnYjLrjjaWkPWJZCxlMOI3VOBhbzyME9UAyDm9VkSvo3l49wH9pOzdp1G1DBxFSFACLxlzZi4eMZMc+3Zydfe48zXf9cnLvUDWEdR0YG2vffQsOSrDR597Km98WqJq0HxFQ61QBdegMlAgNnlHIGr9bOzSjQHLIvESB3NtAeXGmeWAQWPVUhf9N6GKjayEcd6RfK2MZDZOyntmxd8krp757b1XDlzkjHsC4OdiHBo5ZLU5ybV8rHLnybWOGKl7lJ7jHJnRR0la2SyM4XfuSQcTSEaLYK16OTbl4NmiPeBCoCUac3wB4UQR6r8OpFpC9w== 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=WZHyegdihqSgcUIZLMoRoLOBn351tr/V+Ov5iI36Abk=; b=LzHumy4oJ7UikdiuOVCCitWw6CSHE3cEHMSLzDTzMs5XzPU+g0/DHdprMEC/+TxwTD/cTqhvhTxS+2MXJPdoWny17w2XuGZ4PeoR24V1jeqov163fuS4VXNtAlsaWhxz5IiH6b98RU2Dc9ITU6+l+93mS3PfGAuGxKTxwV1P+7FWdjzmZ/DISRS3tU9xuYsvxLCdnQTfOwRE1c9RNMNXvsYDIrPbnwDzjzBObZ7w2MKYbW0DamH2ei6RhDSKVRWy25YFoWO9byfdUVUX+1A4nL/+syAw9EGpfNrytM5Ok1tTOYsMYDs52fAflLdYgjcMocIE93r4sHA3R6KhxJ5kqQ== 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=WZHyegdihqSgcUIZLMoRoLOBn351tr/V+Ov5iI36Abk=; b=PfLu0zI9v+Gaa4yUus/AG2qkxcNOboDP+37/0tQ4Qkd8ZAxkeSuVE1xpfAaIzibdC2njEmVUM5Zpa2p7V7euKMramj3LxAlgA6t3kXGaQwU6UfugPQvfzjedv/WHXNFwWkJVooEHHe3qU8GX5LSoDLscWU6ySkzt9FoHAamRH4xg7SIjC5YsZlXqkSTiE6ZJVWMz3haT50sBFd7AlHsoWDay6zKsPXpaXnhV0Z8j3vTsZlLhgjARDEnJJOjOC/KdSacbWf2ldvLjGZEnCx2bCYjerVXtIVpuS4KgvznDtJRjvPCVw4ws6ig6kvLSh9XG0JBte1BwjBDIZHRsh5mmsw== 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 v5 9/9] migration: adding test case for modified QAPI syntax Date: Fri, 19 May 2023 09:46:17 +0000 Message-Id: <20230519094617.7078-10-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20230519094617.7078-1-het.gala@nutanix.com> References: <20230519094617.7078-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: BY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:a03:180::44) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR02MB4343:EE_|DM8PR02MB7912:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bd5267f-ee89-4328-a571-08db584df084 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: KocDfK2IEK997sMX/SXRYDIhzKrDNOjfo3AdObNyYSs1HNpwB8kzQzZqdIrzxOdrQ1L7bhcpPBGLlwj7YBzxihwnde/3jPyB+qIXCT9VzTaU0GZ3CBYGjJ9WRACCyN2qpEpDENasslGm439vIZyXDrHu9y6cQZKc3TN21r33mNjJ0x4+11ig/2zYigIfKcfYprPXCsoG7tYuVkc5V/GpBYVupiNdXtwMdyc1tW5YfcQH0n7yaWJLKd3/xxGYFRDa3yiYugyf9EL/Fh5xVQfLWo2RsPgws8+zmUcIBnYqsoADvwvAJYazOWbGoWMTpgHOCga5IE/vpqkVNIOh1RZuYLOGQ4jtflgTUf5YxmxjnnC+kE5YFzlW3hVF+nsUXmFO//e3q/iqvr2wrQXZRZAQPIUcgVfycd4P5Yi6XsbPjvOwG9HSMJI3+rdXZ4sCcf76f+90cvapdOdykijn26qvfLQ+WvYS3F1Hmq8SQ6CorobuyaYrEv0VPAtK+7Te0mqqm2XASD4MvFay8nbaPLpnD4CtwiP1/07WtF9RqEldbnVmTiAtBPtfLNBhBzb1FH+oTpHcF9dYUto1JvLN3nZblrEAfPSjHBFBsBEoQ7p4Bkfm20AXM4tmtCQsT99t9F0o 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)(39860400002)(136003)(376002)(396003)(366004)(346002)(451199021)(36756003)(44832011)(8676002)(8936002)(5660300002)(316002)(41300700001)(66476007)(38350700002)(4326008)(38100700002)(6916009)(86362001)(66556008)(66946007)(107886003)(6512007)(6506007)(1076003)(26005)(2906002)(186003)(52116002)(6486002)(478600001)(6666004)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YxQhU8bgGE13T/Jlf99tLcGIE1XzX1heq4rt/KhJRUMHPPQ4eCEdsGnUJ6te?= =?us-ascii?Q?IglcJXpRRUsbK0cA7KW2/e/+EurNPJgOWgsr2IRn8Xz0TtI6JmQt611uXXAR?= =?us-ascii?Q?Ko0tUQsi3wAvFiyYDf0Q50n1cFRt2HKkc51YOsJzBsE0qAPwsBFpRO9Ezla8?= =?us-ascii?Q?fUaRY5fKvYayZiy0Ro03CybtvTClvXJtlXtPlR2lhYuz7fjRe1UP5ZW/D2H+?= =?us-ascii?Q?QmZA0TRor5Y/Bw25AVpsiELGYWNT0dqhkrZcA57xBs9M6VU1J7UuKIEkt0C1?= =?us-ascii?Q?XhQ+/wZLrFLyoFAo+m9SN78sSotWeDM3bYHkPeymM9kb5+UIpAmzuhQ2ENL6?= =?us-ascii?Q?lGQt9dAhscy1GetjqLncNraVQHHbfd4hcRC6qizX52DdlQVNO4pQVG6cRmI9?= =?us-ascii?Q?ieTeBRBjR/Ifx+q9jtRn1sAW21bPOxIMypFNfn4zHNQXDfJcIRTx956y/IqD?= =?us-ascii?Q?bSMI7sR10a+OvjPv8Dyqi1lpoDAJz55l+RMpJXw0s1jwtTBwGcJDGr5kq/Kl?= =?us-ascii?Q?R5CT0qnLohgtU3BMcEXGefjVZ4CTOJDhafP/fx+ZAouXYSyqYtJKBWBbDXdT?= =?us-ascii?Q?1HOS4VRa6nQDR4LEVMny/fN1xdWuXtnjUypt1vASXrMCrJaR/IrE14ig6umx?= =?us-ascii?Q?Lw+WJt5r2RCv5zd53thvrIcoPF3HrJ1atkPvZwV19T+p2oRG9G2Mv8SAjLxN?= =?us-ascii?Q?IODqmEQlmYb6hv9NiCrCy748WO9hwRssDaLneKRRv5CgmP6RA7NemA3YAhd+?= =?us-ascii?Q?QXMMN/NsiwBl/RZ+t3GMW+nc0EduLGr6a0RhQEtHr3sTTSORvHr7tVHI9uiw?= =?us-ascii?Q?7jCgtOBDlqlR3wGKbv8sgnhFVuP3QMEcbHvWhdbnQQwyDdCee5j+2ke17r+u?= =?us-ascii?Q?0U0KIJ7u3Scbhih7issKJzS9qbflprQvv2eLFUZp+LQBhlBZC4A6fINeO743?= =?us-ascii?Q?7nkyTNPoSytmYU5WohcbRo6vemU787H3D6uokYWAq7V9OEe3rW3cnwr4ukE+?= =?us-ascii?Q?DHXAIxHcJy6sFogb4Le9siLG6/qH4+L4unTfSlZbhXmbZHWeyrXmrN+eefa5?= =?us-ascii?Q?Wdtl+vT4xuJ392sOeWcpWkzYqANzN8fWZ72hu6hQLtKkqJ3orYqZ1n/A8vWU?= =?us-ascii?Q?SMbT5ngUKwPQcQeOhfpQB99neMexLqjblSA/7yV7FrdTgi1BODP7MovFxYAJ?= =?us-ascii?Q?u8QrITLtkL1OElOLtROBDHoltASW6oODyoThhZPJCc6Mz5EOcoN5yPKOC+vC?= =?us-ascii?Q?4gdwc/LafijwmL9fxDaUBhg02uV7KZIA8AX2EEdYyyKNj4NsPVuQraMq8HKt?= =?us-ascii?Q?Vu3Q4dbDHGm30AW52DmeLsM1X+SkmoOJ5Tl788Ni9EVIxjmmVpUkiOf9Phfo?= =?us-ascii?Q?d/UqLowWVas+0UzykBKgumWxsDVhn1EkJyCzPEZ6W0iVDLORJrtksU9LMQu9?= =?us-ascii?Q?v1k1vURNkw6b6hRZEPukavTMwCsEC4OMuK0GOZyOIyQnGRw16OG8KRnHKeCM?= =?us-ascii?Q?3tLB0TIUvdBXv+JW7Q7q4LxErvgR686T6Y9o3mJy2ILWKHfe9Oe/CRc+1IfG?= =?us-ascii?Q?gIIlIS8+4z+tnfAnM5hgyms2m8O3WsKN4OgBlGPo?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bd5267f-ee89-4328-a571-08db584df084 X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 09:46:37.6592 (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: pxm07RBvXNA4R4nSfgkT57JUBOdThOS6TUgSfryGeJ+iXO9r0zArEAPQEqHd0+SwCqVjh93XctfD4tqXTPaGvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR02MB7912 X-Proofpoint-GUID: 8z35C9Ypm94aPirWXa3Y4bLYPhtHBScq X-Proofpoint-ORIG-GUID: 8z35C9Ypm94aPirWXa3Y4bLYPhtHBScq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_06,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1684489706956100008 Content-Type: text/plain; charset="utf-8" Adding multifd tcp common test case for modified QAPI syntax defined. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala --- tests/qtest/migration-test.c | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b99b49a314..ef6f9181da 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2021,6 +2021,34 @@ test_migrate_precopy_tcp_multifd_start_common(QTestS= tate *from, return NULL; } =20 +static void * +test_migrate_precopy_tcp_multifd_start_new_syntax_common(QTestState *from, + QTestState *to, + const char *metho= d) +{ + QDict *rsp; + + migrate_set_parameter_int(from, "multifd-channels", 16); + migrate_set_parameter_int(to, "multifd-channels", 16); + + migrate_set_parameter_str(from, "multifd-compression", method); + migrate_set_parameter_str(to, "multifd-compression", method); + + migrate_set_capability(from, "multifd", true); + migrate_set_capability(to, "multifd", true); + + /* Start incoming migration from the 1st socket */ + rsp =3D wait_command(to, "{ 'execute': 'migrate-incoming'," + " 'arguments': { " + " 'channels': [ { 'channeltype': 'main'," + " 'addr': { 'transport': 'socket'," + " 'type': 'inet','host': '127.0.0= .1'," + " 'port': '0' } } ] } }"); + qobject_unref(rsp); + + return NULL; +} + static void * test_migrate_precopy_tcp_multifd_start(QTestState *from, QTestState *to) @@ -2028,6 +2056,14 @@ test_migrate_precopy_tcp_multifd_start(QTestState *f= rom, return test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); } =20 +static void * +test_migrate_precopy_tcp_multifd_new_syntax_start(QTestState *from, + QTestState *to) +{ + return test_migrate_precopy_tcp_multifd_start_new_syntax_common(from, + to, "none"); +} + static void * test_migrate_precopy_tcp_multifd_zlib_start(QTestState *from, QTestState *to) @@ -2053,6 +2089,15 @@ static void test_multifd_tcp_none(void) test_precopy_common(&args); } =20 +static void test_multifd_tcp_new_syntax_none(void) +{ + MigrateCommon args =3D { + .listen_uri =3D "defer", + .start_hook =3D test_migrate_precopy_tcp_multifd_new_syntax_start, + }; + test_precopy_common(&args); +} + static void test_multifd_tcp_zlib(void) { MigrateCommon args =3D { @@ -2736,6 +2781,8 @@ int main(int argc, char **argv) } qtest_add_func("/migration/multifd/tcp/plain/none", test_multifd_tcp_none); + qtest_add_func("/migration/multifd/tcp/plain/none", + test_multifd_tcp_new_syntax_none); /* * This test is flaky and sometimes fails in CI and otherwise: * don't run unless user opts in via environment variable. --=20 2.22.3