From patchwork Fri Jul 21 14:49:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 1810966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=proofpoint20171006 header.b=eYQBm+Zv; dkim=pass (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=kOKmwCa9; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R6ssf3RDGz1yYm for ; Sat, 22 Jul 2023 00:49:58 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRg-0002ej-HV; Fri, 21 Jul 2023 10:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMrRf-0002eT-3Q for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:27 -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 1qMrRc-0004jg-B6 for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:26 -0400 Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36LBrkwg002308; Fri, 21 Jul 2023 07:49:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:content-type:content-id :content-transfer-encoding:mime-version; s=proofpoint20171006; bh=/Evv5V+WWG2T2oOTO5Wc4QFgvTOfT8VC7OyaY2z5CXo=; b=eYQBm+ZvUMbz 5FkBux8WUmJCoIzGJaHSBV0xafvcPfOeCQtC09tVJXxYd7Fvp2QECi+HjRXEMHNl tBDb/Q7AO+PQdTu8rhbp1oy8nMscNh4hd2jWnMHQajH+40AiRzUJmJDA3n6ChGGo MgZUYOInhvsa241cv60suHnemRaNdjsk/+VKqoypUnclhJhwBv6np18jb+JE9o1P cNfiJyPNQ9uX9OKVOjAxWt6XfSBD5xFK+Ww+/0DZZlFYyEFxKj+bVVFgw/oCBsnW jForx8PAo2QQSZBUqayMJMG4v0tTI/QFE7BU6QBdf9bmuhRpB7gLKu4sfGpP0gqC eTAaMLUNpA== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2106.outbound.protection.outlook.com [104.47.55.106]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx3fmxgex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g5r9Y4YKJ5LfncM01fwkaciApFjW/ygTlTT1QIUU2S/IUWpJ0ORkMhGVCJwTXmSkSBgUtviggaSxF4Hy2eHy/0wJgftuGzUNHU1H6Zf7t+xNKK039G1UPqPrNmbKA9HQLebkHGQ5c9B7I6fmc7LFHaD055jZdIxIdyGDiY/7pnrxqLKyfRGi2fLso7XrIgfKMg9N4nPvID8n83z1SZvFkTVtHWbHq0EyGepiz4l1/p42+YNZitDJLCLngyGaQ45X//tdRYEW0oeZXz2hp3FznXoaqsnhjhrOvHpjZ7R33EQSeRopDQmvx8Fi+VELXdaBe/+ojDm1fawsOAT4Gksu1w== 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=/Evv5V+WWG2T2oOTO5Wc4QFgvTOfT8VC7OyaY2z5CXo=; b=K7ChnV+oGWF0aOICRDwx/GqlkEeTHQBko15FiJHmFoJ7WGCRLo+16VU/eWNLZ/1zpirPFhbe01Oc5JRSu8rQ6nOeaoLwpQvKno9JMeFX7X5bM2iZcel7DgBQA3g1XbmuGu1Sm7kHyzWHLBWJlwCPIV81hAs88dUG+PZG0lMWRlaYZSm7Rr+IUg7DFSi09FTeVY+V1kQbLkkaaca2sjJ3+wuwq1eFhSzRsR4sQdqqlpnOVQ+zxaBHH2duR3f7BxPisEuuavAfVn4FTSI4DL+wAQWsyyUh9ZJg+CYi7VcOMIez4uuofhMgWgq4R+whfWmGv24NUhj4Ok529uEhPvSJKw== 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=/Evv5V+WWG2T2oOTO5Wc4QFgvTOfT8VC7OyaY2z5CXo=; b=kOKmwCa9e+odNXfAcDekjOfqQqdFZHLR8DWVrx0szuxT65VEWM+uiQePoTBlxE+j1RkXsdOj2HAZsFZJ6f1W+vjiI32AFKwUJqRyyAGB9M4Wd3zIEh2eW+pK/2lPxmrwcPCcGQXeJx8mgh5a+1Oh/QrOQcOQAP0Mlf6Cnt4qTWDCx+i3rrjdSEZBbM0k50ycf0Vyt+h1wqLdVuy5MBViOa+YWkHPaKRfw5GD+jEzyvXwZ53QKAX5GPUKHVvlS+8CA3Z6U6IjdhycuszPuI3Wy2zRZDIn30NKMDiXYWvMVmGJwAz/zK4McD2a2RjFgb9UGQThTHBOZO394erQ5Q5USw== Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA2PR02MB7561.namprd02.prod.outlook.com (2603:10b6:806:140::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.24; Fri, 21 Jul 2023 14:49:19 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::89a1:d75c:813:618e]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::89a1:d75c:813:618e%7]) with mapi id 15.20.6609.022; Fri, 21 Jul 2023 14:49:19 +0000 From: Het Gala To: "qemu-devel@nongnu.org" CC: Prerna Saxena , "quintela@redhat.com" , "dgilbert@redhat.com" , "pbonzini@redhat.com" , "berrange@redhat.com" , "armbru@redhat.com" , "eblake@redhat.com" , Manish Mishra , Aravind Retnakaran , Het Gala Subject: [PATCH v9 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration Thread-Topic: [PATCH v9 00/10] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration Thread-Index: Adm74odMJpnQKwO+s02xoTRypXkLxg== Date: Fri, 21 Jul 2023 14:49:19 +0000 Message-ID: <20230721144914.170991-1-het.gala@nutanix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PH0P220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::17) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BYAPR02MB4343:EE_|SA2PR02MB7561:EE_ x-ms-office365-filtering-correlation-id: 19c863b7-fedf-45c6-dd8e-08db89f9a9d1 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: A1HyuKaDwE5YDgIIX3KsA5QwtcTb6HM3d6gh8V7ywIy8xiTBc1fjbIr8lzGNmcPIbO39dlE6H0d70Xxr8j3fRzAQBPZjtuVecN5r3Xd8b1QWt+WGbJG38F+SMQVZizGFQzc7ArVTrOOBi3KvewvOzos1SJs+87OKjetYsJZyG8Kvq2TzALTng55PFXSndQnMiIqBuK6rue8uHxoWos+TQ99Ixq8cvUZi3OdJJLK/MpD+wFw+A5Md0zhoqC7i646abMn19teHYXirP1jnczDfDvZbyPHiEO19nlgf7u0bkDydlsP/SKb0VmRdixB5i4KfcWCjpviUg0b7hfxbEcQTEA0mjTg5T2qry7A5/dkD4BuulAKuoD6UBPrM+l+7nvj6mGChw1dbyqs6Ku0VhV7CDnalAzN3zkvENaRzb+RRv2s+ZRaVjEidFSiz3xop+Hqvzul+Q8pETkzF8MfltcLiN1zH5l2A6KoiIY+73qm/7Ri5h8HxvsBkXe55PiRX8d8VxT2BzFv34krOB2cwoXGvqOYHnnQKQLf++zwXRjstyo9kypYfLEoOKj6MZ+L4gBkZbLALH8C/CiFy5+/GlfghSq4ncVORYGr0O13TXaVz5lTKZZqenqy4wEq/bdPWfKmIDII3W5ON+ACBRmF/evvl1A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(39860400002)(366004)(376002)(136003)(346002)(451199021)(2616005)(6486002)(52116002)(966005)(6512007)(71200400001)(478600001)(86362001)(26005)(1076003)(107886003)(6506007)(36756003)(5660300002)(4326008)(44832011)(6916009)(41300700001)(8936002)(8676002)(316002)(2906002)(122000001)(38100700002)(54906003)(64756008)(66476007)(66556008)(66446008)(66946007)(38350700002)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?8lmAyxMHkZRXm/t3+M/bLE6X+emr?= =?utf-8?q?Ptyqamm9Zu8qJqwTAeNq+Xb4g8Has7011SgC1YxHtdR71dbL2DjDxcrQ+Idvbbsud?= =?utf-8?q?8nPwuIE5PKxfmIhjCH7ZtoDA3eIPX+8Bc6YClvHOTg2N7CplT8GW619gE1ugLhFmA?= =?utf-8?q?hCekwlH6nuRwS7bkFGInHr3WUfRS9PmiTiF1m+Wp3N8agORDnGYGup1W89cRxIqZY?= =?utf-8?q?d1NrswMbiwddyXtdoINPQWUJqEX9F4UvZGf7dei1mdfopvaO/60DSehrI235CqZ8H?= =?utf-8?q?gHbwEu6vytDZs/yOj7yvefDld7OQ5kC0NnSnfeexRiGpxOIiiPVyTPboZRFDaZbAo?= =?utf-8?q?BNVlaMeuxmXba8XsU7N57VacBa4jawTDZ3NMFar8y60XdI87ldaNXulZgS+s1qmeS?= =?utf-8?q?6ApbX3h7fvgQYmvcnEAHaIxNN3smWdD5MxWu3DrxVos1k9O6TcPmjlUpTKVZTUuw1?= =?utf-8?q?7r5vBCR5c3UhrVCGgQCFsp74DKLCWOpNWv4hJiPGGaIZK6kDblOkNfjw04TDKlBhe?= =?utf-8?q?SX6QCKghHz7B+OS5gAYQFY6h2+CVgxgsz3wemjvswpPdY5Ywpd7QlDMFBtfwjA/8+?= =?utf-8?q?7FAjtnExvzpFe+8v6yEcQilsiaOnrpyPf327O00+nC0w04YwV1Hida3S28M66f1J7?= =?utf-8?q?ReSb1JC4gv+VuU6G4fjdNTlBiHEzR4lqHHtgXOW808zRuSFefufZEP9dkdibEoxGZ?= =?utf-8?q?cIhhCyzQc0tlgwvk0sdObR1IbiB0No+OKCBixlQkL2gdXxEqRqt8h6CPdFKUQYUUp?= =?utf-8?q?6h4JiB5oTMZCfy7SOIjMR5P5eO5t9BJU3QKOR7OkFG8O4l/leyTKqy0G/oYIvEnyF?= =?utf-8?q?qFosJICrXqqHqZIzNWE2Mn81T/NGB9skfGghCyK3jA7WVMt17vbBVM2n0Yyr4yGse?= =?utf-8?q?14nCh4AaNOIrcNrgr5NUq8qDeP9Xu2BLMr00WjZQSko8vgHur/RIibQAk1bUpEGAm?= =?utf-8?q?JIwBaUpIfpz+xISnhfXLbHYVemKFgvKqeqn5o+Eu46wmsHSVp21awxmyM/Ft5uPFG?= =?utf-8?q?P8gcyxJk36xdUWgofPzq42G+LwQvaikQAgt5uqxEaXlJ64/+5XEs+btDRzKuHqSGc?= =?utf-8?q?yuXxyYpgLK9Zx2QJn5UXkfClDqc91iDR6HpvPRXnTSKCTPg68OcXGNUF8bx53ispM?= =?utf-8?q?Qr9QWCNGJfybvjl54msPt+pPlhLs1b8o9qOBdJNt5Z6G4v4x8dgD4lcLQsLWFr6bJ?= =?utf-8?q?odTCKgViAFEWCpnFmkcnuURchMSBr+gWSD2rQ2oa2ruTc9fvqhedY/AwmzmlFeQwP?= =?utf-8?q?VTq4DDY/GO1wgvZ7VGp43soUoIDcMy8BPB8lYri/erPMuveIoiwDtYC/IVVCPtXdM?= =?utf-8?q?bGtxf9Z6f74Su5v+qCMoqFKvQsevmroh1OXkAgwzAXknHzNBvRA4DvU5UhSPAIHl3?= =?utf-8?q?wYloe2xWC4/2xiZ5BJMYnjbyYsKmLnINILX303+hl916SigCOrn+G1sCiI1YzrXp4?= =?utf-8?q?8sro6DMd8yhIhJjYlKclANQ28PNNI6hnb5zkb2iwX6BOQ+pIcnqAM+Br2jX+PxxCt?= =?utf-8?q?AgeTjWYQciv9wDMqRtixV+hcFbUmOg3pkA=3D=3D?= Content-ID: <9A66623FB8444D4FAA747D826884EB68@namprd02.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19c863b7-fedf-45c6-dd8e-08db89f9a9d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:19.1458 (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: lcs/BpW9z9/ZEe1W4Lpvd+cY1OqD3Q9XgoKY/pJREQptHwkcDGXz63U0ASvl7c1ly8giw4N+lur9o9EW1kM6qA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-ORIG-GUID: 019Anx_-X_8uVfMHPuXrz1tTvN_an-JD X-Proofpoint-GUID: 019Anx_-X_8uVfMHPuXrz1tTvN_an-JD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-21_09,2023-07-20_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is v9 patchset of modified 'migrate' and 'migrate-incoming' QAPI design for upstream review. Would like to thank all the maintainers that actively participated in the v8 patchset discussion and gave insightful suggestions to improve the patches. Link to previous upstream community patchset links: v1: https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg04339.html v2: https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg02106.html v3: https://lists.gnu.org/archive/html/qemu-devel/2023-02/msg02473.html v4: https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg03064.html v5: https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg04845.html v6: https://lists.gnu.org/archive/html/qemu-devel/2023-06/msg01251.html v7: https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02027.html v8: https://lists.gnu.org/archive/html/qemu-devel/2023-07/msg02770.html v8 -> v9 changelog: ------------------- - Patch1 : changed the qemu version from v8.1 -> v8.2. - Patch2 : changes for WIN32 regarding exec command. - Patch6 : Split qmp changes from hmp changes (Patch 9). - Patch8 : QAPI_CLONE of SocketAddress defined eariler in Patch3. - Patch9 : introducing migrate 'channels' in HMP, and change in implementation from earlier patch. - Patch10 : modify existing migration test case with new QAPI syntax instead of adding new test case all together. Abstract: --------- Current QAPI 'migrate' command design (for initiating a migration stream) contains information regarding different migrate transport mechanism (tcp / unix / exec), dest-host IP address, and binding port number in form of a string. Thus the design does seem to have some design issues. Some of the issues, stated below are: 1. Use of string URIs is a data encoding scheme within a data encoding scheme. QEMU code should directly be able to work with the results from QAPI, without resorting to do a second level of parsing (eg. socket_parse()). 2. For features / parameters related to migration, the migration tunables needs to be defined and updated upfront. For example, 'migrate-set-capability' and 'migrate-set-parameter' is required to enable multifd capability and multifd-number of channels respectively. Instead, 'Multifd-channels' can directly be represented as a single additional parameter to 'migrate' QAPI. 'migrate-set-capability' and 'migrate-set-parameter' commands could be used for runtime tunables that need setting after migration has already started. The current patchset focuses on solving the first problem of multi-level encoding of URIs. The patch defines 'migrate' command as a QAPI discriminated union for the various transport backends (like socket, exec and rdma), and on basis of transport backends, different migration parameters are defined. (uri) string --> (channel) Channel-type Transport-type Migration parameters based on transport type ------------------------------------------------------------------------------ Het Gala (10): migration: New QAPI type 'MigrateAddress' migration: convert migration 'uri' into 'MigrateAddress' migration: convert socket backend to accept MigrateAddress migration: convert rdma backend to accept MigrateAddress migration: convert exec backend to accept MigrateAddress. migration: New migrate and migrate-incoming argument 'channels' migration: modify migration_channels_and_uri_compatible() for new QAPI syntax migration: Implement MigrateChannelList to qmp migration flow. migration: Implement MigrateChannelList to hmp migration flow. migration: modify test_multifd_tcp_none() to use new QAPI syntax. migration/exec.c | 72 +++++++++---- migration/exec.h | 8 +- migration/migration-hmp-cmds.c | 18 +++- migration/migration.c | 182 ++++++++++++++++++++++++++------- migration/migration.h | 3 +- migration/rdma.c | 34 +++--- migration/rdma.h | 6 +- migration/socket.c | 39 ++----- migration/socket.h | 7 +- qapi/migration.json | 150 ++++++++++++++++++++++++++- softmmu/vl.c | 2 +- tests/qtest/migration-test.c | 7 +- 12 files changed, 401 insertions(+), 127 deletions(-)