From patchwork Fri Jul 21 14:49:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 1810975 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=IW9djY1a; dkim=pass (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=C8JsOBcD; 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 4R6sts0Rkrz20Fj for ; Sat, 22 Jul 2023 00:51:01 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMrRs-00033i-Db; Fri, 21 Jul 2023 10:49:40 -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 1qMrRo-0002yP-RF for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:36 -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 1qMrRm-0004nO-Lo for qemu-devel@nongnu.org; Fri, 21 Jul 2023 10:49:36 -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 36L9tsg7000874; Fri, 21 Jul 2023 07:49:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:references:in-reply-to :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=kcoLYCWWGTkt79MpNmcniCnCtBC5L9iWy8fEEdfF4 UU=; b=IW9djY1alTCOrk894LMDU01B1Vxp5JjhhtWAwjSshKEB+7k4+nlht7CKD jk4nusgkHMDf5HaeZUFgGL5DSNHYJHLfuZzgghFfWfu3/nh0PvYgsPNbVhTru64k 91jcps9gTWYv5RHQq97SVM+batFFZhgMhVcLPMTxEI9c/KYRyIhDHKRG2bEZYAvv MpMEMmOPtFnNJmsCn/dI9Xe3rxnVmkiregpOVU38AS+dInK6UKQ9kL/OypbXahh4 6Yc1JQYwSnQMLA61gpqNm9caz0lhSTjscg6VvZH5jXrok8dAuzEGoD7g09/nnOjS TuhzrLrdDMYO+bt2EINFZhng3jNWA== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3rx3fmxgfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2023 07:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9USIIsCCodFkb56aprqm+khkXL7GrZHBgMQGERX9bVY3npZb7/xwdbYcAKQkujNoXg32qw+f2Ugx1Dhtm0n1Rnfq8sHF0wznsWj/IREb4bMa9Ap8vQOedHfrYfvcapd5umQ3IyFSM5ebcWW4hr129jSALEkmFeFpbxKmFtzrRoQO4h2r0ddr4IzUmLQ0B1ac1Ns/yIJEEn9BlP6ysRzvV6fg7jHKwMZ3GWQ441DsE+fC3vBcRz6OYaAmeLkMdMIhD+CFulHp3L8wgzkQ6mxQ3fIz8efAXkc4+BsYRKsqJjeqxzqTxUXE8cAOc1yMVQd/HX+wwlGducTShMbq1M/LA== 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=kcoLYCWWGTkt79MpNmcniCnCtBC5L9iWy8fEEdfF4UU=; b=CTIPYU/s9odwNjEv7DIQkeIPCRtfao5xOqBKIYMtHmoAEs+YWq7fBrXSZTPvyxAIHh2BKkWdc+EkwMJMd3M2DgkBIXal9S7SwR3O74KA1vtBq/+yyhSF37Ush2SuB38foyifOBAezvLKkJjjo/OblHdPFY7/WcADaWDF2YqUT/gPsvs93Xpp/GqnPLXKzu3ZngMEAAITTewrN3btZVkUP34SXAhrVibdQm2KyYIUJi21qt0ojG0BWNdBmMydeEeEwRyz+II7JEUPYP80yoFvIJEzHx/LsFqZ5M1z5jDdoeNGAAgaZNiJN0u0XvgQjX4dl2Q237tZY5pgbr6lDrtMvQ== 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=kcoLYCWWGTkt79MpNmcniCnCtBC5L9iWy8fEEdfF4UU=; b=C8JsOBcDRa8SvsVw3dqGmuWaECRqyCBcHoRcJzbap8TcWgIhd6lPaVahct9UY/6YU7uT7TtqGnAb7AIZ1XCXJyhDXlqX813gQ9XCvqBTrusQ3LITNqJO5B2ELocIDQdmAZzFbxFgInIBz8HchDoG73rNGjZehnhibgrIuL4YDIJDwbasWvoQ3VCuufaHPt/sv8hgrrQIY4sYdGS9m9w4eM7U7JHTyhLegqOepnyzYiTZ4Rw8XdCn9/6hl0JlyskJgIEw+Z6ixyY3gvF9G/Z1ffIJ7Fmlwzj2ZP+00ffTkLQfJw6zKyzPWC4DIus3cQQUcksEI/3BpZpS2pJKqrejvQ== 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:31 +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:31 +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 06/10] migration: New migrate and migrate-incoming argument 'channels' Thread-Topic: [PATCH v9 06/10] migration: New migrate and migrate-incoming argument 'channels' Thread-Index: Adm74o5wbui5hd/vo0qtqkIMunFvLw== Date: Fri, 21 Jul 2023 14:49:31 +0000 Message-ID: <20230721144914.170991-7-het.gala@nutanix.com> References: <20230721144914.170991-1-het.gala@nutanix.com> In-Reply-To: <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: 66ca65e6-f5b6-42d1-a301-08db89f9b0f1 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: vIkPkJAuUqDCo5TInvVVLnFg2SCuxHj9H7ygQEuy/zdsgwBxl73DYqpEc8nHNijp7kSSWTeMzeVdnHX08APb7SM2fngcj41k522Qy11CtFKcllwJtpc4+bYiLMCy18K2pno3Rk3V+X6SevzN+NB40amVbVPy9CsRapqL7aXpPTVLAEHJW9HkoO2sCnhIcdnr2/ijFFNBGQAzPwRYSvbs/mSTiusuLho9ROZQyBNMv3P35RzjbaaXwK83zRF6jx61i62xwOSJP4foZSIO9sl0t+4HhsOT2KmwKrJ79454NKSmZ1hFt/6JQrwRCWi3uDSKMiIfE1Z7GpjgrzThXai+SJRL0xC4DG11C99Xe7g72IQYicpg26hNNoQp2MjBmMwA1Si9146pfhu1LiDt6WlkiXpclsAlb6b+xBIzHX7LJhakxODRzvQ5R68iu2lSvKoDeQ3FbPgkGmpo+ZQarjYR/tLrpaQyLNID/EVlHZXHLn0tVYU4qhXW/V4YRacN/YrB3kcezJpCtTKzdrs6JkthsUkZAATKlINvSJvL7H+ffbYT09/zsMWjx3PPB6F4+WENMtRuIP9Jdi62j8ywP6DIzl6wm0iSAeP5xYaYsvoxWWtsN9IHKu/U+bKkf6l8+tWiUu6XJKpB/b1uZqy/EqHplA== 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)(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)(309714004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?97C8+dinRGqwm4xGl8lZH7osQWbl?= =?utf-8?q?aqwZXuvEYM0lZri4yaF+x5q8oQ5JcDayDCn361Gs9AkGFJKnrGaDlTjtncSK5+FNh?= =?utf-8?q?uaMc6T41ypviZmHT0wAAmeGlBudYwAj16hE4APpEfKlw92Nu9OemIkxt4j4PM40hJ?= =?utf-8?q?oqcfE4cOmjKkiZ9Zw4Z2dtdzI7563Uq5lRuXdwOXQ3BJ63niU8eKmbxKBJTUNjL39?= =?utf-8?q?uTyTQRKI2TLVpriJ7+Bhcag123AbcslVZG1gBGxPTvmaN1I+hNPPcLtmg4RU07BBg?= =?utf-8?q?2gY0VXzlXFbyfaXzGY+5plwS+twpdmhZnYzEWPmVx68RNZSPakJ4NqufxgN2gaLQh?= =?utf-8?q?rvueKnBXLYRv04NotWTpcDPfynvwIpHEZpTfKQbQLtxnXh2glvXBU6owS6PEYvokB?= =?utf-8?q?QcxVqQFtOYNTEkIdAfJ2P04LVSS6MR4QbXaJ8QvgLhu/0lDLp3tKTcjCh8AMVrcBx?= =?utf-8?q?CCp9GkH88kdfXrQf3Yd433xZhl6o4BrKZy9p3GWuDfqsut01WtZwKfoSFPts5Dgxk?= =?utf-8?q?9uVHMQiK8oE9Cs4SyA+m7dhCnspIiC35NrY6I14+8EBxBz+G+ls3kl+a12OMcSVwQ?= =?utf-8?q?2/GgVKfMvv8mf4Nx8Wb/PHrc8Vw9zro8AlPFvhMplT0v4no6brbdiAE7cI14/OdAd?= =?utf-8?q?gXSoMjpkiMlpJn2G17M0PkHc3XFv4PgJkRoHyzSlNOUG2whtGU05fo+E8Xfi3J1m7?= =?utf-8?q?SEI/rP+iMmDwuuTkV2lzyzeoi/mC4AY8DyNwbXOrXkWrZMWOCBmN9jpnsag2zJqa1?= =?utf-8?q?Ac6wIUVFURJo6nh8wTIhpCaLRaMEaQt3cQVnRsod8TqQtB/1u2tDJIzsaTY66pNpU?= =?utf-8?q?nM1YNPBiNa9lquGndgGpjVSpkkfum7yy6kxlnpTT+AmUne2JSXi7casBqc5BVhUgr?= =?utf-8?q?at9OCu10i2B65VjWBgyTDVldHTYLy2YzjxhfPgO/6nptjDQ1toOeJEbt9O169Yq07?= =?utf-8?q?LgpD5Tzgm+oeCzVwUFT3mFDiuJ+S1YJbVEdbFr0HUJereda2VPCrqSpNba8JAQ9D2?= =?utf-8?q?MTEOfGyzGZURcbzQimqBTBp9fciqXzwZ6wVEO5NQNfKBwhprGBCRVC//YEqhZGqSe?= =?utf-8?q?EWK7lBuBHPN2Tmm4ETpXncrADaI9HRv4Yk4347KXROBfiRjSLSFjctEW00f9A1FNw?= =?utf-8?q?N6vfAArpJBPNBOosnEm7wknTw/asXzpe2Bi0fOgO6RVl4s5S2+be+yzY74mjtYznp?= =?utf-8?q?idgH3bRn8RElHA3ZpxsqS5x0H1/4ONwVkYibK6r0dn7Y3knDirPmlgxnqoRqgBlY6?= =?utf-8?q?lzanmxml7jyXybj9vd+myaQ7wgwUgW6X2HaCMJSty3GEbxJCBz/SWBi1BEbdLaNtN?= =?utf-8?q?zg7KqbXZivbhUBnmUpcMQx0zjwAjCw0p+CaSzIsrIcmYSUATBCRUL1TTIJ+uO+s3x?= =?utf-8?q?rkaYUf8fiMJYTodY+hmcvkFBgcnrvt0tNdvRnwhUDDNX7i/6H0MmYPzfaOjfBkB5s?= =?utf-8?q?qQ2jdKQW8rrWymfke7mBWvBPUk1nTgLXua8r40Zjimhys+EUc1EDHEFDk4zyMcYmX?= =?utf-8?q?rGn8j6pVQIs+bNrLlfo7GVdF/GgQJB7QTg=3D=3D?= 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: 66ca65e6-f5b6-42d1-a301-08db89f9b0f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2023 14:49:31.1082 (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: HsggupzvTRoYtPDeO5kYk/zNVo4ixfWN/a9a1BKlWK/JjYaKRXHJTe7oRoLkGGvCxZFN/nvCM27L0hj1+3lCag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7561 X-Proofpoint-ORIG-GUID: DWJUQRD4ehHDLpLm15n_OClzWTW7pMXU X-Proofpoint-GUID: DWJUQRD4ehHDLpLm15n_OClzWTW7pMXU 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 MigrateChannelList allows to connect accross multiple interfaces. Add MigrateChannelList struct as argument to migration QAPIs. We plan to include multiple channels in future, to connnect multiple interfaces. Hence, we choose 'MigrateChannelList' as the new argument over 'MigrateChannel' to make migration QAPIs future proof. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Acked-by: Markus Armbruster --- migration/migration-hmp-cmds.c | 6 +- migration/migration.c | 34 ++++++++-- qapi/migration.json | 109 ++++++++++++++++++++++++++++++++- softmmu/vl.c | 2 +- 4 files changed, 139 insertions(+), 12 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index 9885d7c9f7..49b150f33f 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -424,7 +424,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) Error *err = NULL; const char *uri = qdict_get_str(qdict, "uri"); - qmp_migrate_incoming(uri, &err); + qmp_migrate_incoming(uri, false, NULL, &err); hmp_handle_error(mon, err); } @@ -705,8 +705,8 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; - qmp_migrate(uri, !!blk, blk, !!inc, inc, - false, false, true, resume, &err); + qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index f37b388876..bd3a93fc8c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -466,10 +466,22 @@ static bool migrate_uri_parse(const char *uri, return true; } -static void qemu_start_incoming_migration(const char *uri, Error **errp) +static void qemu_start_incoming_migration(const char *uri, bool has_channels, + MigrationChannelList *channels, + Error **errp) { g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + /* + * Having preliminary checks for uri and channel + */ + if (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; @@ -1497,7 +1509,8 @@ void migrate_del_blocker(Error *reason) migration_blockers = g_slist_remove(migration_blockers, reason); } -void qmp_migrate_incoming(const char *uri, Error **errp) +void qmp_migrate_incoming(const char *uri, bool has_channels, + MigrationChannelList *channels, Error **errp) { Error *local_err = NULL; static bool once = true; @@ -1515,7 +1528,7 @@ void qmp_migrate_incoming(const char *uri, Error **errp) return; } - qemu_start_incoming_migration(uri, &local_err); + qemu_start_incoming_migration(uri, has_channels, channels, &local_err); if (local_err) { yank_unregister_instance(MIGRATION_YANK_INSTANCE); @@ -1551,7 +1564,7 @@ void qmp_migrate_recover(const char *uri, Error **errp) * only re-setup the migration stream and poke existing migration * to continue using that newly established channel. */ - qemu_start_incoming_migration(uri, errp); + qemu_start_incoming_migration(uri, false, NULL, errp); } void qmp_migrate_pause(Error **errp) @@ -1685,7 +1698,8 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, return true; } -void qmp_migrate(const char *uri, bool has_blk, bool blk, +void qmp_migrate(const char *uri, bool has_channels, + MigrationChannelList *channels, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, bool has_resume, bool resume, Error **errp) { @@ -1694,6 +1708,16 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, MigrationState *s = migrate_get_current(); g_autoptr(MigrationAddress) channel = g_new0(MigrationAddress, 1); + /* + * Having preliminary checks for uri and channel + */ + if (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 0f4a54a7ed..9a365ac774 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1458,6 +1458,34 @@ 'exec': 'MigrationExecCommand', 'rdma': 'InetSocketAddress' } } +## +# @MigrationChannelType: +# +# The migration channel-type request options. +# +# @main: Main outbound migration channel. +# +# Since 8.1 +## +{ 'enum': 'MigrationChannelType', + 'data': [ 'main' ] } + +## +# @MigrationChannel: +# +# Migration stream channel parameters. +# +# @channel-type: Channel type for transfering packet information. +# +# @addr: Migration endpoint configuration on destination interface. +# +# Since 8.1 +## +{ 'struct': 'MigrationChannel', + 'data': { + 'channel-type': 'MigrationChannelType', + 'addr': 'MigrationAddress' } } + ## # @migrate: # @@ -1465,6 +1493,9 @@ # # @uri: the Uniform Resource Identifier of the destination VM # +# @channels: list of migration stream channels with each stream in the +# list connected to a destination interface endpoint. +# # @blk: do block migration (full disk copy) # # @inc: incremental disk copy migration @@ -1489,14 +1520,50 @@ # 3. The user Monitor's "detach" argument is invalid in QMP and should # not be used # +# 4. The uri argument should have the Uniform Resource Identifier of +# default destination VM. This connection will be bound to default +# network. +# +# 5. For now, number of migration streams is restricted to one, i.e +# number of items in 'channels' list is just 1. +# +# 6. The 'uri' and 'channels' arguments are mutually exclusive; +# exactly one of the two should be present. +# # Example: # # -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } # <- { "return": {} } +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "socket", +# "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "rdma", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# ## { 'command': 'migrate', - 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', - '*detach': 'bool', '*resume': 'bool' } } + 'data': {'*uri': 'str', '*channels': [ 'MigrationChannel' ], + '*blk': 'bool', '*inc': 'bool', '*detach': 'bool', + '*resume': 'bool' } } ## # @migrate-incoming: @@ -1507,6 +1574,9 @@ # @uri: The Uniform Resource Identifier identifying the source or # address to listen on # +# @channels: list of migration stream channels with each stream in the +# list connected to a destination interface endpoint. +# # Returns: nothing on success # # Since: 2.3 @@ -1522,13 +1592,46 @@ # # 3. The uri format is the same as for -incoming # +# 5. For now, number of migration streams is restricted to one, i.e +# number of items in 'channels' list is just 1. +# +# 4. The 'uri' and 'channels' arguments are mutually exclusive; +# exactly one of the two should be present. +# # Example: # # -> { "execute": "migrate-incoming", # "arguments": { "uri": "tcp::4446" } } # <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "socket", +# "type": "inet", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "exec", +# "args": [ "/bin/nc", "-p", "6000", +# "/some/sock" ] } } ] } } +# <- { "return": {} } +# +# -> { "execute": "migrate", +# "arguments": { +# "channels": [ { "channel-type": "main", +# "addr": { "transport": "rdma", +# "host": "10.12.34.9", +# "port": "1050" } } ] } } +# <- { "return": {} } ## -{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } } +{ 'command': 'migrate-incoming', + 'data': {'*uri': 'str', + '*channels': [ 'MigrationChannel' ] } } ## # @xen-save-devices-state: diff --git a/softmmu/vl.c b/softmmu/vl.c index b0b96f67fa..d811f3f878 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2651,7 +2651,7 @@ void qmp_x_exit_preconfig(Error **errp) if (incoming) { Error *local_err = NULL; if (strcmp(incoming, "defer") != 0) { - qmp_migrate_incoming(incoming, &local_err); + qmp_migrate_incoming(incoming, false, NULL, &local_err); if (local_err) { error_reportf_err(local_err, "-incoming %s: ", incoming); exit(1);