From patchwork Mon Oct 9 14:36:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13413838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EDB21E95A95 for ; Mon, 9 Oct 2023 14:38:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qprNY-0003pU-PU; Mon, 09 Oct 2023 10:37:04 -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 1qprNW-0003mV-3e for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:02 -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 1qprNO-00034I-Ff for qemu-devel@nongnu.org; Mon, 09 Oct 2023 10:37:01 -0400 Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 399CrZ5x022209; Mon, 9 Oct 2023 07:36:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s= proofpoint20171006; bh=45mKCOvA2OS/A1gpgMAkgbL/m1JsllaMMR0rfu3S4 TM=; b=qc4SGjReKmUaGy/mlBauusnkx39SpEdeYADjBTFpBOgp8bYWY8DKgjPAK wv+1qasci0HS/6i/wuZ9cTe0tZSOW03ypK7K5CFNpIH0umR/iL1VLlpVaYJIr9sM E2sJHPoIuFygV/37DWg2EAsAM59o+hZsvlJjnTVjxNtY7ptyrz+YaOQvR3pxjKIY Sknvu/StgoMkIdJuJEf9QI1/IymxaRwxR0QA7ZX3Gh3fjbX5DulhOkrwTwTW/Tsc /9x50tuKLBUk1mTWf/rPfcgZX9FGsKQDvUO0bGS22rUS+PRr3vsUJD9SO242OkbA 8AUqXk+vYMR2QD8TC9/bjP1ba7iLQ== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2169.outbound.protection.outlook.com [104.47.73.169]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3tkhtbtt4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 07:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nYbIAM64IrWuhxjt3Yrwff5KN5w5XsB/SnoTurKd0T3KzrSf8qsPXpH9vZeJMCWgNqQG24I3CgkCyZzfH3tfg4SYp/X0ODDMH9OblNHv/A/criKFAgZG1Y44CLq8cykYtPuYWWCNutlqW6DsHYAah0gpWek0ucN8/ftHeEP9s5mg6PM4Ybrb3AkMteePbrafHoWaC4/f+AGZkRq/NM2RKbuu6YL3p0xJqv1ddhpzjvPEj+nEHgPviHFCCPdiKI3qsPi5MzcwXQLlROKSolAnGORpS9OsZBhX1iMiJNRXVOzIbEvMKqcQ7ni2XotL+wSTRPZhSDehrcElywCSuA6h2Q== 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=45mKCOvA2OS/A1gpgMAkgbL/m1JsllaMMR0rfu3S4TM=; b=FWcT6l3XwTdvOG6Q3Arf1KvAHTrdXqwOdMmyTLgyrzR/MpQOEZMKsFjQ7zCJvfN6C/XOc9zX7VCgrPZ+vZZgPf9pPKR7nNvwNe2c8H5dxa092XqKn6ajATz+XQHWEuX3a5k79+KdHoh6qhaNlHnk5p8Ja17GvMlavOid0QF+C/xW/tpM2a+CJss4fWlBYIojCfzxtv8k2+M1dpZBFXHjpA29/05/wZjr//mrreVFVCkOwJr/mrSlMmsiH5XZLES8b4iMrUGNXjd9wd3pQjc2iGdMfRr9AVyJ0K7mxchV6xlOPxAPQfrgjiIqPSLt7VaWs2/xH4t1YRBso4HaqpXFHQ== 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=45mKCOvA2OS/A1gpgMAkgbL/m1JsllaMMR0rfu3S4TM=; b=yHgEg27bqi2lGjHEniX6HOMNo0XD91JMqKzgrzClhA3hCeFEXuZU5gjY/rM3GVQVxbFyBtz8Pwg5j8ddye6RbtAygI6ePDQSZpYg/4MeT4MLEkSNJqUWoLb1uKCUkgZQoJ7CMsCepl1Fc8hg8sJJiRCwtjjhrdw5jOYql68SO+x7WTFJ8LhBsg+e+GeIwuvO5c7UwCZdLaoti+0PhQqJe44+9mdn9sYZ4On7HK8D0lA/p1/G1Q2imA6ez4+urfNMGTiC8hL62tZBz31ly4Zl+xSDtaAOqgKh0XZalSXL2e/7TLCHtubOeU8msOV6qGtO7CdKD04oNnJwU7qGX40Tcg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by MN2PR02MB6735.namprd02.prod.outlook.com (2603:10b6:208:1d7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 14:36:45 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::f13d:ea:118b:b4ae%4]) with mapi id 15.20.6863.032; Mon, 9 Oct 2023 14:36:45 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: prerna.saxena@nutanix.com, quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de, manish.mishra@nutanix.com, aravind.retnakaran@nutanix.com, Het Gala Subject: [PATCH v12 06/10] migration: New migrate and migrate-incoming argument 'channels' Date: Mon, 9 Oct 2023 14:36:11 +0000 Message-Id: <20231009143615.86825-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20231009143615.86825-1-het.gala@nutanix.com> References: <20231009143615.86825-1-het.gala@nutanix.com> X-ClientProxiedBy: BY5PR04CA0020.namprd04.prod.outlook.com (2603:10b6:a03:1d0::30) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|MN2PR02MB6735:EE_ X-MS-Office365-Filtering-Correlation-Id: 69b125f3-0cfc-46c7-a9f1-08dbc8d52943 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: HLX1MRypFPmmdGK0dHMeLoVtYTnv6EqiU1zwXYzm0z7tWlYs6VIAuowS9V2OdV7b53Dqr2uADWyNvcWzktOTNDDsPST82QMyMOwSq82cFYherXTTim3FYZewcuOZ8aH3GlVNLh50BPoHbn6sr9x991eIxsOgP1bkr0kwp9ueEf6WZa/yf0gB7iyBNZ3MRTkx6rFPjxjsIFcsCaVIjch958A+9qZaOEV5Cu1pKCiHyUnG33M94AkJT2SwNRyfWsfHvBkYc4kKub0md4OGSih+7mvEVsFa8pFBR0PMeXCZwY7RavNWx6kHj7kULowTX4rVmuHAZVWG7l7xblrL2/LFElGfTcOZERJZyvnZxTLFGV2OdmX83BsLX/+8skl+kgaumFgg6upXU0Pcjlpm8tNz/QNfseq6rtlOcjaB8clxZmhW3lqmGWpC7wgLdcIz8KGNKIuCi8P+Befs/Ah5YGqJRYSC1b8W9SKLAUL0rD8+AvYQozyV/fpaN/e/T5jOqc5dkXr6GYuZjxVWR6t0gCCNBqlx17FH0y5dBjZP9+vI8PHBxdLvfRig54bLQQV8Kj9q58XOAjgg53YsZIx2QG7q8rWxHcUxkLufEG+JsbvryGfRCqFKQDX9Nwtyir6c0OAE2NlPr8wof863HpmSvZqqJA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ2PR02MB9955.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(396003)(136003)(376002)(39860400002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(52116002)(6506007)(2616005)(1076003)(107886003)(6512007)(6666004)(86362001)(38100700002)(38350700002)(36756003)(26005)(44832011)(83380400001)(2906002)(6486002)(478600001)(41300700001)(8676002)(316002)(4326008)(8936002)(5660300002)(66476007)(66556008)(66946007)(6916009)(309714004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HXzWh20GOC9khMwFixQoD3VIX/Fi?= =?utf-8?q?xPT+hZL1AH+w8xJe1Bz6aiViEhROr7bnc04sGoYMKsH9afT7btvm+wvSMm0kBi0vJ?= =?utf-8?q?EWgyerwQHAAJ8JW28a+OC8MY0bTVR9OMfZpbG/GxtpZWEyCYHp1dWiV0m2JY0Cp+/?= =?utf-8?q?II2Zf0x6W33VdDTtA6Q1/v93zIzOfcEMTAJNgyEdvLwypw+iA8rDhOQ86mjqFWd8J?= =?utf-8?q?0g5+XyM8SpawWNW0YgYcy5UILWEGbjdwJ6qwuYX2F99yk2zCLRpAfAzBNsafcbVUv?= =?utf-8?q?BjeqXOfUkQKO/9aHR4+vIZklSQ0Kt2f1CrZBD039GjyuFrTyLAUukzl554JBp/u7G?= =?utf-8?q?MFhoPpKGJZCob0BM1CNDe+66A+a9eCI+OG/YD0ABgycExCCE00io9AQjjVh3KIpCT?= =?utf-8?q?L0NN1TtwY5b1jzy65zAdknyaRGPjUfc77YboJ2jKhD2l81gPRv1IbgIsOpeGq7Jg8?= =?utf-8?q?qdaqeGiaZj3ryJwPjVJs9O3Of2n/Akk3AbPwN1Wvp8u6udpe5XhRmejocBNNFsEFc?= =?utf-8?q?J12tjCbf35gaX/nMnP9WHgMZK4qkwZKCGz9axZ0AiPmpa41eaNnktzFgSXuSE5X/T?= =?utf-8?q?9d62wJ575t/GZntrrVbF8NLtu+73WCoiRoS8kn64la5ddMyJfHmgnxgg6ZZTYe3T1?= =?utf-8?q?G4nLU4LMhpuHF9gO4KP6I5a5HRaVoY02uz0ykUhh79paH0FsgmcJ5jmFdBD/4OoQJ?= =?utf-8?q?LIDK8WSpV+qr1Yg8qYD1uLd+B1Ud8u2i3/jUv/3FMG1+vKtzLanG3MiT7/p6nAO14?= =?utf-8?q?Pe/dtJQ9lxcFuTTRtuNGEBMOgAmLMSBLcYKb+ctEPR3V9+HBDB7w76Va9rAn4cSq7?= =?utf-8?q?C/Oxu/nRzlV9CFiup5rnMXlMnz5VNH/t19+/QMgPYiddvZ0DVTFXM3V4Ou2fnyHGR?= =?utf-8?q?Bz5DeRQ3D/qOXC1nkCBZ6vBHnWI1JphBHo75aW/kO4OBFw7hLJnboMiVPqcFGSd6g?= =?utf-8?q?vGgM0CoC1GUWk7Y87UEIkm/s75dN4FKilMp8ekT2AJwfV78b5fiwKInFWPrjtTWll?= =?utf-8?q?bYcoPZCB8EhJ0fm4iAd4SUMthfUTE2XnqHKFxtqjoGBTrTUEw0JBr6i8i8z200vq9?= =?utf-8?q?WIQlrPD4ogsoGYwTFH9BSpFtVDlQYYOTSV4HBMOiQ9yGIFzKOdRhZMzJzmJNX5P2X?= =?utf-8?q?idPWNds9P5KXw7Ais0+Wsw7s+/yXlxNmmcRwZgFS2xLC7S07VEz/b+Vdq26Xyar4+?= =?utf-8?q?BjvNdZ479ee+daQl1IObgF0KcMbt10n+qqzzxcom/c9ATCQgJMvtYVMx4BVhV4cQ4?= =?utf-8?q?Uqz9CTvd2ZAhkAZsFKF1SxYU9rTYhtN8s/CZGbzZRpOQNhpAypfaQq5W4DLcpDjiT?= =?utf-8?q?K9lrqEz090ZlT4PKQI9ddPsZr7De/pjOsATi8XSo4nG+SAkfBo7ZfPoob/WFdTQ+f?= =?utf-8?q?ZL4ZK02kEuBEgXDGKiFN++wiQ8hPjY/5A6igSmgFuIgww7UTcFBv5SLrdJ4as0VaX?= =?utf-8?q?Za+3Avi36xo2X4e6Lgu/xfVYJ2p+lUo3EWOA30yd9+eAtlrNq4kAwJdxrp0sSW/bb?= =?utf-8?q?7kMar1T4Ud49?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 69b125f3-0cfc-46c7-a9f1-08dbc8d52943 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 14:36:45.0312 (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: Qlj4nagSINdWColsHsce8frQV+td71Kr+Ts/DKeszRbVgOJo/ZE6yK3UbmuD8CmKjKD1lGkQhqB058N0GqsA9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6735 X-Proofpoint-GUID: kxtOmS8iwJbHrxaCRAlOS6hugaCj7-1t X-Proofpoint-ORIG-GUID: kxtOmS8iwJbHrxaCRAlOS6hugaCj7-1t X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-09_12,2023-10-09_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org MigrateChannelList allows to connect accross multiple interfaces. Add MigrateChannelList struct as argument to migration QAPIs. We plan to include multiple channels in future, to connnect multiple interfaces. Hence, we choose 'MigrateChannelList' as the new argument over 'MigrateChannel' to make migration QAPIs future proof. Suggested-by: Aravind Retnakaran Signed-off-by: Het Gala Acked-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé --- migration/migration-hmp-cmds.c | 6 +- migration/migration.c | 56 +++++++++++++++-- qapi/migration.json | 109 ++++++++++++++++++++++++++++++++- softmmu/vl.c | 2 +- 4 files changed, 161 insertions(+), 12 deletions(-) diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index c115ef2d23..a2e6a5c51e 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -442,7 +442,7 @@ void hmp_migrate_incoming(Monitor *mon, const QDict *qdict) Error *err = NULL; const char *uri = qdict_get_str(qdict, "uri"); - qmp_migrate_incoming(uri, &err); + qmp_migrate_incoming(uri, false, NULL, &err); hmp_handle_error(mon, err); } @@ -731,8 +731,8 @@ void hmp_migrate(Monitor *mon, const QDict *qdict) const char *uri = qdict_get_str(qdict, "uri"); Error *err = NULL; - qmp_migrate(uri, !!blk, blk, !!inc, inc, - false, false, true, resume, &err); + qmp_migrate(uri, false, NULL, !!blk, blk, !!inc, inc, + false, false, true, resume, &err); if (hmp_handle_error(mon, err)) { return; } diff --git a/migration/migration.c b/migration/migration.c index 732fdadb11..f3e7c338ec 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -474,11 +474,34 @@ static bool migrate_uri_parse(const char *uri, return true; } -static void qemu_start_incoming_migration(const char *uri, Error **errp) +static void qemu_start_incoming_migration(const char *uri, bool has_channels, + MigrationChannelList *channels, + Error **errp) { const char *p = NULL; g_autoptr(MigrationAddress) channel = NULL; + /* + * Having preliminary checks for uri and channel + */ + if (has_channels) { + error_setg(errp, "'channels' argument should not be set yet."); + return; + } + + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in " + "'migrate-incoming' qmp command "); + return; + } + + if (!uri && !has_channels) { + error_setg(errp, "neither 'uri' or 'channels' argument are " + "specified in 'migrate-incoming' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; @@ -1535,7 +1558,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; @@ -1553,7 +1577,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); @@ -1589,7 +1613,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) @@ -1720,7 +1744,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) { @@ -1730,6 +1755,27 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, const char *p = NULL; g_autoptr(MigrationAddress) channel = NULL; + /* + * Having preliminary checks for uri and channel + */ + if (has_channels) { + error_setg(errp, "'channels' argument should not be set yet."); + return; + } + + if (uri && has_channels) { + error_setg(errp, "'uri' and 'channels' arguments are mutually " + "exclusive; exactly one of the two should be present in " + "'migrate' qmp command "); + return; + } + + if (!uri && !has_channels) { + error_setg(errp, "neither 'uri' or 'channels' argument are " + "specified in 'migrate' qmp command "); + return; + } + /* URI is not suitable for migration? */ if (!migration_channels_and_uri_compatible(uri, errp)) { return; diff --git a/qapi/migration.json b/qapi/migration.json index 4e4c39a9bd..7b84c04617 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1519,6 +1519,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: # @@ -1526,6 +1554,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 @@ -1550,14 +1581,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: @@ -1568,6 +1635,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 @@ -1583,13 +1653,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 98e071e63b..99ab0d3a51 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2690,7 +2690,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);