From patchwork Fri Mar 8 20:59:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587272 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 34E8AC5475B for ; Fri, 8 Mar 2024 21:01:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKD-00040H-98; Fri, 08 Mar 2024 16:00:18 -0500 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 1rihK5-0003zj-Mx for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:09 -0500 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 1rihK2-0001C6-BF for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:08 -0500 Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4289MM8e024123; Fri, 8 Mar 2024 13:00:02 -0800 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=Qdu0lOdUIKGAiRzLxxb8GL70Wt2g6cWH8JYSv6Mkc AY=; b=fSpgKQlL/6FvZmmstmCQIMDbuXiHcrFofzxrNJOTZYsUdYhSqvyNSP77w kodlPHEgzB1NjR0YmQyrrjPGQM9CpoUQi/9hg5km/279Kzq1OTAnzqlLXExeUjA8 nnVZCr4+TiGlbB4cDWTkUGqOBKwbxg9Y9II8kaJd/6rNA5AayktN/mDAT4+Zrt2+ axi8JerX5a2Xz1I9j6Pxufj01eZFpBzCLjx5vym1dnELBpbi4GK3rCdM8fGYk7bu qdoEHeDDsu/4xubmuRonD/acoshREkYEf4s4Vthev76OBgLx1siCGx7b0hbv+oP1 LQUL3ymwiqwJ9SahQrTmuig/Hhm5g== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012018.outbound.protection.outlook.com [40.93.11.18]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm33q6vv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X8gRrDzyyYJhkUoYP6AoMaJy94T3IwyDRsGAWoOR+A9WUUwQqczb3pXo2x2F2/ZdAPhmpwFPemNU8hsUTayc1IbOOtjxPNpl6LS+/ZFnN7/2zxIQoILHMCNokwsnIJxi5ELKRql+T3SC1NAkeOPfrAN4ye63dzLyjD5XopObyLwUky3T9p70gTcxXJAokIKdo5foH20kb8JvXrv+y6gwuYnnaHlHFw88unPt190mUpibG5sGZqe8LrANB7TT6VhwPbdqdYywleyyfEfhDXVHhpYqIvlXF+2lcODt403bs38GdvMb00KKe/KNyvWfKn1tT0YCKtDQWr9cBNjdLPFDWg== 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=Qdu0lOdUIKGAiRzLxxb8GL70Wt2g6cWH8JYSv6MkcAY=; b=H3SJJuQT9HJpy7OywJOFo9FVOpXcd2rLRsG1SooTPnDIWnkg4p/uXSAEBP0SHCemwyd+Z+Gxf+j5UlJEZHbLKuT9hTYy8Ikbhg59XRlkqmFu8RYek7pVZBQ9/h6ser5p93mqGr+h1YIeB4e+xaDOPNgfIh9ZE1qo8TIvc4LQ6pCnquUi0SBpfY8CAOhhmGciMyyHwSTx7dO5PkYPPcwYwBDX5a5aJ814nOBs1c1HGwCka33y/L0zGEJ+ko56HDPfreVvr9yOyeg+k3vZf70S0eS5tLeJuFWi30EKtTkPS3ce3FFUVaT5JE8gdWeacVBQzOpvKN4WaDPH7x09fQrPRg== 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=Qdu0lOdUIKGAiRzLxxb8GL70Wt2g6cWH8JYSv6MkcAY=; b=kgE/XeV5Dli6f/4k2Y69cirrnhsFZ18P0TaMGhXQYX4eSWqfiG8vIbq2B73Fjw1BrqIDteBp6CP9b9i635rvSDLCwMIbVpAjXQ2j2ii77DZ4EBM0Soy4/L0DJKstsdyxL0EOCQcyRKoklU+5zHuJU7ykeVF29qZrhS5B83NAysaOK1K9rEhiAKSkXbXfablugeLvuCIyC2xUwpK/q+IeAw3C7Up2NyEPze8sS3Se7ETf6c9Q+XAcL2DKJ0aKMe7420lehWduS6nS0DxOixTAhqMQyxPUDVwWEBN+faL8W17Zes6BTl+EIxBispwGnJEVILFH/sJfLXTzCY8AejNXWg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by MN2PR02MB6702.namprd02.prod.outlook.com (2603:10b6:208:1dc::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:00 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:00 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 1/8] Add 'to' object into migrate_qmp() Date: Fri, 8 Mar 2024 20:59:44 +0000 Message-Id: <20240308205951.111747-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|MN2PR02MB6702:EE_ X-MS-Office365-Filtering-Correlation-Id: a51eff5d-767c-4224-1a64-08dc3fb2b7d2 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: 2TCATpkS3kk4DZ+KRxkxPSvoGSBGcLvopzykAO4P7VL9b/gnoM4+06JW7qGg43sE9RduMY7udnjHB/6SGh8Z6oBz9xTApUsNNHnDxSHCnvq2ugnKis/WmNrvUn00cjufo07DcIOZtof7/JsivfyKntDu3kfyU9pQJftGZaGFenYIvtAmvH+Ng5Pn+cOS/9J+5XdDXp8NM9jCvz9No57oK+3Ub9rTd+yyfuTMfH/X4Ky4jk1DLoRb+7pLRFsJFBMHpITBWe8ao7MsWp1YWcHsXK5bzTdM6sqjPtJ2wjcFt0NAdOdEoyTkH1Z1jHTPWGzQ25CoZYRGoNbT3/6h4FkefNFtEANgSzOr+uk8l0LnsUp3nhVhRsQsw6yyTYa/BhAFtBk18o4Htf9j57Nlsv3ubiNfpHhtR9FYz6vZeBAA+IwCs4VYpZtsZTUW36sctWC2wVR/zKUFmZEKHacMKiLgWj5j0aio+OulnX8HhzrOJC6r2XhsOzNlvR19Xy8y0DKAHmOmzLYfoALpwYugDBzeFsbJScd1kBGZxaXy5wOCkTOmcajTx1ytWC3/EW+tEXbndx2f8xclUIFPzRd2kX7Y0yeyw90b4y4Qr593uGxfIl8BIAhwN9ngXZ+rvswuITGC8UXawdDij7AUczJMg3RaQYOvoDX2eVPS2ERyuNfbo3uce8IHzBlhlZjJnzwlLvFRsa6HUIGiVENN5jSfIMUpS+ozOGrWpJ0obLqIf7d/quA= 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)(1800799015)(52116005)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vIvHD4Wyqscvm/rQYSvErnn2BxOgyCSXSuv50J0F9GiXmPT0ElwPAS3188y6HIqjth4Zdff6Rj/lVQY6YvrgydC/XjNUJ+6B6rbjMkvwKsvEVG3h142U/IkgUadiFTLMwIjMuDoiHygiYVo7k/yJfk70dCLtu1JULYeltU1cbMgswh8dBcq4APFqTSz1cVZ7zoI7tT7+dRQPSx6vkvMRJpsoVd1NKmCghI9tVqZq7UxnkL7rD6opFlBmRxBpn8JxDhd6Ea/SeeU/ExTkR1dW2mBU+2getjs3V1VHJXG7KZTj6LWxyDzqguEyQ6akCWIFJbYgJSFL3utROcbSEHO7N+yxqp9VBGg4LdiGrKSVaEV0Kob+E8CthEyXsgNrfubuHuxqqAKK/2FCcwt85jSG4Bnfit9OKeXSYWOucfl2lkvkGTgF3G7Es7+78AbLSCE/UtVxA6b+OI/PLtBaCagJu+sz+w2370ajTyuoxaKAvNg4mZGguUk7MzvqNccj8ECo7R+oRZKbOipbBUkVgFrMBRtWQF5hFo66jGnR0KsdrH9HeIDIP+odLrY6KcKThpB30j2rX183L0OeVsgaQUneHxc26g8ImATqjpyFYwxIbIbXrl3zC8yU3wnKWN7BTPoMDA3ByYzKPh62k9xZdPU7NOBJ/SGSK1vr41e2Z/ALMiUY/iQTUaNQ9sPGK+Q6IskCN9tT4g2C1c83CvTD3xnAhEYhQ7FYcAUPV+S8xWsDmxcUis+9xWJ4Ew3BlI6P0fPzSJhdIoQkY5ORj+vHkJPMLKxCj6kI1ofMKWvtUsVL+hVYTanqdUu3QqWyt2jnHjJLBao44W50WRKgdqEgYq+gVhB7IKQLFF+bNzRvaJ9FC9n+qGD4bel+vls3kXmSuAQHHQna0ei89LQvDk9IYDGzwsIukQ4COvzRHRgQFJVAriQ/fJkhDbOu+pIkNojFTKpQRzhoOPIkP/lyIduqLhJwAQf032sS2gm/XRzAr1eIm/ZtcQ8oM8CSxWcf66TW9G5Fa1WWtDule8+6D6H0ky5d9/RQf11tbbY54v9l7Q5RQ4zlgaYj8GyxGp6iVTG6Frp9eNdOA+UnwgdV1HOoZEas4OhV/H8ZGsbJSNNM2LtY4uvYhogAHjKXbbX3+G59PMWRb/S7gR7OlrMuR9mu3sqOPm/lN+Esa+DeYqrbRqaVf5V9keUafhcMvGrwbZdtgu8Xr6RmEvEOXpyv2zrUHKQ4z+Cs5i0fQrkjOUnP56r4CjoxnhdfQpziY/kU2zn5NaNNKq3w7TXg0zd7/RusjUsq1IGBztzhEKLU5Q4oRDOiMXHobbbP6puwJmuigEUurq8ruwwqpQo2JOBiCFzGUVoXGiRpHIdIrVH97t+Exe0e1pfrKXRNc87hbtVSOVLCWGVPNNIpTFQntduRoq7ha9A5LR6za1si6OODOeXK9CoWztO0X3kdvk2axevMdzmfg4YV98axP0204fvlZnk50ull9kz7L3YfZwEBjxUpHgGSrozZ1/fIo+ACgy9/01S0TV8Omt82Itz71B8P4M02JVWDKRGXAY8+F+k3Uyg8IWG7MCL04w5tpbUuGl19ZSvKhUzW X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: a51eff5d-767c-4224-1a64-08dc3fb2b7d2 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:00.1591 (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: zvNU3asPhec7O5IWaNfUsUIZ/gcO4vofKwSlfVWZXDPxAZf25te88Y0dOvoXwbEEEuP0W3TG2LCTYMzDkv+CAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6702 X-Proofpoint-GUID: oga0sPNkbA2x10cvlYwn7_XuNVqlhuxb X-Proofpoint-ORIG-GUID: oga0sPNkbA2x10cvlYwn7_XuNVqlhuxb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add the 'to' object into migrate_qmp(), so we can use migrate_get_socket_address() inside migrate_qmp() to get the port value. This is not applied to other migrate_qmp* because they don't need the port. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 3 ++- tests/qtest/migration-helpers.h | 5 +++-- tests/qtest/migration-test.c | 28 ++++++++++++++-------------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index e451dbdbed..b6206a04fb 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -68,7 +68,8 @@ void migrate_qmp_fail(QTestState *who, const char *uri, const char *fmt, ...) * Arguments are built from @fmt... (formatted like * qobject_from_jsonf_nofail()) with "uri": @uri spliced in. */ -void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...) +void migrate_qmp(QTestState *who, QTestState *to, const char *uri, + const char *fmt, ...) { va_list ap; QDict *args; diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h index 3bf7ded1b9..e16a34c796 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -25,8 +25,9 @@ typedef struct QTestMigrationState { bool migrate_watch_for_events(QTestState *who, const char *name, QDict *event, void *opaque); -G_GNUC_PRINTF(3, 4) -void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...); +G_GNUC_PRINTF(4, 5) +void migrate_qmp(QTestState *who, QTestState *to, const char *uri, + const char *fmt, ...); G_GNUC_PRINTF(3, 4) void migrate_incoming_qmp(QTestState *who, const char *uri, diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 4023d808f9..d9b4e28c12 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1350,7 +1350,7 @@ static int migrate_postcopy_prepare(QTestState **from_ptr, wait_for_suspend(from, &src_state); g_autofree char *uri = migrate_get_socket_address(to, "socket-address"); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -1500,7 +1500,7 @@ static void postcopy_recover_fail(QTestState *from, QTestState *to) g_assert_cmpint(ret, ==, 1); migrate_recover(to, "fd:fd-mig"); - migrate_qmp(from, "fd:fd-mig", "{'resume': true}"); + migrate_qmp(from, to, "fd:fd-mig", "{'resume': true}"); /* * Make sure both QEMU instances will go into RECOVER stage, then test @@ -1588,7 +1588,7 @@ static void test_postcopy_recovery_common(MigrateCommon *args) * Try to rebuild the migration channel using the resume flag and * the newly created channel */ - migrate_qmp(from, uri, "{'resume': true}"); + migrate_qmp(from, to, uri, "{'resume': true}"); /* Restore the postcopy bandwidth to unlimited */ migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0); @@ -1669,7 +1669,7 @@ static void test_baddest(void) if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) { return; } - migrate_qmp(from, "tcp:127.0.0.1:0", "{}"); + migrate_qmp(from, to, "tcp:127.0.0.1:0", "{}"); wait_for_migration_fail(from, false); test_migrate_end(from, to, false); } @@ -1708,7 +1708,7 @@ static void test_analyze_script(void) uri = g_strdup_printf("exec:cat > %s", file); migrate_ensure_converge(from); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); wait_for_migration_complete(from); pid = fork(); @@ -1777,7 +1777,7 @@ static void test_precopy_common(MigrateCommon *args) goto finish; } - migrate_qmp(from, connect_uri, "{}"); + migrate_qmp(from, to, connect_uri, "{}"); if (args->result != MIG_TEST_SUCCEED) { bool allow_active = args->result == MIG_TEST_FAIL; @@ -1873,7 +1873,7 @@ static void test_file_common(MigrateCommon *args, bool stop_src) goto finish; } - migrate_qmp(from, connect_uri, "{}"); + migrate_qmp(from, to, connect_uri, "{}"); wait_for_migration_complete(from); /* @@ -2029,7 +2029,7 @@ static void test_ignore_shared(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -2605,7 +2605,7 @@ static void do_test_validate_uuid(MigrateStart *args, bool should_fail) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); if (should_fail) { qtest_set_expected_status(to, EXIT_FAILURE); @@ -2708,7 +2708,7 @@ static void test_migrate_auto_converge(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); /* Wait for throttling begins */ percentage = 0; @@ -3029,7 +3029,7 @@ static void test_multifd_tcp_cancel(void) uri = migrate_get_socket_address(to, "socket-address"); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -3061,7 +3061,7 @@ static void test_multifd_tcp_cancel(void) migrate_ensure_non_converge(from); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to2, uri, "{}"); migrate_wait_for_dirty_mem(from, to2); @@ -3394,7 +3394,7 @@ static void test_migrate_dirty_limit(void) migrate_dirty_limit_wait_showup(from, dirtylimit_period, dirtylimit_value); /* Start migrate */ - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); /* Wait for dirty limit throttle begin */ throttle_us_per_full = 0; @@ -3435,7 +3435,7 @@ static void test_migrate_dirty_limit(void) } /* Start migrate */ - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, to, uri, "{}"); /* Wait for dirty limit throttle begin */ throttle_us_per_full = 0; From patchwork Fri Mar 8 20:59:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587273 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 3FE48C54E4A for ; Fri, 8 Mar 2024 21:01:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKJ-00041n-BS; Fri, 08 Mar 2024 16:00:23 -0500 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 1rihK7-0003zz-Pm for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:13 -0500 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 1rihK5-0001Mt-FH for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:11 -0500 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 428KTdwp014608; Fri, 8 Mar 2024 13:00:07 -0800 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=mgdMdypUQAUmzKfR9KSEQYGmNi9LvGBf2aXNiMo22 GA=; b=Z76jk4epxhucBLqj6Rk8VSaHrlo6ij+skJqYfvLFqLA21kh/C9RqaKlEL /0uePMD4smxAWEmd+gRiivB5nu4Jx1MRJOqCDV0bXXqci7+ItdPKwTQiBjCVTLr4 t0+LFkB95Wbf/nY5sytzq9sajeoHoqEMTZkaM9/HfR302R/pBM2RE9hKIBoqmrct W46jI4P15TToFN9DFpWSU/z8JbR1j/8YyQKtgLPxTdiCxvwL/XSkkxJotDo3sGKU W3xRQeMpfSwzgCtYBSCH+Sjs6iB+LCFQpDACiMLJkBzEewJ720QPvP3zMEnS5LPA 7vKpvgsqhkQFjvPVmAmuC/QPZ+Opw== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012018.outbound.protection.outlook.com [40.93.11.18]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm1avx7wh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VK2cqQBqu1o4mOkM+LpdmAzbtFbJom6s4nTBHZti7kXOd0SGhRWqsRu28osXDb8iWdKhM64KBteJC3xKqsbyYjXk872wZyJvotVXxk8/SWR68/HVGUazdZCkdUUqgXzTv+fZqcfcA2hOsYSaUZbvkWdmATU7XoHxuxtaF2s7QTF5nhsqAa0Wsbs4aQZV9h2C/eO+IHeBfO7kQNWqVt2c3yhGofjzs/sRyWe4ZYdHYAdUhCPu/b31RtddZj/npogMWapKMkEuwQCBTfAWz9qNCeDadKi0YiqOYZ+BSt6F3fJR5MoiWq1jQDkDQG4QRKvLJgYjcPzL7TZNSrDPC/BbuA== 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=mgdMdypUQAUmzKfR9KSEQYGmNi9LvGBf2aXNiMo22GA=; b=gx1SJH7ljz4QisqJXLUqdn0vJmnj23/ri8kdj7QfC2RjoysriGmhVZWUSuTjwzA1AbbxcbDMRhKYfqjSmoTeWO3wjtt4oRctFSAsFax/qB0xcyeKKovE0HaKkuG0SHslOZokBHooQsAhOxkkLWe0qaHP02pHZYcc+xk2Lx8bgqWVmlCxJW0y6dqnNFr/MX67pI6MN3kLIW4pplhh9cXJw2uZnnFAHQweTVR6OmP/JbatqAMVbiE0pRog7BX8awqZd/hie12kF3qgzYiTGpqfOoCsn8GkFnkJDIb6AA1ejL+R0r+/xBxI5Cq0ohUm2tfffPCCab9VvvihZ3JeyT7Avg== 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=mgdMdypUQAUmzKfR9KSEQYGmNi9LvGBf2aXNiMo22GA=; b=TxqmUZw7T1k6VpssaD7c4t3D6eSIDe1CzJGi6QK2YVg9b3zLjeYElLc1IfxdLKjiyjnVEWzGHEkdebhm3CavWIzEbbsHgvUw0tDNUukuLgjp3mWtO2LF5K1/GfQpVoV/J+ZG/ALiKOQcz1mZrUGwUF6YOp+OmlsbvNWPzh7XpHtx7frVKA4Q/t5bEOq1S5Qh6vfwM+WvRDPoGXKxVWxjHgxzIu/3dwADssG8v0Th2zZVhBin76h+HvwrOwseq05rrViT2NLiiLk3hrtR4N6heJzAuuJgEvgxEzy5ybtFhfO94xdZBHRRNounlXP0EBuyq+TlVmajGMLjb9HF998qJw== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:04 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:03 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 2/8] Replace connect_uri and move migrate_get_socket_address inside migrate_qmp Date: Fri, 8 Mar 2024 20:59:45 +0000 Message-Id: <20240308205951.111747-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: 7944b6b8-a791-4764-18af-08dc3fb2b9fb 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: 87EcAJp7lW9eNYSkOWRz8gDeN2801cSQulaOFjJdZhQwGN8B98PARBxV3aDXU4MT9Zpj9AXgU5d27V8sTDG1NiVFM/1i2M6bQAnnfXwv/UdJkXc/UAllMCEJHULMZks5Ad5ogT0dk7nxtJqvKIy4vYh9cOoS7oN5mfSNWMe/e11marjShb3vjo948QB3/rLGgqN2fsW28d3TSqwgfA8PRdr58OSfGmI3cAi6aaW8ukPg50Rgweswse52dXphSGOlw3t6yOIQyVK+p6QGSi3JlRGfAkXx6eqV+hib7NK2mkuG1IVoimnqAWtNDm9oqj04H2Pdgm0wGUlYZLKY7vQvARnPfqntHek1Q+cY3qewnK7CD0ullIS5xByZQAZzq4y+MlLglWJmr0SB9znAPN9gC52+KIIgtFXJQWyzOs4WPPhNG2DRhoOcRz46dl22wW+aTe2BSRQMGLIou2r1pgWhzyTm8HxHufaSLz8aoLavySMlX3Uz8isCw+l77WWSsdHDar8fQwqR0xUaCGC3CiNcyFkr/xunRPViMVfrLb2cmVXMEtxBmsYmzoRs6xxmKE+rfHapwdDLA4RboDmAcw7yDcG2zU+C+PivhmsnD4NWRBi0mzocWD53eBBYmnZixMgpVd9L8MGriYl7jRN250+XnZfgXDwdP1zrPGEhFDzjHZB1nrfAslkaic24d/c4ROyD74qfyQilYFKzsmU7bWxnNIOn55RZ8yQL1ry7jU9faW0= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vGjy7EBDzd8T6GKxv+H9NoMslBwYZdgum/iXxNOqtU10U4M2NmlMlt9DH8VA885uWLXZwzAYuJ7zao+RvD1jl2r21Eq11p1wo5omuThRm64tY4PGpI8vfF623wSNrBaSCRasYcVOgeNy3sJcSSQKTtcYOiCtyPHnrrwUDauyNuATpmS/a65+2K6Jfri2l8Uc+Pkee7qk0q94myNXJPvzmS/JGrN6J+BV6P9tlQeDARtDfQIFyX5dZlYHeZbPmNMUbvRXRw3LyGNzgb3rS9B6DzGVTeXerNFuVaEtUo+8Q0EZRfYUl5Lh7zwOBmj8gpvzt0MWnDNWwN6dhX8YfpqoosM8cz93x5MM/hyAM/YlCbOg1cGemlbdbTUjUQn7vHU3ICi6rdF7/tne3eSC/Mj2xVcfTBWq7WxmeqzgVuiRsKLxJxagU5ybGpDYACDSArK0yjX6Ks3r9fsNbKNLvWriS2aGx16XuHdJsnT89fGL7phHfclXbRR/wH0/ST9yg/zESdrVRJt7WUwNeY4vRKqT+mK2KIGonzFN+/FBlfWQkCV40PW19k+/qpM7y4ZAGYViY9JBdRpzbEjCqJC8VytCgO+dkdTju3+Ij9RcHV42o4h0lrCeIOmlAEdzcgUHYSS5/IfU6HjxxIMhaOp6r/7+89h6VqCqEIxp3lxrXW5IPHjsK8Qr+keg4QsLOJC85aCG6CL9Tqv33IMxMxZAhP8BI5tbS24ZnELQiAkPDFCxUWhGpZ0hyGjSy1EWSr1Rf4KBBw7gV6ztCRIWbhIKLJekNkHhiGoJ0ML6zMleED/WSIyK8r0P6aIBYBi+6vVVOzylZGcYsjlSCqSWQ7dwmptgzJZ4MBDJfH9VIONFvsvl6078rNJ1Gyi03z8t2oeu3UNu2d3vTosKP90DRKEUu9tVT6wJkHYC1aZC2+JGCyYKXwOJSyULS447fuTmPBn4dvt1bRG72WuqBshGnQIipM19OSax7+ad+y4LgfvFMKcbolTY9U+F1XehGpY0pvQD7i8Mqq4SdZGELV8aQzP2DvRuomZ73SwZeJEnrAe0DCxYh924Cc7GCDDsjqxWON3cqGSkJPxHgDq5bucbSB2+Yi+6XII5PmD5VbjgnX9YjJMnHqtALvv4pG+AR01i2nMtJaQ74dnQ3H3h6n0Q1KXKWpYD8W+O5ll/WQrAM2/IeZL5jl40volLAlKlASI0NesNKJCdAAQp1vuJ4toj53upQI+rqjVu2QOdNOBoK28ifma1jeIx1KSsyt2qyuQDZe1l4UIDdPvRTGAHX9MxziCwh8OMYsci1oxTygQ4Q+hCPVlp6oUQg+/2mzjmU2MnKLyZy6Kd4sRBZaxOtodfwgAG3DWVQc1YZnd3A0R3+8U4qNyqWSAV53aBMce+kAFQDI+8ZEAv/FwLfNoe7u2xSDmVrSsh2dG0yyflgN7uCa+HBV+NuSOZ01ymzCC7XxKMKGuQPPQlbgUvH7UUr4JbAzuihbRWp7xJd8vSy34R0Wh9z3AHTI+ZTNdp9dsq2g81iIrdPKpelULISAVhdX7rGqY+OBP6LOHsela2MompSYLvosJmCXW/e7QjhPOhgK2qzWdsdYBy X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7944b6b8-a791-4764-18af-08dc3fb2b9fb X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:03.7854 (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: swvcE1W0cAstGaOb6BCXgV96UUjnmnktRRfKvXZiVyhMQtxYuC/8ms+BiAbsjZiMpZOdZ80kvMJZenMLU3QmZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-GUID: X7hacLi52aARbKo2Pjq2gn3ZhHjpxhkZ X-Proofpoint-ORIG-GUID: X7hacLi52aARbKo2Pjq2gn3ZhHjpxhkZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Move the calls to migrate_get_socket_address() into migrate_qmp(). Get rid of connect_uri and replace it with args->connect_uri only because 'to' object will help to generate connect_uri with the correct port number. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 55 ++++++++++++++++++++++- tests/qtest/migration-test.c | 79 +++++---------------------------- 2 files changed, 64 insertions(+), 70 deletions(-) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index b6206a04fb..9af3c7d4d5 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -13,6 +13,10 @@ #include "qemu/osdep.h" #include "qemu/ctype.h" #include "qapi/qmp/qjson.h" +#include "qemu/sockets.h" +#include "qapi/qapi-visit-sockets.h" +#include "qapi/qobject-input-visitor.h" +#include "qapi/error.h" #include "migration-helpers.h" @@ -24,6 +28,51 @@ */ #define MIGRATION_STATUS_WAIT_TIMEOUT 120 +static char *SocketAddress_to_str(SocketAddress *addr) +{ + switch (addr->type) { + case SOCKET_ADDRESS_TYPE_INET: + return g_strdup_printf("tcp:%s:%s", + addr->u.inet.host, + addr->u.inet.port); + case SOCKET_ADDRESS_TYPE_UNIX: + return g_strdup_printf("unix:%s", + addr->u.q_unix.path); + case SOCKET_ADDRESS_TYPE_FD: + return g_strdup_printf("fd:%s", addr->u.fd.str); + case SOCKET_ADDRESS_TYPE_VSOCK: + return g_strdup_printf("tcp:%s:%s", + addr->u.vsock.cid, + addr->u.vsock.port); + default: + return g_strdup("unknown address type"); + } +} + +static char * +migrate_get_socket_address(QTestState *who, const char *parameter) +{ + QDict *rsp; + char *result; + SocketAddressList *addrs; + Visitor *iv = NULL; + QObject *object; + + rsp = migrate_query(who); + object = qdict_get(rsp, parameter); + + iv = qobject_input_visitor_new(object); + visit_type_SocketAddressList(iv, NULL, &addrs, &error_abort); + visit_free(iv); + + /* we are only using a single address */ + result = SocketAddress_to_str(addrs->value); + + qapi_free_SocketAddressList(addrs); + qobject_unref(rsp); + return result; +} + bool migrate_watch_for_events(QTestState *who, const char *name, QDict *event, void *opaque) { @@ -73,13 +122,17 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, { va_list ap; QDict *args; + g_autofree char *connect_uri = NULL; va_start(ap, fmt); args = qdict_from_vjsonf_nofail(fmt, ap); va_end(ap); g_assert(!qdict_haskey(args, "uri")); - qdict_put_str(args, "uri", uri); + if (!uri) { + connect_uri = migrate_get_socket_address(to, "socket-address"); + } + qdict_put_str(args, "uri", uri ? uri : connect_uri); qtest_qmp_assert_success(who, "{ 'execute': 'migrate', 'arguments': %p}", args); diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index d9b4e28c12..01255e7e7e 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -369,50 +369,6 @@ static void cleanup(const char *filename) unlink(path); } -static char *SocketAddress_to_str(SocketAddress *addr) -{ - switch (addr->type) { - case SOCKET_ADDRESS_TYPE_INET: - return g_strdup_printf("tcp:%s:%s", - addr->u.inet.host, - addr->u.inet.port); - case SOCKET_ADDRESS_TYPE_UNIX: - return g_strdup_printf("unix:%s", - addr->u.q_unix.path); - case SOCKET_ADDRESS_TYPE_FD: - return g_strdup_printf("fd:%s", addr->u.fd.str); - case SOCKET_ADDRESS_TYPE_VSOCK: - return g_strdup_printf("tcp:%s:%s", - addr->u.vsock.cid, - addr->u.vsock.port); - default: - return g_strdup("unknown address type"); - } -} - -static char *migrate_get_socket_address(QTestState *who, const char *parameter) -{ - QDict *rsp; - char *result; - SocketAddressList *addrs; - Visitor *iv = NULL; - QObject *object; - - rsp = migrate_query(who); - object = qdict_get(rsp, parameter); - - iv = qobject_input_visitor_new(object); - visit_type_SocketAddressList(iv, NULL, &addrs, &error_abort); - visit_free(iv); - - /* we are only using a single address */ - result = SocketAddress_to_str(addrs->value); - - qapi_free_SocketAddressList(addrs); - qobject_unref(rsp); - return result; -} - static long long migrate_get_parameter_int(QTestState *who, const char *parameter) { @@ -1349,8 +1305,7 @@ static int migrate_postcopy_prepare(QTestState **from_ptr, wait_for_serial("src_serial"); wait_for_suspend(from, &src_state); - g_autofree char *uri = migrate_get_socket_address(to, "socket-address"); - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, NULL, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -1733,7 +1688,6 @@ static void test_precopy_common(MigrateCommon *args) { QTestState *from, *to; void *data_hook = NULL; - g_autofree char *connect_uri = NULL; if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) { return; @@ -1766,18 +1720,12 @@ static void test_precopy_common(MigrateCommon *args) } } - if (!args->connect_uri) { - connect_uri = migrate_get_socket_address(to, "socket-address"); - } else { - connect_uri = g_strdup(args->connect_uri); - } - if (args->result == MIG_TEST_QMP_ERROR) { - migrate_qmp_fail(from, connect_uri, "{}"); + migrate_qmp_fail(from, args->connect_uri, "{}"); goto finish; } - migrate_qmp(from, to, connect_uri, "{}"); + migrate_qmp(from, to, args->connect_uri, "{}"); if (args->result != MIG_TEST_SUCCEED) { bool allow_active = args->result == MIG_TEST_FAIL; @@ -1843,7 +1791,6 @@ static void test_file_common(MigrateCommon *args, bool stop_src) { QTestState *from, *to; void *data_hook = NULL; - g_autofree char *connect_uri = g_strdup(args->connect_uri); if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) { return; @@ -1869,18 +1816,18 @@ static void test_file_common(MigrateCommon *args, bool stop_src) } if (args->result == MIG_TEST_QMP_ERROR) { - migrate_qmp_fail(from, connect_uri, "{}"); + migrate_qmp_fail(from, args->connect_uri, "{}"); goto finish; } - migrate_qmp(from, to, connect_uri, "{}"); + migrate_qmp(from, to, args->connect_uri, "{}"); wait_for_migration_complete(from); /* * We need to wait for the source to finish before starting the * destination. */ - migrate_incoming_qmp(to, connect_uri, "{}"); + migrate_incoming_qmp(to, args->connect_uri, "{}"); wait_for_migration_complete(to); if (stop_src) { @@ -3006,7 +2953,6 @@ static void test_multifd_tcp_cancel(void) .hide_stderr = true, }; QTestState *from, *to, *to2; - g_autofree char *uri = NULL; if (test_migrate_start(&from, &to, "defer", &args)) { return; @@ -3027,9 +2973,7 @@ static void test_multifd_tcp_cancel(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - uri = migrate_get_socket_address(to, "socket-address"); - - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, NULL, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -3054,14 +2998,11 @@ static void test_multifd_tcp_cancel(void) /* Start incoming migration from the 1st socket */ migrate_incoming_qmp(to2, "tcp:127.0.0.1:0", "{}"); - g_free(uri); - uri = migrate_get_socket_address(to2, "socket-address"); - wait_for_migration_status(from, "cancelled", NULL); migrate_ensure_non_converge(from); - migrate_qmp(from, to2, uri, "{}"); + migrate_qmp(from, to2, NULL, "{}"); migrate_wait_for_dirty_mem(from, to2); @@ -3394,7 +3335,7 @@ static void test_migrate_dirty_limit(void) migrate_dirty_limit_wait_showup(from, dirtylimit_period, dirtylimit_value); /* Start migrate */ - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, args.connect_uri, "{}"); /* Wait for dirty limit throttle begin */ throttle_us_per_full = 0; @@ -3435,7 +3376,7 @@ static void test_migrate_dirty_limit(void) } /* Start migrate */ - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, args.connect_uri, "{}"); /* Wait for dirty limit throttle begin */ throttle_us_per_full = 0; From patchwork Fri Mar 8 20:59:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587276 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 DA756C54E41 for ; Fri, 8 Mar 2024 21:01:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKH-00040m-KX; Fri, 08 Mar 2024 16:00:21 -0500 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 1rihK7-000400-Pn for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:13 -0500 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 1rihK5-0001Mw-QI for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:11 -0500 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 428KTdwq014608; Fri, 8 Mar 2024 13:00:08 -0800 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=D6pwOOA8PZmMCPSgheOx4+TbsL1bCZHQyVY0ngB6k X0=; b=oNYtgX1DWUvRHRZTUmLMe4pNc9ZGQPLOyA+u+usmz7Ywb+QKCblJrsye5 gbf2jLZbOpqXuaieY97nYiWRr3LKHamxszVaNhPX0eKs1qvJcLmC2QT4Hpd1fRDZ stSBdq6pwZUI1kNDR2puw2G+swwlI5AvWck4G+1xSjdb8mLM0mfM95nEP7Q9/bwW Nj9corqa3/zzRMcBqY32us3kaQcyFZ96lmcuq58qk9trQaSsJtCHCk8xyxnJbt0N 0UrfgNtJaNBCj+Y8OvHw6qtlJu0PYNWCI3UtRqqmibGecARUjYVDQJgC98c+UpaM qYz4hUWZYp155tb+9iOeLnJwYmRuQ== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012018.outbound.protection.outlook.com [40.93.11.18]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm1avx7wh-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i8w+SywRdO+4Qp/xTCGuCgN5zGMUThkyCydNafRZ9xM1gubtJSZONrcsLGvy0nf5UO1o1blgSbayooCaBwAqF227ilfwvgL9O/x73EKb0NPO3OV2r2IlSVRUGZDoTesl6ftGcE8Ak975NwyJZUgGPb+q9sw1E3xZYlrHaFb7/KTqcMHaymEQDiie/Mcd2g9OdnJyKpn02lffOEc4UM8guc7FTYl81VSO/GpcKUAKlhXF1a8BLIsO6YVB7tlHBlE09PnMbNnI+xjaIGYk6qSvJIWjJTTII8TuboV2MJqUrABi2w4sKO/HJCL/8hLjuCc+/FqWSvgJ/CMgCH1Sb0t6Pg== 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=D6pwOOA8PZmMCPSgheOx4+TbsL1bCZHQyVY0ngB6kX0=; b=Wc1W5/KKw5JRdh6EL3aV8DmLI/yKlOCIaV9mZ0CkujhMekcOb2FAC7hrwWbF6WKcpTlBYUJ8SssJ5ihwKmkFcW1T+PmqowaueSyJ1Es9xq7syFpIf42RXGrCikwmoRsOFn/BkUuaVldic7tGeER5b/baC8S2eUTdyEQXUf5NWOI1lQnuwheLIDgjmj9Tb7IUwqYDF30t/FyPisOfaz3Nr8lY6/0k7DBRkMEoTz2qPpyWEr8fVknJ+jCNiyHl9CN8hWKsP8CWulOvyG/cG92RzNTnZ09x4bE8UNlD+Zbe6+8T/Fv2n+ShAZfoD2su9V3+4t48qZmRBC68PmmMX9Nmsw== 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=D6pwOOA8PZmMCPSgheOx4+TbsL1bCZHQyVY0ngB6kX0=; b=ahs3ApxkCVBH82kTuOutIRspagDh6GR83Q8XcfNpUQO7c5LU5DUQouTzvd3TFSOZx5hOIJ/fStu/rsnLLNG7bS9l5zox+Lw+2zumwLQc/qnjkXk8IC2fzM2YUEiSwLMOyiqt6DOFjZE6XEZff093E+iAFUb89YcDsljenP7JC2+A4qC5DKrKvz3Wpeb28VABsfg2dojJ7ASYMakSLOxJ1OGSExbWZqmrF1zDdbbISOZyxw2Uq/5FtawCu+2cniXzSx7FV7niocnQ5Yvrxl1UHq72SHeIN3T6lX/hY9wWhzmJy3SFkzzNdcmXlVlH4FI5xCBh9e5vmHkWsKa5NIV+Sg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:06 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:06 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 3/8] Replace migrate_get_connect_uri inplace of migrate_get_socket_address Date: Fri, 8 Mar 2024 20:59:46 +0000 Message-Id: <20240308205951.111747-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: cb27f264-7153-4ead-28aa-08dc3fb2bb9f 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: iO1eP/VTNXR4m9FgFgEeYqLX+RLrzTV/WPDusvfTZwi3E6gvfZywXbsa1OQVbdrRc7PMg8uIU6yO4sIldzqN4SIXn7fiEVzNpTV6y/TcHwtfZomiuxJY9YOxDZU4/SQF5bjH5ytSQGZ636reXzqYfAbDlZtqorZTxI5KIc+4Iv5qzidSRKOKS+uSFTltD/PDNhnRK8cQMWVtHAdJxX7E75qP+GbcydH1sV6dAfM4JfgV07Mq9Sn1FK/ly6asolXD5gKfg9LfpSeoBBbD+2LK3fsPwAVpv+BjP0ct++eXyzfrzHsIeb7VOo5r1iGfFDOkKGoN+43u7F7bGxqi7n8R9MP7Nb7pEzUh0pgOB5GXIHO8f1QCSJd8FsTU2KkyKt+lb7jIYpV3wviCLWAWlu3B9R968nXLG45sD7adbjJXfE1FEz72r9Wyvvy5UNwYAVgpadTdodKWunH7egXApd84VrVKiCmhYyRQLt8mVchPxP+9ArsUGjGhOsHCtxG0OHsQ3JSnj6ycEg1Ji2tl9HWaUuF8vIkf3yCPAShR6ckKbPj4yy2OfAAxfOaM9trml5HXoR+EQceWHb2WGpvpz4hRS284FtGrC6Wu88LB7qwngVds6e1D02mfPhfMF0l2rdUFi1typEIBFD2YZfwvKPF3ngLmN/7DV9C8GZQMMWAf2Xemia+qy8swFtBBIh3eoGaVDF0b0wYsGZOh33gxjg2XfleMCRGbPEsAa8+sRfWsZuQ= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dTg4HlFs4rIQZfIlWMu+AnjmjCmRMMH/ryZn9rzR97lXz7CQQEGQn1Qjdp6kGUzeVzehIvJYv9FnKVty3QbRwqluZITSs8gUnqT+EDz4dU2rUp8lqmacp6PrnIrMKCryRj5TNUcAnnkz0Ijb8AaUzh8YlzGW3EzC7BrYJhVS2MZbbtZPrlJHSV7UKh2D51i3YPG9HobCh+eDfmuJkoGCzgSO3QrlRAqLz1aJ57CB7eI7X79vD2g8qeUDhtGTk7j7awdZBVPnkkB//MTrKIlpdjo92jvTiv+4aaG6UtH2soT1BpluYm443lwXmjeHf76Zl+WnzFt3cOE60z2L+GSkKHoRzf0wvmSgb1YUOkskQPx3dwxzpRcvIf9JXwNB3dpglJxjm3MWmNDJvx4Odps8ahEXSbk/Z9W/MRZ0hnQIMT0wx7NOtTU1ziuVemVxb0Y4rJTeMX+3DA2NDYMJl72/2dvadpeRuMNwgNBYH5SCXS44Gd7XuT7+BU02Z0QQzNKgJKBtI8ei8mr9QnHbjeaJC+/mMITYsWL3g24gMT1f/8PX//7jonZdw+UeOa1YIon7gPr21geANsB/IxE4cifv8ThIGfKnrqTphUPvGrhvOPieH417KS2NIGxiJk5ZhfzOPBLYU9hAsWBBPFqeUUbCwCwIQnswbeIC9apSU+P98Xv0fiMBqniughR2nsKB2i1MB7ewfFvxtJ3QrCCphTV2Don8mnqAIlfsVEo4LFGFBFCZpPsNH5EZ10MAJKlHn1LUkKEX2xcrUuwiqkkGYufzp8sqvszG/TkQeTKmLJqzYrNAqMpoGufnAMkxU2XsWA0o1PWfbJ6JxIxH+aeqnFwi+J0Y3tTm0D9Ce0q9IYeoq4UOADJdmQZAjTy5X983eMULWPdPbWM73RoOlM2EvTMWgAXv60wQ2RaFcPh7CZnvFnWQuyJMvUbNE8TCsEKBdkhyJMiz5N7qM+Csf+aYbN2YU164aURcUd5P05NKXjyWV0hMyKXlZu2BNy4Zm+R/yArsvnYE+v2Lpkj0AU5bH6GPvtkpJb94WiP4tGdK2XjkelAi/xPmMR1HjNXuWjNC0ojJhqDi72Fb3c4Gp5A7kyz9SXZKx0ntUrrKEOywpSYORXwIfAF/62+wAETeEOFr4QVZCSKA4c17FPjRvLY6jnZ0Hsgt2gfUFr0JYHQuoabvdwOTq2WRDsEkJmxdLc09DsdyDWhzIlzc/0A4q6A6xdB35yFw8XG80BeJ9YcfWAVK0iPKry9aejPwVU//DPYjBQMMcPZPa6x+zY5gVQ74qyY001TRQ+o1KTwtpE+D3XdV9IzDMDHU/4mGVIa5RLlWBzDm5YwHZfpDGuoGBo+I6BEK9rpWhFOq5uN5tqo5DXHW1M875lewOA9yv1zG90LSxQpSF8SsVN1r3orxxHqe2KpC91kg9ikljJHX+7xdBI+QTEVL64+wGfClKivNU1/vGKklI/WdO0C3dsXdQIAiIWU9ryvBtAnbfBoVwnpkNPJ1MkT/EBZVetDl9YbCX/YWOGaBYOlg7ysXLtWQlRFb7Sklueh50Y6pcwgt2eQy0wGq5kIvW2KCReI+0wghoE40AXJC X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb27f264-7153-4ead-28aa-08dc3fb2bb9f X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:06.5398 (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: yMZgNODb/W8S5Se27X5ABR90kwGR1mvS4kZRGElipihwWFuEUP8MD2aUB/5A1hMnMLXE+ZadFLpaZE3m7SU9Wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-GUID: Z83M07EUo8F5OtW8y5gWbHSgHn75SnGp X-Proofpoint-ORIG-GUID: Z83M07EUo8F5OtW8y5gWbHSgHn75SnGp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org migrate_get_socket_address implicitly converts SocketAddress into str. Move migrate_get_socket_address inside migrate_get_connect_uri which should return the uri string instead. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index 9af3c7d4d5..3c3fe9d8aa 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -49,12 +49,12 @@ static char *SocketAddress_to_str(SocketAddress *addr) } } -static char * +static SocketAddress * migrate_get_socket_address(QTestState *who, const char *parameter) { QDict *rsp; - char *result; SocketAddressList *addrs; + SocketAddress *addr; Visitor *iv = NULL; QObject *object; @@ -63,14 +63,24 @@ migrate_get_socket_address(QTestState *who, const char *parameter) iv = qobject_input_visitor_new(object); visit_type_SocketAddressList(iv, NULL, &addrs, &error_abort); + addr = addrs->value; visit_free(iv); - /* we are only using a single address */ - result = SocketAddress_to_str(addrs->value); - - qapi_free_SocketAddressList(addrs); qobject_unref(rsp); - return result; + return addr; +} + +static char * +migrate_get_connect_uri(QTestState *who, const char *parameter) +{ + SocketAddress *addrs; + char *connect_uri; + + addrs = migrate_get_socket_address(who, parameter); + connect_uri = SocketAddress_to_str(addrs); + + qapi_free_SocketAddress(addrs); + return connect_uri; } bool migrate_watch_for_events(QTestState *who, const char *name, @@ -130,7 +140,7 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, g_assert(!qdict_haskey(args, "uri")); if (!uri) { - connect_uri = migrate_get_socket_address(to, "socket-address"); + connect_uri = migrate_get_connect_uri(to, "socket-address"); } qdict_put_str(args, "uri", uri ? uri : connect_uri); From patchwork Fri Mar 8 20:59:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587271 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 41F5DC54E41 for ; Fri, 8 Mar 2024 21:01:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKJ-00041j-7E; Fri, 08 Mar 2024 16:00:23 -0500 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 1rihKC-00040R-NO for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:17 -0500 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 1rihK9-0001Nc-OD for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:16 -0500 Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4287jeWZ031057; Fri, 8 Mar 2024 13:00:12 -0800 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=ZKX6PmgyWUejQgGzS6eT4tHbeRPAJ7rFbqSxbXSJl Hc=; b=E7QxIV9Yxr0KlE0P0gJpn9Tk2HFX6SFjBaz6H5YpxpQ0v7flZRPug2K4h wLUfCe+V46h00tyqHvRyVJuBH4wDaW3Z5le7LmNJ/W+/1nLE3ubGhCRUCmejSBwj 436sfX3j1M4kqYf0yHy/PUseXyw3OJWTX52e4mAZuK41fC7EGC7g2ROAiRMg6CnO oqXVdPgMS6REDFaZrXpRyuA9W6ezZ8b0wkB4CgPPbeXPBwOwEAgJs11km7R6+3PW fI/ukELH2GvCSySw/x15xaZR7l2VUTxtL7ksnuRMaRlnixdQTLXxIinn6sCo5jtV WR1dGJ8rjnpCUtHAnz/bKiclN5PZg== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012019.outbound.protection.outlook.com [40.93.11.19]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm42hp1m1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lrLHg5nmA9lItsWrNvk9JgeujlZ0rOQyoOO0260jsNjPOWpy0LSHx/yxFNZzumx/RqIVUSr5LAtg+q1aNbrB9sNVNj2UqLVNfBv9ofUfDcebMvVg/Tb7PUmGRPB+R7rUi1vMKVZvOoKCCGYqb5No59UCljG5Ve6Cr1uq+Kh3NvBcQkQ9eME5VKVrSA5iHo0A1vd7XmhDtF7SRj568Vepr+3/7WaBHc1S9kz83PSXFgpGgKHzFv7gG0xH7MNYZhWGL4Zu7E5sNrq/eShZsg+LeGo7yqh8I97qUOjvJv9Ac/u3zeI2OI03MGHqD4QTX6pMXOoG0ykMsaplEMZhHmUPng== 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=ZKX6PmgyWUejQgGzS6eT4tHbeRPAJ7rFbqSxbXSJlHc=; b=HJlmASri/eemrUtnGuFVrAmp0DR218MlWc1yjQ80MJz4hPWFgaVTX7aKTv+3hDhabf2MYlYd67DeAVY1sZDrhXHp0337uG4HpF2fR9hUXNVnu9SQr9vz1bX0S1uzi/1gu8j2IA06VdXMl7PQr3qFjLu7CWJgJa2rViTit5fkeBk+nss77E5EHAV8kUwF5VGwO4dd343QL8RQ9YBwVRXQveDlIOCArxbtjd4FdMgO+eh/9jE+JXjKmL/dcoGJo7+hd3RrYiKQ2E/X2YVopU6PENunpfaonryTd0s4rAFk06olMCjebsM8lRzg0qESr7fVcpPahJ46E7PGh8Bl6wg6/A== 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=ZKX6PmgyWUejQgGzS6eT4tHbeRPAJ7rFbqSxbXSJlHc=; b=CZ7OzJTw6VEOqnUR2t7wpIsLXxHcxXFbqJUG7ww6TYoDFewsGShP7iePgEbVdAZJMfBkG4DkE/fnvj4obTaZpm2FS+e8dfopoMe279m95hIWisGvJkvreF57paFALficJc49CLTUQUPD6Jn2vpGVoNHrPAuJtDvK0vzOolVfe9zEN71M/qIxScz7TLFGPCQ3nJj5HA0qYxiBNFsXXwMADGq4VaS4XhO9w3ussg0mw4bgjzdwFxLVER6fQXMnMDiqIUAQhTLAXYvjRAlZUnfaEwnRmBxhYLm7l5e55w6e5hHkyYJCdUN2bgd7BhgM0d4gdz9FvylrOHzL1/I2mveWzQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:10 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:10 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 4/8] Add channels parameter in migrate_qmp_fail Date: Fri, 8 Mar 2024 20:59:47 +0000 Message-Id: <20240308205951.111747-5-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: 2df25f46-2044-4034-bf39-08dc3fb2bdac 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: Fcdjv8lYy0TxTElXAgjgbPdxXPXhNxmfPR2v+K1rHi0NrHjQjoEyDnSAWNJM2Wa7dZjag8nguSbXN3fNfMCmu2xuhbYs+rIFibBSQ7td5OYElGnEBLVCjgf2pAsPkF9KYZiaKwxAGScYfrgQdPN6+bOrScmBOwjJZ/7/ppGPDuavXQ1IWe30J4Pd12DB2Qcf/UJ805QZTNO+AAE+KOL9YsgYPBvsKmVfm5p5rmogmKdMpHT8R3jlyzIBKZ/N2eetmpD02GHP/uVqk3zOW/1MsuISqOe6AqUs+jlCXpiROpGhpDh4GcBbej4hdOPXJJm8WCNFKTNpTFLMPvBtyNm4xim/CeCAjRXRl3pAynWBubbqakXd908r7tWdjnElSuphAZmZchXC04hqjA9MlUiYGGBk0jetohXsHL7cRZsE93rFwOytxJdRXiEC3jaP0DAIwW+WEQrhRXH2Y+0zZfzkR+DezrO0DoZk4u7GauhS+cs8BkFqP7EGlT2AC+CVuTcrdwWLGAjmLk1vELcfOjBdcQut0xfbPuOPh7LfPhLtdyBgscrrDKEXgXJyoW08noLT5Q6FpRTrgQPqHv9CX6LthW5D0f9ARW4wW+7Xh2L+XAGLzvjJovp41H7Rc1JBfdqDeTQ1zoE9mjaHxxyOc1lM2RiN+TaCXXzgAo4nQa4kk2bO37BgkNBA0jAXuMdB/bn4JuPPLCNY27nA7mq7B9IjMAcdy99SQjMYL8WpklpgICo= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RYOzJAOeF+7x67zLjwbMe49qZ/EXG5Xin1qHKc1Cc5Xx1LBou8UQ4nCVnf/PmCH5zi7B1wM1KjgWC5CFI0c7jP36FX1xBG08McQGFyI5IYHbrDvqCgGnCl74RHlSQRtOoucoenfyU1ABRmx8aF7pVAdCBWIlYSUFUaU++IiyCQW5sx6EPPBafOdPP21fktKxFnZyHge5Un0NOWDzw3W5khDr+tL40wbsQYblpc6Q+nurWNQmDBlpN8JBwl+GUxaekVB9moSW2P3FIns3VzNFaGbWuJXkVRSG2wF7wD5WJVXZqAQJWQFkAVVj+NZNUQL/xLSgMcfwHlUXm4ss6NRC5M0v97aKq6NDFVdoF92VEaNTuauEvRAn8YOnZWLjvSgoyHZcao1MfRv0tl8XihwHFFoYthFqfqzECQjtdv9wiuWcc7XZgeGIUhEzc3/lzkERaMJyEG5oJH2xuHUBKKqXgAOpWpFwfEwn6hC9TtToXZscj8Ij0xkQekeHJvbB0yPcWCsD4Ljz11IpXykjSsYPlmj6U0bkgyRaLG8CFoM+7+EFCWcBZnmH1qaAhK4OmoZ9vyqDOglbocMeQlDDZUMSkkWx28Vd14rSIx6Ecz4VlF09fMJPjpNx5STw+A6UmrMsP+tSTtOljp9hWzB3TuYTMTJgVT/954wlziZtLuHK05voP9WjWcZBwSAivj9foHTEU3+20qtfpYMYraTw8npykXrr625CFxjOQh5etBGLq7tTHtuxuMvAvODlN9XozKZPoyemWTe3hYr/ZQMr3BBkW1DpW8pNsJzGy8i+/boFTrwSJ4PWM7OPJiIOoIDqhhF/r1SVdNX7AnV96WEuEdUKoNZb2N+9C6xdajSdpijFwXDKHRJ/8pV4FxbydQ2HREWWvaIWo3dRbG4oP9JlfNyx89EL1RCnajC5GU5nQPP08dt8casia+J+Mei+YP5UktB9RKz+o8dnVHyvW6K/3X6RlwLeyDl5yl3jfMWC2RvZA2Q2E9MVb4Smlkf5Vz9thXboWkbh1C0M3M6Fnp8TgXK82GYW4w+jNNNZIa6r/6+k3crfZJ9p8GEu5udZ5EucG/UsYgMjiImVLdUyKFxjr3FhFJE7yyhm2cLaYIV5PIjQTfyOr+ja6ehyuAD1ODMk1pVbnLFFlT6OJaW13bAUnv8x4n3eQGz7R8Zoqcx8wP+Nwsp03KWs5RfSFOYjbDwjDeZRe3eQWyHnKnOKCYPRZux+dJ7CinHJ8CQDaCSCkhgsdsUzkQPP8YIt5jvhgaFNm3Ce5G8nP0QYFqGcI5ScPfrj+6x1HBLpb4DnJfiPYg5JcN8EOIkuam+Qdt3aZIOFEGht84XItGZoaZCS3sB/Kz+8peosdH2a6NvIQ5WdnpMvJ3ifKndCWf+b+ZKpW5fP9R0+Lg7xVX3At48OHU/8WZuEbGlb1iduTnzbWEFnH+pbcIzjEAp8iLY+3ikNvskx2rK2Fuq07C3552QWzmP7F61nuLEeKzVpd6oTBn3uzf7OXByiySm3WB1mvAzR05N9OdVKUBN0DADetokonn97NaOXIb8SGrp50y0XqR/Qq40sdmwqCG0ItiJ6YmHXTaRUofIN X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2df25f46-2044-4034-bf39-08dc3fb2bdac X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:09.9856 (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: qHLYJ6R8NNsLruc8UM/4E5VouxyIGmmrAJt7oP1wxLcZoN5ZhiYYTE0VHoqWU5OMSGJJn+dXrpM4PtnuV7hAzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-ORIG-GUID: XvhjonXErEAnUb5p8AJvZN1M1oL0WTHX X-Proofpoint-GUID: XvhjonXErEAnUb5p8AJvZN1M1oL0WTHX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Alter migrate_qmp_fail() to allow both uri and channels independently. For channels, convert string to a Dict. No dealing with migrate_get_socket_address() here because we will fail before starting the migration anyway. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 13 +++++++++++-- tests/qtest/migration-helpers.h | 5 +++-- tests/qtest/migration-test.c | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index 3c3fe9d8aa..91c8a817d2 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -102,7 +102,8 @@ bool migrate_watch_for_events(QTestState *who, const char *name, return false; } -void migrate_qmp_fail(QTestState *who, const char *uri, const char *fmt, ...) +void migrate_qmp_fail(QTestState *who, const char *uri, + const char *channels, const char *fmt, ...) { va_list ap; QDict *args, *err; @@ -112,7 +113,15 @@ void migrate_qmp_fail(QTestState *who, const char *uri, const char *fmt, ...) va_end(ap); g_assert(!qdict_haskey(args, "uri")); - qdict_put_str(args, "uri", uri); + if (uri) { + qdict_put_str(args, "uri", uri); + } + + g_assert(!qdict_haskey(args, "channels")); + if (channels) { + QObject *channels_obj = qobject_from_json(channels, &error_abort); + qdict_put_obj(args, "channels", channels_obj); + } err = qtest_qmp_assert_failure_ref( who, "{ 'execute': 'migrate', 'arguments': %p}", args); diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h index e16a34c796..4e664148a5 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -33,8 +33,9 @@ G_GNUC_PRINTF(3, 4) void migrate_incoming_qmp(QTestState *who, const char *uri, const char *fmt, ...); -G_GNUC_PRINTF(3, 4) -void migrate_qmp_fail(QTestState *who, const char *uri, const char *fmt, ...); +G_GNUC_PRINTF(4, 5) +void migrate_qmp_fail(QTestState *who, const char *uri, + const char *channels, const char *fmt, ...); void migrate_set_capability(QTestState *who, const char *capability, bool value); diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 01255e7e7e..61aa53c3f7 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1721,7 +1721,7 @@ static void test_precopy_common(MigrateCommon *args) } if (args->result == MIG_TEST_QMP_ERROR) { - migrate_qmp_fail(from, args->connect_uri, "{}"); + migrate_qmp_fail(from, args->connect_uri, NULL, "{}"); goto finish; } @@ -1816,7 +1816,7 @@ static void test_file_common(MigrateCommon *args, bool stop_src) } if (args->result == MIG_TEST_QMP_ERROR) { - migrate_qmp_fail(from, args->connect_uri, "{}"); + migrate_qmp_fail(from, args->connect_uri, NULL, "{}"); goto finish; } From patchwork Fri Mar 8 20:59:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587283 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 A71ADC54E4A for ; Fri, 8 Mar 2024 21:02:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKM-00041v-Dp; Fri, 08 Mar 2024 16:00:26 -0500 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 1rihKH-00040k-9e for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:21 -0500 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 1rihKE-0001OA-Mc for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:20 -0500 Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42879VxH027209; Fri, 8 Mar 2024 13:00:16 -0800 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=oxXS7ilsFL7Qmb9HQn0iaf0NcFrcYOnRNDxX/B/1O G4=; b=vGjhYnZZUiboUkfUC3E12jCJ12cKNb+n4B7Rdrhqnbdb0S3+S+pUlAMpg qoeWToSSS57+JX6g2JD2mKSUfpB9+S82sGBetuG2bmwuDViSroOeCyH0CPjD+lm9 3wGLhBBVNUUUGqOu0Eeqfo8h0UWONfZJNrUuHSlv+L+IEe3bBz+YIUt6Fwy+wiN8 cAxPe0xMfqXxC42SGTvNQbjNqi+yFfxX7h/eIZGpREwQGvBHcPF2KKip6n9Ef2LY +MzKhEy47OhYIf7XV2jpPN+2P/CPc3loWQIWQyA91q6uqt1quVdP1+GkjVLV8wEQ 7X4h9xBHw4AvTKelm/exz8qqedY7g== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012019.outbound.protection.outlook.com [40.93.11.19]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm42hp1m4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mMHv4wey0svVCZXPxIeZ+E+mHomTCAhmesgJEjz7JgSj2D+bzzWf7BUUk4mAoDvLN46mr8ZSN+TjE3naKcj68FdednY6zI5uITxcNbjcq29RS328NzRhntxyxUdMf78J+1EyDUO+WgOfM66EwcqKJ+GQ76/HXZZGUYoL1iY2nSuWdAK9ImKoOCryoHmgRbR2ltTOqls1CvwJ5k7Y2143CJN5verU26ZcDet8PCg3sNpjLP6oVv5Mo44d+zMnt2v7A6Lhyzb9Of95Ax4EYwTmTzVNF4Ksheq7THr/kNrkq0CQLTdOVl4Rg55/fK3NVEO2v0MwiiXZkgC4gPPlkNBPDg== 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=oxXS7ilsFL7Qmb9HQn0iaf0NcFrcYOnRNDxX/B/1OG4=; b=D+bLnq7w5SyH5bJPGuMPrKgNd1AlCfXr/OC7fcal2LWhch763+PwhEELYuQp48LkNpnlPvJBgoqr5Ip05sEE1qFBZT/pK8H0raeoHFxmLPdQVdK0VVc9pgr2j5eeDSDkvJ0quIHVvp8yfHEwgP4zs3jNqYX7BS3xgSit1uIBLRRgCtTNeU+hqNPZoGQNivYdKGUN16y0mZ+xSsZI7/rdgGNAXAX20nZxU40ajaa+w3GIuwy9FP4j0wlWkbF7xmgzIu4/eeIUCq405/JYvbZe9H2m5SwemBZwS7SkGY3yDnqd//qZCcJgCt6G3Tnx6vamZc2ST/vdCFmdRTkX/ppQ8g== 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=oxXS7ilsFL7Qmb9HQn0iaf0NcFrcYOnRNDxX/B/1OG4=; b=HtURYn6ogF7ECmye3APtK3TKePTugisUfc2g+hqbShcuiMrCrZ7DPVzD0cVFsJglp5NsMufq+epdHqTiGEAzFPsSntBax+Qu+A54i/G1B0LH7dl4C/UAGYybI5/cqLGuFqd7mgtl/wXrSrLZuAe3l1+NNSiCKSQEEj4WlsuSgRZV6jov0CsqBrfKQ1IoDCSaM/jugMWMUCw/ZoGgtDYCMwcgMgKDt5BrpA24AVVLBrn3DUHIqxkWVwAHAn5ki2mPEld685x01w8Na6b7J0jEfR8dG0IGhIcROjlc2aCn0UsaiCAzLwcdaHA0bWMP/agtzdpXwS+uBDmy6IfNmGCF4A== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:14 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:14 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 5/8] Add migrate_set_ports into migrate_qmp to update migration port value Date: Fri, 8 Mar 2024 20:59:48 +0000 Message-Id: <20240308205951.111747-6-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: cb9b7d8a-8029-43d0-46ad-08dc3fb2c02c 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: nfqe8zS5e/QAB9o9MBKU7OQ89e0abfQiP5xrEn63uQw7T6N9vxAGgZ5mTMXOB/fRHQ4Xl5vbJc7gDMLu1/J8Vk5Zvhe9vwkmMX38Lji4+ZroPTwLMm7/qiU5oAdMeZSlvGlFGF0eIGi/t/Tk2UYvnV5gRZfZN3JgoAU26LuhiGI688QeCIgS3nEowIwC/7RZvHDnEe7eOp7rD9QkrnHCQC2PSkvqnFgjdzNIWZuXOah1q35fK8O/Ka+naqXc6wo/35uClnX/C3dJpf6bzgAUlEICDSd4/qVoW5vAnvgdM7udFWHrwdOJd/8KhZw/Rek/W2bzie4nsq32DZJgtVxkleUVdk9QL9ArPICCnlwL53AcivtYAj4btGXWJjzBSprTXidM3ISnFg13Q7LUjCGzCvBo7tbnHGd6TGSvOFfhAbzbiSvBebVQbxHpLICPVjGKXrzBX0BjJ3a9XB8KTBej813T1QRFt1dHumATyd79BzMx5dVLwXskAMg4iX9YaoJVxUqUs9eZQBwCyMh96S1JFMnjfa+swuuM6UdWpa8Kg5+FnjmfH/ngQd3DhR1B7a7z2Tzxi/kiWfR5hwRE49J+ZZrmLXXbtsrTkksHkIzuAJ58KjdZ7FcQGR41hkKUYzYnOVFqY1cPIcWWNQ6s6Re8JwKWTmlE5/wPDQhal3LIRH51cuNc2p1k3Jpjwkgw7TvOwso7g7wm+nui9/Ieh9hFo4/1K+YMub5Ln5pq56ezklg= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GrDJcGd/LU0nKnu+Dhb20BjF6FwnAHryPDPH79ig7sWfVRbTkjN+5LJU/K5HYo4/c0l9NqDx1ycTsl7rIAq5EPD4KQAeWadVAvpde0kJx8Y6uTxUwqsxUasqaWtpic4kjtkjDi0YGjMBKYRpQEoOp4LD1GDyZ5vO/Ffs8IxdWBqHlTlmATn5eYbnJgXa0QhPxXW20ypPZzlF5pUQe7RY7e8I5sLar7iOH/2XY4vDqO1+ertzWbOiY7LFe69+vUiVhaeHPNxXhTKslu1nyhO9qTWMvLkOtE8OqMTJPXU5h3e6/YBcNjH7Lxr9qnI9k5xetiz3fBlCcT5syu36RRD8j2X1sg6qC1bRPDKDVy3UW1kr8BLFPAt7DWgaCmzkimbKzCCvB+qhK1dOgRBWJBDz9CGPHQ0vExsD1b25Yla228X/aK5j38WNxcE+bWHSYJWdi8xMT3uNYsaDgCJqHjySvrbxOgzoFha4eToaHrnsDV3nUnZ1x6/Mrp6jS0u4fgbowwgae6xe0e/8g0UZkH5Uti+Ts7hHHP3VaADVsF2IYDt9WLqsSI+rCgkaPnJ95w4dm57F1V+0mdurg7LjlWm4wDbxUovTTbte1toqSl5TOcV9Xp8gbQ87jr82HTZ5omJQBZtPF57D4p158j6kwtsLSSP5T2y7OAM2PcRgF94XsWj5eD3Pav0bFjve3LgPZ0kRzLAcDMJywUcvDFAW/UGK3xxu2QLDN9EecAvSFluDCcFZDN/cC8TrP93DPc6Y37flE2+nf0PHz0dvxIZ2aQAdjdkouYy3jMRqNutrMEfm2vfTtp7gncVFfHDhKeDPLqhmZtIPnfqFfqSYfqlWvoTIHdcEoVkZR18vk/4j+vWkZ4/a1ye7QklSUYax2oFQCS6tRSVoE98l9Qkw4/qVh0CmGgOw/1HfRxD3Cb8qLzeu30PBzRE4NPncE4pykMtLwWhO9+Sna3kjEyh5g808eL1F35ne/TcsZ8WwMxskIPiVF+RfDLGK7OgFZUyIoEwd+fmpaN973XOo2EprfiIzSiS1Lmrh/aOD5zpl61gLJAmOQTSz+N5jtZJsiPFMzxG8/JNFLhY84oXh0Iy3NrHzWcP0FtEsstLZjeXK2AFdUILDTadnO75BJxRmeZ0LYpZVQCCFNMUumfnSoOe+dZhssXqHEmZsyodIaGu/3P1g7VnMSdG9DIj621+ljjs+gRYWog4ILIzLnW1xLvmlq/UF0fSzsOd4QrRUt2vUkkTcbFP/6NbW24sRQICJnJYSOC2MsxbUrDXMt+NuL0wsba7rf2BPY/Dj3QsbSwcM3qs3zKaAA0t4rnP4wAs4pwDjfctECHeMDVbwPCj+kHpleo7oD6DuSnXs/ssaHivoNYiVznk6hQI4wvU4WCWWlVrfqLiTVgTpCkWCebMPx26xl37gjnzh1swsiIaQlq4XXLX1PCZQvwkrp9Ro3xZu4m/5HDFYvN+qs2zO3h6vHXV8e8Srp/fQfsVSWFFFCH2eCrOS9VYE5gsjCYd4y9f6EQfSKdYJa/nrDoT2eW+1w55z1CdVETG8YI0bGHuiCi9R9n19TNzzhLcLHl6BpKZWk0inF62Dcqo5c3XzPntN6KFyLjmjsV1cRQ== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb9b7d8a-8029-43d0-46ad-08dc3fb2c02c X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:14.1981 (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: kLulECEwtKynMOtUgzz1TSFIwPaMWPKomrYpDDyL8bmhzzhb6CWzHTqalAT/GLVJJt/MbYPbkrzA56DYTuS5Qg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-ORIG-GUID: Oz1YqmSKND1zKSpgW7G1zeI0m-OKua3b X-Proofpoint-GUID: Oz1YqmSKND1zKSpgW7G1zeI0m-OKua3b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org migrate_set_get_qdict gets qdict with the dst QEMU parameters migrate_set_ports() from list of channels reads each QDict for port, and fills the port with correct value in case it was 0 in the test. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index 91c8a817d2..7c17d78d6b 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -17,6 +17,8 @@ #include "qapi/qapi-visit-sockets.h" #include "qapi/qobject-input-visitor.h" #include "qapi/error.h" +#include "qapi/qmp/qlist.h" +#include "include/qemu/cutils.h" #include "migration-helpers.h" @@ -49,6 +51,37 @@ static char *SocketAddress_to_str(SocketAddress *addr) } } +static QDict *SocketAddress_to_qdict(SocketAddress *addr) +{ + QDict *dict = qdict_new(); + + switch (addr->type) { + case SOCKET_ADDRESS_TYPE_INET: + qdict_put_str(dict, "type", "inet"); + qdict_put_str(dict, "host", addr->u.inet.host); + qdict_put_str(dict, "port", addr->u.inet.port); + break; + case SOCKET_ADDRESS_TYPE_UNIX: + qdict_put_str(dict, "type", "unix"); + qdict_put_str(dict, "path", addr->u.q_unix.path); + break; + case SOCKET_ADDRESS_TYPE_FD: + qdict_put_str(dict, "type", "fd"); + qdict_put_str(dict, "str", addr->u.fd.str); + break; + case SOCKET_ADDRESS_TYPE_VSOCK: + qdict_put_str(dict, "type", "vsock"); + qdict_put_str(dict, "cid", addr->u.vsock.cid); + qdict_put_str(dict, "port", addr->u.vsock.port); + break; + default: + g_assert_not_reached(); + break; + } + + return dict; +} + static SocketAddress * migrate_get_socket_address(QTestState *who, const char *parameter) { @@ -83,6 +116,44 @@ migrate_get_connect_uri(QTestState *who, const char *parameter) return connect_uri; } +static QDict * +migrate_get_connect_qdict(QTestState *who, const char *parameter) +{ + SocketAddress *addrs; + QDict *connect_qdict; + + addrs = migrate_get_socket_address(who, parameter); + connect_qdict = SocketAddress_to_qdict(addrs); + + qapi_free_SocketAddress(addrs); + return connect_qdict; +} + +static void migrate_set_ports(QTestState *to, QList *channel_list) +{ + QDict *addr; + QListEntry *entry; + g_autofree const char *addr_port = NULL; + + if (channel_list == NULL) { + return; + } + + addr = migrate_get_connect_qdict(to, "socket-address"); + + QLIST_FOREACH_ENTRY(channel_list, entry) { + QDict *channel = qobject_to(QDict, qlist_entry_obj(entry)); + QDict *addrdict = qdict_get_qdict(channel, "addr"); + + if (qdict_haskey(addrdict, "port") && + qdict_haskey(addr, "port") && + (strcmp(qdict_get_str(addrdict, "port"), "0") == 0)) { + addr_port = qdict_get_str(addr, "port"); + qdict_put_str(addrdict, "port", addr_port); + } + } +} + bool migrate_watch_for_events(QTestState *who, const char *name, QDict *event, void *opaque) { @@ -141,6 +212,7 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, { va_list ap; QDict *args; + QList *channel_list = NULL; g_autofree char *connect_uri = NULL; va_start(ap, fmt); @@ -151,6 +223,7 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, if (!uri) { connect_uri = migrate_get_connect_uri(to, "socket-address"); } + migrate_set_ports(to, channel_list); qdict_put_str(args, "uri", uri ? uri : connect_uri); qtest_qmp_assert_success(who, From patchwork Fri Mar 8 20:59:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587274 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 86FADC54E41 for ; Fri, 8 Mar 2024 21:01:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKM-000426-QD; Fri, 08 Mar 2024 16:00:26 -0500 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 1rihKI-00041i-Un for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:22 -0500 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 1rihKH-0001OG-2e for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:22 -0500 Received: from pps.filterd (m0127843.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4287pWAj031930; Fri, 8 Mar 2024 13:00:19 -0800 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=Z8nTmlQT5ZeS8q2zI8Whk9TWkFw5aGmL3XBKq6Xty cU=; b=QTn9bW/61IaTwjf7usm++rdiXzICNJpygw+Ah0m1tFUxFFx2lAICbOZ+r +FiVwQBYmq29t/iJUbepV9ElVwnmnGc96OuhFGPehEsHjhOEGf2JDmMyedGcszNX DyNepHmArK6axOXLd3NeHTiZUxl+449gxTjPOwE5LIqiUnH06M3pfdRjkXYvgvU7 BN1N9Xx84mhfWoFxUo00dZO6sRzi3DqRqs98GXBj33Cbj0C6NbBFtoFs+YJOFjpX Kz2mplD5T0iDuk5xO1sKXDyiXErXE4HIc/NzmKUYpvhs95KZ8lgNgPnbZwzRJYd7 +yXJHTmS80MsX7VlQThOKmdRUMC+A== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012019.outbound.protection.outlook.com [40.93.11.19]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm33q6vvy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cJIYfKG+696s5KEo4qcRWiV0jRHMybwQOARVmks2CjaemSunvVTPp4lsaBrb1vUsV7ySz57/OIlpKFW3OYU4WAbYlmj7gnqDCLIc34GGjGpvC/TAdeyjAKNBl1RykQDjpz9G12K7p3URtkGlUd7/vtg2asfqrzlHTYe5ouNIpkPpra/cDNYaCdwUcFcSXGxwSTEKCP96W7ZnpOCb/+FGrqbrVYy7Fxf4BPNN2Xnu6vp6OlV4B7FDZC4Z0Xwh5mC4vdNQLUEVY7Kj2AaOLO6b21RfFykLvaFzQziwFbFQ6Xhcz21YD/3/hw8n8CAM70CvM6bPbMeQyEHN7i3dkYYFDQ== 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=Z8nTmlQT5ZeS8q2zI8Whk9TWkFw5aGmL3XBKq6XtycU=; b=am3SV/GeQxxguJpH1DZYLzWiFJVXREfYCglZgCjJ3YdAlrnbAnDwMrCcjsX3KPkZ6NwaWjPXPGcPLysL+vauvJnt2+T4Di6/Dan8My+MhV+8M1+q3x46u9BHIbyko6ws4Phf4z/ZY/d45+7yNRyEPeLRfX9NUhntVuFxBbi1xg2gGIetpTMv6xMPnJ/2VSx/Gns1ChpKEL+Tb4ytYqGn6WZEfsM/OdvyuNx0SJMlU6+q5ocNz9NQUUjFfjJoL/yulF5BJZ1CxPP7l4SrsuuCLqctZkLfZvU7pJK5OahPY2bqjeyw9c//EnhgPNM0sH7RSaKUTnJRETx01GhYfnSnDw== 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=Z8nTmlQT5ZeS8q2zI8Whk9TWkFw5aGmL3XBKq6XtycU=; b=Ok97QAgiaSuUy3mz9yuY8T3jKknZSry4dTQMT2nnzjYNKtBtMw3ibENJZyicHLBns2hwNPuAFNHHB+wJIbxLS+3phj/HfoD9nm6wbIAqwNTgBnd/NVnF0ckxwycF2gnAb/hfeLrx4UYRp8AWbarImzKpxvfUO8vJTah091isIUO6UjWF3VJfhnJeWS1TXzohPhaHTt9S1uHvUGTUWbiHI4PA4sWU2wfSng+x4BuMR0r+VGj9hOzx1O8rthGKeDmbC5uLvO9MpWF8MNDZR1c/LTwV4Ewy8ftyzWodFxza6UKHUxceylwei/ZDjxhP+KhR52kUJePwYI+38SkoBFYBmg== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:17 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:17 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 6/8] Add channels parameter in migrate_qmp Date: Fri, 8 Mar 2024 20:59:49 +0000 Message-Id: <20240308205951.111747-7-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: 6abd58f6-61d5-4002-0894-08dc3fb2c24f 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: yD43f+tM3V5kFxvhA5Ze/N3zOGp0m/pP0GkQ2O3FZBzWgqvPCI7iDKPCGuvAgcFdjpvRIVc1psLrDK3EujdhnmWYVh8OmKd9jk222sDqgiDWhEJDZ/zsQENpj17gv88JG9C+JQK+eJelxF0waENlsgyIPh/ngRu/phAHZSMo/60XS8uDwequpkF6KfN2ojwWDX9Lm0xfb84b1+UudDhWRupV56XA8iJobYHTM8WBRxiiAwTHGLbVykD7UdnGENtVLfO0IlLtqU0wqeB3m0Zx/uF3UYPJ7vF405owylIJYgV65qZgbmJhhcCc/OBN1MOqBH/am7mSm9ANGxEG4V6uzlcZbO0GczCOIeNeiJpr+qHxYAlAEFrKZQ/emC5cketqe5mBh7WlVaOIBXfYz0TZQNjKNJlllky3NALMZXS6CLt9+JzXkTjcPvP1XzbXvbmYmiuLpOxLjdxo9Ovcqqx0L9xRNjCSxVj3QpVJwwIkUrVoRMfMiTfZ1DCxD8C6Eh9JseXUBoITxisUkrf+gwF4RDhhtOW/LV1Sk8rjdgzorD+9/kRt9QYjlqhDE6DBKDSnLabOoS6od6CbvDhBmCk8rNG+IGOHRqCK/35BBA+U1ICsitjdv5ic3glseg8PzqR4TZtpiKfCBYxG1HV+QDVheExq5I9SqKs4P0/6mgksKLjVnL3Na8GE03YZYAdiIEO590zF6rv5Su907hcziS0goQ== 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ld+g+YV1dIrGxcr6cUzSAzP2g3ugegzQVOsmcE3FcvxGRUp5JvMmCETYUMucmrzDL2aolPg0OOf2JOAE+Y9GVWeuyY7XZDyHnh+UV0ACilUkjTDXIcwN0xIiYcMUNw8yuXX/p8/mbkP4UNmj97IP3ayuwm0J3zTjYSFNuLQjSyzE/WOVmcI9hjBhEDNmEPY2FFAFNXs2lG6/43/vf4T9zrANwa40O8BVTtMr0rCJpwREcoYtqSW5Ss52NsIjophB15gFLvULHB6eR9GdjDMMvxNf+KYRgpwy0aMe0PQAgLvgUiubNPoR08Nl8vk5H4tsv23uVr5qaDZ4cjRmEE1NUiEaxXB7uSC11Q5yaXUydY4I46184b3PtBBlFYOYm3anL5D1Hdt7EUy1XZxS/zRIsHuUt10Ne5UoUH64j/wSEcYejfyNxNKWGFGmRvdB+itR+YVO2GVfpB9Qs2MBEXDU4JicchAkjKE5zI+Bnsf/E+uaZ1CF98SXUwmYPYVLWXoZnxbbLmj5dekUXWUJEDHeq4ck41/6mxN5LIYpHYrOeV4Lo3Iqo23chWuvIbNJ3YDTd8BW1smCdnYDpSUGP3tRHSdCUBKMRwD9xHNy4Ip8a99BjzwsaymAb9EyVBp3W0FZPHCaqmJFmt607MXrVlGyvSx4SvHiM2EEQlk7M7H0j9zqwlTPevuhba9yUhL402sQcOY2ndhGNUDf7Sk2BxZ8esofAL5zBEF01nq5ClsKoaIQ1fKS69pNqZQHclrrrItD/MNXKZXqNvm2UPKv9S/kr+kxwEiOXxMHQMMgXznc1fwmz40MmMEBs80JEhwazane4pYFzvWsmw4eZdIB128ojQGpVu/auoVBHVbk7UZ2A00cTmxt/PgjK91YlcSaMvv/uyK9nQHc6FxZcZpx/PtJX8t7Sw2vRkCQEdt8wKhjIguTsV7+NhVZ4xpZKz4Grwu/NDjt3bohNzEUXAWWcs8LG3hSr587zxPGGJ+2uwBJ5NpgClPuE+tgfFHrvQF4ZoP3UZ5booDFEyWysZxO/HAllUgp1jILlqyC67wUB4y+Is5XmOlMORmnToc3dOgimAxBjZu6Lkow8LRxQqeullEaAhLAJkHy2NbzCICTdS0h4kWuJYwyz4He/+NcKQpnjFRbhS21u1ZNsjCU8pjrRi3boin+9amAElh4R2xpNzAFC+tPkSHF4l0SIWkplSwZ6XR7w1VZT4knp+VuP5ezO1m/ebU/UNN3RPbbr4dY3geh2t3OgVJv6pbKLBK3nxS+GUkL0vQjdTV+hPyrJiDAdaK2QU162C5pdO1Lv3tB8nU7p1yLiAb/KzUWNes+kbaqZNMeFmpFoKNQiIyGjZecKBwa+ydncb+JSefytJuYGivNfyyxstadCCAnulnyZHAqEOsQXVAOx+6mdmp8X3PlVlTbOdoMgAzAtaUj2sCNEsAczVCrqhuhZjqJgBtpGVkFYtX2GEOrVF+1ThILUQ43DrKv+CIb3lUAFdy69zZuLtoaEvrgTOvEb4ybmvfLgXzrQGKlzzKLVRiEVIUAJXhCVM0cegWrb6h06r+k1HcR29rlPYAsdpUQyU5LicBS4HeKHuoBfzmeYAqvmfst+iO7dWcL6A== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6abd58f6-61d5-4002-0894-08dc3fb2c24f X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:17.7512 (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: +Us+N/pwql9fDFPOaoBhnbo9I0n/r/dxhe14xJbjVoH/3a6s4ECV21cr4UqgM/zb8H8lR8bzBnyzpoM2easMQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-GUID: aCJnmSSe6hhyd3Qjn565o43vWBJ55zal X-Proofpoint-ORIG-GUID: aCJnmSSe6hhyd3Qjn565o43vWBJ55zal X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Alter migrate_qmp() to allow use of channels parameter, but only fill the uri with correct port number if there are no channels. Here we don't want to allow the wrong cases of having both or none (ex: migrate_qmp_fail). Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-helpers.c | 22 +++++++++++++--------- tests/qtest/migration-helpers.h | 4 ++-- tests/qtest/migration-test.c | 28 ++++++++++++++-------------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helpers.c index 7c17d78d6b..bf9fd61035 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -135,10 +135,6 @@ static void migrate_set_ports(QTestState *to, QList *channel_list) QListEntry *entry; g_autofree const char *addr_port = NULL; - if (channel_list == NULL) { - return; - } - addr = migrate_get_connect_qdict(to, "socket-address"); QLIST_FOREACH_ENTRY(channel_list, entry) { @@ -208,11 +204,10 @@ void migrate_qmp_fail(QTestState *who, const char *uri, * qobject_from_jsonf_nofail()) with "uri": @uri spliced in. */ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, - const char *fmt, ...) + const char *channels, const char *fmt, ...) { va_list ap; QDict *args; - QList *channel_list = NULL; g_autofree char *connect_uri = NULL; va_start(ap, fmt); @@ -220,11 +215,20 @@ void migrate_qmp(QTestState *who, QTestState *to, const char *uri, va_end(ap); g_assert(!qdict_haskey(args, "uri")); - if (!uri) { + if (uri) { + qdict_put_str(args, "uri", uri); + } else if (!channels) { connect_uri = migrate_get_connect_uri(to, "socket-address"); + qdict_put_str(args, "uri", connect_uri); + } + + g_assert(!qdict_haskey(args, "channels")); + if (channels) { + QObject *channels_obj = qobject_from_json(channels, &error_abort); + QList *channel_list = qobject_to(QList, channels_obj); + migrate_set_ports(to, channel_list); + qdict_put_obj(args, "channels", channels_obj); } - migrate_set_ports(to, channel_list); - qdict_put_str(args, "uri", uri ? uri : connect_uri); qtest_qmp_assert_success(who, "{ 'execute': 'migrate', 'arguments': %p}", args); diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helpers.h index 4e664148a5..1339835698 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -25,9 +25,9 @@ typedef struct QTestMigrationState { bool migrate_watch_for_events(QTestState *who, const char *name, QDict *event, void *opaque); -G_GNUC_PRINTF(4, 5) +G_GNUC_PRINTF(5, 6) void migrate_qmp(QTestState *who, QTestState *to, const char *uri, - const char *fmt, ...); + const char *channels, const char *fmt, ...); G_GNUC_PRINTF(3, 4) void migrate_incoming_qmp(QTestState *who, const char *uri, diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 61aa53c3f7..b1e5660dbf 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1305,7 +1305,7 @@ static int migrate_postcopy_prepare(QTestState **from_ptr, wait_for_serial("src_serial"); wait_for_suspend(from, &src_state); - migrate_qmp(from, to, NULL, "{}"); + migrate_qmp(from, to, NULL, NULL, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -1455,7 +1455,7 @@ static void postcopy_recover_fail(QTestState *from, QTestState *to) g_assert_cmpint(ret, ==, 1); migrate_recover(to, "fd:fd-mig"); - migrate_qmp(from, to, "fd:fd-mig", "{'resume': true}"); + migrate_qmp(from, to, "fd:fd-mig", NULL, "{'resume': true}"); /* * Make sure both QEMU instances will go into RECOVER stage, then test @@ -1543,7 +1543,7 @@ static void test_postcopy_recovery_common(MigrateCommon *args) * Try to rebuild the migration channel using the resume flag and * the newly created channel */ - migrate_qmp(from, to, uri, "{'resume': true}"); + migrate_qmp(from, to, uri, NULL, "{'resume': true}"); /* Restore the postcopy bandwidth to unlimited */ migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0); @@ -1624,7 +1624,7 @@ static void test_baddest(void) if (test_migrate_start(&from, &to, "tcp:127.0.0.1:0", &args)) { return; } - migrate_qmp(from, to, "tcp:127.0.0.1:0", "{}"); + migrate_qmp(from, to, "tcp:127.0.0.1:0", NULL, "{}"); wait_for_migration_fail(from, false); test_migrate_end(from, to, false); } @@ -1663,7 +1663,7 @@ static void test_analyze_script(void) uri = g_strdup_printf("exec:cat > %s", file); migrate_ensure_converge(from); - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, uri, NULL, "{}"); wait_for_migration_complete(from); pid = fork(); @@ -1725,7 +1725,7 @@ static void test_precopy_common(MigrateCommon *args) goto finish; } - migrate_qmp(from, to, args->connect_uri, "{}"); + migrate_qmp(from, to, args->connect_uri, NULL, "{}"); if (args->result != MIG_TEST_SUCCEED) { bool allow_active = args->result == MIG_TEST_FAIL; @@ -1820,7 +1820,7 @@ static void test_file_common(MigrateCommon *args, bool stop_src) goto finish; } - migrate_qmp(from, to, args->connect_uri, "{}"); + migrate_qmp(from, to, args->connect_uri, NULL, "{}"); wait_for_migration_complete(from); /* @@ -1976,7 +1976,7 @@ static void test_ignore_shared(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, uri, NULL, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -2552,7 +2552,7 @@ static void do_test_validate_uuid(MigrateStart *args, bool should_fail) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, uri, NULL, "{}"); if (should_fail) { qtest_set_expected_status(to, EXIT_FAILURE); @@ -2655,7 +2655,7 @@ static void test_migrate_auto_converge(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, to, uri, "{}"); + migrate_qmp(from, to, uri, NULL, "{}"); /* Wait for throttling begins */ percentage = 0; @@ -2973,7 +2973,7 @@ static void test_multifd_tcp_cancel(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); - migrate_qmp(from, to, NULL, "{}"); + migrate_qmp(from, to, NULL, NULL, "{}"); migrate_wait_for_dirty_mem(from, to); @@ -3002,7 +3002,7 @@ static void test_multifd_tcp_cancel(void) migrate_ensure_non_converge(from); - migrate_qmp(from, to2, NULL, "{}"); + migrate_qmp(from, to2, NULL, NULL, "{}"); migrate_wait_for_dirty_mem(from, to2); @@ -3335,7 +3335,7 @@ static void test_migrate_dirty_limit(void) migrate_dirty_limit_wait_showup(from, dirtylimit_period, dirtylimit_value); /* Start migrate */ - migrate_qmp(from, to, args.connect_uri, "{}"); + migrate_qmp(from, to, args.connect_uri, NULL, "{}"); /* Wait for dirty limit throttle begin */ throttle_us_per_full = 0; @@ -3376,7 +3376,7 @@ static void test_migrate_dirty_limit(void) } /* Start migrate */ - migrate_qmp(from, to, args.connect_uri, "{}"); + migrate_qmp(from, to, args.connect_uri, NULL, "{}"); /* Wait for dirty limit throttle begin */ throttle_us_per_full = 0; From patchwork Fri Mar 8 20:59:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587275 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 78878C5475B for ; Fri, 8 Mar 2024 21:01:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKO-00042F-9W; Fri, 08 Mar 2024 16:00:28 -0500 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 1rihKM-000421-Iz for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:26 -0500 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 1rihKK-0001Oc-UZ for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:26 -0500 Received: from pps.filterd (m0127844.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 42899ZcU022082; Fri, 8 Mar 2024 13:00:23 -0800 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=iEA7wFmPt2seJZDwvGZ+5mWSB9WAGWmT63WLXMmsT B8=; b=FoiRKLIBHdLj0I5OKqFe9IvOn4/TW6hOfblawbKRv6GGza7jwynsjdQ+2 wjzktIBXHpgU81hGBcho7TWb4RBhyaXPOTjHlg8cH6XT03L9tuF/3YtTvPzS+xnJ l1W/uSVwCefOGfLNcUKR3VG12tIIFTd9K0H1HbZK990bvqrRZbJCgmSXJ05ee2Sp OOYOhYIbsRiZycmdTsqM0Nx1E88XenH3QhNT1gtquhf1yQ+TNf0DUF+Btt0n5ZbD yPjOYp8rXScurOCqDBdLsEnYELabjrclY0ECw+uHrmxotTFqqynYrlgbnDVnl9FT k7D3/lQGlwKeKt4PWV25BKuS/7/dw== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012019.outbound.protection.outlook.com [40.93.11.19]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm4h2ex6a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=icwZS7zgpS0PQp5in6t4y3/5NtsHDR1Ysw1xVuGcwie/Mp8FtqoCu9Zv2rBJdamzQOFXQ4E7iX1iXmzOzliW6fv1m2XtpX0gtIBRtH2pOOGH/mFZhxIF75nMZ2nktqw6y6h6hndXeiBKqQ2c3Eqat8ts6emadIHmSbhp6CVxC9/ADMHlzIWiCdc8b+9yhAGrDyh3D3nJ7vlvdSVCDhfQ1vVI7+08yvrMOitUrUGG6o6A4GyNZTVdzNgMj8YJGarG1b95hDy1tuozUAn4jC/GzOt4LmeHKBXos0fcMLDjzCK+7UxRFy/ry7WGyPZzhU+tWIQPbNGRI/eAewcjZJElrw== 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=iEA7wFmPt2seJZDwvGZ+5mWSB9WAGWmT63WLXMmsTB8=; b=SIxLq1X0Xe414/pwk1XPZ+/eePmllBTvYH0KZK0a3UaPPMA/d6vX1EgzyXvizKnz6fSU9J2RWRZrSbMDfZC1GylZSy9WVMxBl9+V5dKqmIzeUEX2SVwk8uhkPaOczyonYteAFJrWoySrnkxgo2fqYwuiL1jWdT1Evhnor6z2Cf3jd/hBBedTOt8Go3GjmvQ3o/lVoPhFI2RJmB6KDLdHZNjz088zvA5By/zQ2nuMWfrCpZF7SoXGCBIeY/bXZdbsWyH98hVte8WjPxMRCYXiG7O5H2/nDSfa28Q55okQ97tsgoyNttFGXKDAFnUgTbZk4lqZ/4doD3xQa7M6KybH6A== 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=iEA7wFmPt2seJZDwvGZ+5mWSB9WAGWmT63WLXMmsTB8=; b=XQQkc4ARHaNVqDeIlLT+Kyfhnm8yf/87pb6/Io22IFpaopBPIuzLl2kRNBcwWxVLG6IeKhqOsNk0v7GmKwZ4af5kB5ftwUynw0F41BqT5HfBHT+nKkWMnQXg5ikq3j/mE6V8OrwRA7e5kHiFUEXJ/kAqkSyRS2J8inNH1in8mjv2NpFA57eyDt4EC63cg2Rh5IA77s6gWeY27wyGh3Fvkjpo6uIz/CMsvQ6OJ3lefJkEijn2rYxbl0OI2IybyoYecvpsmcTIYRqaEkCmWO30wAXDpUElJxLmbYtG3BAeTwDe23IWWrENafODOnmqnlLceAmYCiqkDrKUEmyJlAgdyw== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:21 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:21 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 7/8] Add multifd_tcp_plain test using list of channels instead of uri Date: Fri, 8 Mar 2024 20:59:50 +0000 Message-Id: <20240308205951.111747-8-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: 70e19de3-39f9-4020-2010-08dc3fb2c4ab 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: WBKN+VqYRTkOYT87ljbzjDEkd07jWBP+xR5ZSpp2ytab5K4C0goqYkkUWlYU64NjlEOmcoR9ywvE/ww2XjBk1cfFNfHedjUdrY+gc1bQ4zKdsRQk3nLpZhC/A2eG8sdtdVynJ9CSLGymv7zG6zJmXyl/yWpFVi8GKfI3WaLt4T5KUO0ejR2bd0/akhe5qwz2LIT6HbL9N4+5MP9nDSoYdhdyu7rqqhRt+q7NuQsH+KV6lWKIy9XrK4AUQp3rafuZQUwlbfZMmFCYfOd9QYUlnhr03O1jxJ81e/7utZ6yaDsQMonNTsAUPQ3p9VdHuHiW+FqnY7p8Jtqvw9QqlRc4P9VzU7gTpT3t82AOjdjtMBzXkpZz5pIf/B4zPzvgVjXQ3kwPcj6dMxbujFS2sUdp5ALLBISxpPKaFfpcIc1/9Q8yjuqUE+m3kkMa1nGo9flgCQoTfXQewQ9cYJFdZICCS0UFkt2Vh7EuKpiWHLSAkbeDF4o3W/rGPRh8qJGVbDIux75GB89Vf/ix4IP+jVKtLm9sozw59ft0KQXrWAosAc35BMObNNhGN+buwKbr/wij3W11A2QNy5eGbsALywGLYgITp7+d7rKZjEB/7B+6uht2tgNX89tWvKcuwIHMGa8rwckr9oFp02MoCKpSPOBNakzzhh17nLiCtAjBeakv02UcyskuBL1/isve5woebfrhUdHjUOQ6tD3ex+asZpZr4V+yGkHMIoZERIAAMSGUiic= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wM9+K5gmJ4EMKZSoQ8hbvOhSzcz9axL2kpI8I57mH4QHzrvD4ovG1bNjeyU5rcteUo3VwoSXH0JaMt0yrsUedPLE2tu7HAUAgYWeE67m0fxi4ifUb8wRTfelWW2hd0SevQwl6A5gKyMTyzmxlBp2MKbANAkhlQVXmPhqTJ18ybIXkI6SKKPif/msqkWTYO426L6MY71JaJcmAcdAGbo0lZBAHCT8RHzzbsSHr4OftEAmQx5EpxI9ewZySRpmyiuuAKvxjrzLpqLxhKllVKPdAXQQB+P2kKkJe7ZR6rp/Bh7zyDSZZhIWK6pKrGjZsRHIeDFLHHgoQ7wtpyG8spYoGMGuQIEiHd0lkKgFGVwa99bYYTl1UYs1M7xksd5HcqVPQXtNaFedOomDCJDWdtW6S03tM+2IYBiP8y5RQCB+pIcO9yDV92caPEoO+7xxcdHg2+3yyUGgkafTZ553e+aov12FXHrO5PCAX7RZc3nNG9CXDS9LEopsge/7mRlEWxRa2xzMw1VtYiWByLSiIDh+PC5wZYvmHQq1eEuQ1D7+xftVb5i2cqeLgGgGOP/7SJTzo7ZuU3lJkvXfRkhHChVbFKj934mfh1pcD39iH/hgiw5KlSMN46QeUB23tFoY5kwlWF+GcXaF00QC1WLo7v7F1dCZNKYLmSNx+oahsl9qUDUdh7sV7DWCIZ8hcBJG0vt8rUToTa367M72GmNHK0p2tcvSY7uwfNi93p79+cXDpYKSnTZXNeSewJOqnUZwL4UkFLHCDQ4T8vVFYFhYZTAAj0iLN7rJGSuDm/8RmSxyBBt80kMe4USMTB2T4rmAuNHaaVNHLiIkCJRJ9n41y3kGg4IMeS+FyE+Z79GYnK1IbaaY5CEjzqtocU6L2F7NMgf2up8JmPB8GuFga3hLegEuU3KXtvSAfj7xgtWnZNIA2WiJFGm0iCUtLWU8vMaN7Dpb4z1871sydPbK0xwgX0uD+OjLEK8a3eQHEtdOI1dGtF6V5KUS7LnTZ/9NFc3UyQ//y2fDgWG7CaiwrWCWXOAw3/UQx4oWf+i8whyVsCYwkdjTNCljlpiXh1Eon3CexsaPV5ORFOVG9dVxLQIv0mbTNjcZnqESuqMVvKHGp8pkW9xWIC7PLHvd9U7JZO5KTsHCOZMFlGgW6VSCRe2LnLoWi1gBawhNGJmsJGxXa1WlU7FapK01qGAOmqSWrarOk6CpsIow+5CvMPJ3LtgecSptp2DUjMaJapi4hjGMlXkQZLzUl7Vh3YHS1CWtF9HuLATPM23ElKwIZsaWNY5wcEG2ZC19l5sbfvPYvXf9A+0hF7eBvkQ5bh49z9i8qDAoD200Hv7Y73Op9ZT9eAc9/oUE3S9Ad4gV52ge3aBUOgycwjRAd7pJ2c/75FDb4OEq8qTyP8bpGDdU+xI3dYwWtc26yB2N3FIXppcVHYzds/VnWjmuGsu70w/bOC6kt/mhnZSOhLl28QdusIBZHbTv4SM4Wkb3s5Ngd1VmBLb4+VIKEcqlJ9wAIy/xlbqaqHIC4JxYMLyqyv19rCwdAO9Q6cTHDsm+EG0yFoZQ1thBySYeObK82E5qvonUImebK+GS4aIoPDfWMJZcZ0JVKtAwNl9j7Q== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70e19de3-39f9-4020-2010-08dc3fb2c4ab X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:21.7312 (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: +wSESkHI+pmAaKGqvAhjcvcHK9D82efB1YbO5z8kTIeEQQa6uMhj+LPXA3cm4c1bq6ziW81Jr7XqgD3xn6XotA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-ORIG-GUID: pNcMYpy0ZOrv8VhqdzYPl6bfWP2GjkNY X-Proofpoint-GUID: pNcMYpy0ZOrv8VhqdzYPl6bfWP2GjkNY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add a positive test to check multifd live migration but this time using list of channels (restricted to 1) as the starting point instead of simple uri string. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-test.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index b1e5660dbf..6ba3cfd1e4 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -659,6 +659,13 @@ typedef struct { */ const char *connect_uri; + /* + * Optional: JSON-formatted list of src QEMU URIs. If a port is + * defined as '0' in any QDict key a value of '0' will be + * automatically converted to the correct destination port. + */ + const char *connect_channels; + /* Optional: callback to run at start to set migration parameters */ TestMigrateStartHook start_hook; /* Optional: callback to run at finish to cleanup */ @@ -2744,7 +2751,7 @@ test_migrate_precopy_tcp_multifd_zstd_start(QTestState *from, } #endif /* CONFIG_ZSTD */ -static void test_multifd_tcp_none(void) +static void test_multifd_tcp_uri_none(void) { MigrateCommon args = { .listen_uri = "defer", @@ -2759,6 +2766,21 @@ static void test_multifd_tcp_none(void) test_precopy_common(&args); } +static void test_multifd_tcp_channels_none(void) +{ + MigrateCommon args = { + .listen_uri = "defer", + .start_hook = test_migrate_precopy_tcp_multifd_start, + .live = true, + .connect_channels = "[ { 'channel-type': 'main'," + " 'addr': { 'transport': 'socket'," + " 'type': 'inet'," + " 'host': '127.0.0.1'," + " 'port': '0' } } ]", + }; + test_precopy_common(&args); +} + static void test_multifd_tcp_zlib(void) { MigrateCommon args = { @@ -3668,8 +3690,10 @@ int main(int argc, char **argv) test_migrate_dirty_limit); } } - migration_test_add("/migration/multifd/tcp/plain/none", - test_multifd_tcp_none); + migration_test_add("/migration/multifd/tcp/uri/plain/none", + test_multifd_tcp_uri_none); + migration_test_add("/migration/multifd/tcp/channels/plain/none", + test_multifd_tcp_channels_none); migration_test_add("/migration/multifd/tcp/plain/cancel", test_multifd_tcp_cancel); migration_test_add("/migration/multifd/tcp/plain/zlib", From patchwork Fri Mar 8 20:59:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 13587282 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 88566C5475B for ; Fri, 8 Mar 2024 21:02:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rihKT-00045R-Ks; Fri, 08 Mar 2024 16:00:33 -0500 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 1rihKS-00044p-2v for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:32 -0500 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 1rihKQ-0001P7-9R for qemu-devel@nongnu.org; Fri, 08 Mar 2024 16:00:31 -0500 Received: from pps.filterd (m0127837.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4287HBih005265; Fri, 8 Mar 2024 13:00:27 -0800 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=2QdUqQMAWOAfW9VAyIeEpknQUCxkpFdzRGAo/NsRd PQ=; b=pw/ddSMu0x4kNr4WzRT9TDHzZDHW0vOWgkfmSEBKrRrPWPBSeP1QFNttF 1FXIDJEXt1D1ZoeVAPCYCDVsZ3DgQ74u0JtKJqki0ucmJpEw/XpI6wpcpWQW1JmT 4ZGTbxQ2eiWhyEU6CPMLaAJsN8+umhzS3p48PPoh1f7z0Sj9kqW7o+f2G7Fv3Eps 6omB3fNbAad6k40snzp8gK4Oey4C1wmHxUx8QmTL29N6zj8J+Y8wWZbP99FNlFfv 73k0HH0kp7ES+ekyokQPAHbJN8A/559TGhBcVRKCoafco1fRrKpdzxrMIdcVudqG SzECiZhvyFzqfc1a1Y2GNj7JOFdvA== Received: from bl2pr02cu003.outbound.protection.outlook.com (mail-eastusazlp17012018.outbound.protection.outlook.com [40.93.11.18]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3wm0w9e9xd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Mar 2024 13:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cRDlGX6Mtm9HdnLk+rPYKqxv2JFXFoxcf2Y46SsGhDWUTYe18SqQfOK+5c3e1hpO56w/QbCnHy4LzMKsXy3mPjkhFwjLTLIB8QEFSuirw33HPVfCyWD/VLIM7cRJU89oslztobxj3gZCZ+PPBA1t84siv5ZtJJxYaVk0zwC/oHJN682K5N279MMOFIj8GsSzAiIzD8xR5hQXFWhIv1pOlFrTyUrsThe3/IHznH9yXzzT8l2yoaJuyL/o07HiKmV/lVnDY3JzV6XDpdlU96UOLMUzgmMPKoKBh+xa5n6NKrcCvYw8q/ghkYZIMMEYqXiiiGPL3M3QvhzZjBP7D9KBOg== 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=2QdUqQMAWOAfW9VAyIeEpknQUCxkpFdzRGAo/NsRdPQ=; b=eZhaa5PixGYSSflpxCCxsYYg++Pq7HVGJYdaxZRh+Fo/LOEX6V0ZuJgvx8jggkcnKsm05M1+fCoJgE3twZL2VQ0ThTlyLsM5E8+FuKZF0+DG57FWphUfzXzsfNTRevp/D0TX7s62c+f8vNw7X5xzUOA9lzxdRWbQMc72YKZpvUKDu29RHjdcSVe68fWpTqDU66+uJVhCHl7gW0E8cdLR8s60z317HDmXGiUp/XOjyJcyTeIpMYDF4l7InUW5rzIVRt9lwePFeRM3QAN4WMLRI/OkZPxjecNdCWD0ZMe3QH7dUfR44wdJ9qZLI+SPp2McNU0/iSMqMp+c/BbPTUz/YQ== 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=2QdUqQMAWOAfW9VAyIeEpknQUCxkpFdzRGAo/NsRdPQ=; b=pG80fIyiJihMiAFZA8taMh3wdoGR4MlSqP5Dh9SIVvJ64GBU7vwMCZZysvaufDj5EP/A8ds5XECabkB0N5G+Y4zijT6RIStOgGW6FDHXUwILJiCt+ZbibYQS29oqGiIWOYI9zqoqavl8U5ohiC2QFc7ythbDvg2gsI0Kou1Skxf2ZCX6vk1jlK3xT0kQuJqoiW2WQmYnYl6+0JfXOSJcHRxVd1/91PQ75tbH3NchgjuA/wqbl6G/96iCgUS82VXvEn6mA1w4nazikusE/C4Rvu0a0RzN/0fksVANkGiSqaa7bF1DX0INpIqPTGX/kxW7uehra0JwkbDROxdEXeDMWQ== Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by BY5PR02MB6786.namprd02.prod.outlook.com (2603:10b6:a03:210::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27; Fri, 8 Mar 2024 21:00:24 +0000 Received: from SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0]) by SJ2PR02MB9955.namprd02.prod.outlook.com ([fe80::225c:2edd:87e:7cf0%7]) with mapi id 15.20.7362.019; Fri, 8 Mar 2024 21:00:24 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, thuth@redhat.com, lvivier@redhat.com, pbonzini@redhat.com, Het Gala , Fabiano Rosas Subject: [PATCH v4 8/8] Add negative tests to validate migration QAPIs Date: Fri, 8 Mar 2024 20:59:51 +0000 Message-Id: <20240308205951.111747-9-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240308205951.111747-1-het.gala@nutanix.com> References: <20240308205951.111747-1-het.gala@nutanix.com> X-ClientProxiedBy: PH7PR17CA0011.namprd17.prod.outlook.com (2603:10b6:510:324::20) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|BY5PR02MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cc0e5a9-9034-4b8c-9c04-08dc3fb2c61f 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: ttGLJR/MfxGFoJLl+BOsxMAKLc6+LTBxQlyga0JAd+P2G0c7i4Mmm5um+pvyqLuTbQD3yrTvQrpHsVbzqPR7vnXRm8FeSAoD2VuNolmto3YXE0flsr1KfU9Eek0zR4nUhmbumWgJa9YtKeWF8MskGQu80hTjn27daeHKx68+74pwGYVUDVWskOt74JCg0wl657XLV/D270ulxwWdzwbIBcwJ9al6iqu8VjwkmuicsobToEEbxT+kNm+z3EjoI+Fj4QGPm7fzTdb5D72pUnAPQvPBekthGI4oDS9V2P0jPsG0WWnm1LV1Y4weQuZiM+PZukahppOWhTTJK7spMk8CjqblrHTf3SmhMg05cVhdv/m1i9TpYQ6Ab8XaCUReqwbQuYP4Kv8tYeaI7AJucirDtfC98lyY/a79KYuYfdEmOTTuMNdeq8PsTjXKsKqKHCEX3PRqaHjDKFzf7oZFnlMP3xVpyZVJYE48wcOwrNBlS0MJFkc5dhYdKfpp41nHedAoyJoVeRMUXWEuHFu8bFdaQPPfXLs4Xr+NbUvVUg4ExP9oCroDxFyz5GB77uEpCTrj7AICRcKrGgR8M/EXaN5fyhvXbmC6nHel33PNfertUozN9Li5uMylgEhxJM9oia6VSHo9Gn8EYpxZdheLgyRFHQvDKaEjnRlTXAj8IZVUbnnigbIV7bIbiQgKP0bWpHct0NX729j5ZN00csF2p73HQDXu6hzyxVGDIxZJ2+4jPjc= 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)(376005)(52116005)(1800799015)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uq7/Q90Xjszk71znRXJbOobdInlnPJ1nF58RkpuEjda3RNXN8Q6MfpzjD0sdk+OdvgjK3/Zl9mfTWYVNc5TnARiTaTeudBM/rZ+7IS+hWR7/CZgEjNPHKn33CygnQ5xVfGEzLAWXEsQ1zbTLrIo1M5Vsr/w2COjp77ph1ElUebIpbAJyib1mSw75GlX+pY0V9pqV1EqaIAeHv6Fhg7wX6jos+8+YLuvBo5Mr6ODgTdGH+flz0SZi9Gg4oALoIMcFi64cgWJttlPgwWu6MWUF9PjApG/ezHhmDqfS2+mp141YFfinLt4a0UKFC8aP0wXtAVhwj9nfH/C9joCM4G3xy+S90/NxxBi3hYg9gYru9bg/tw35csnTJ/djH+QwYFtjq7gb1yxEJL42fMdyO/g0hLO//LZ3n7JuuBRdzYk9zs+t/KWSGF8behVbD280P34D2mbXE39gzufEAuAgOPA8MG2Y4I4isaLazWbmONrrSwXJxw02s7iLZkMmCqEy25W9NneRWB94U9v8kh6YQCs5lfhZwZrbYPWIQ28rJzIpGefMNjOHE82knqsyvr2406vM5X3A1db4CCFiudEDwztv5jNkP1pXeuDSbbcrpStStx8hvsKHq8pxQb4se8BRS6Sn1DyqjFOQJRhRHWDSzSHaMdx5iMD381gZEIzSN+7rjLVwxFImO4RhAogl1Xy7J0j0JGduq+ZAvuMZZ2SiZCjeOQCxdLLpiBC9OOsmcmzdUntmlAfEJeZqx2bBlmhuvrmRpqoaHb6RZyAZRZE+fHrSCRxifZ8/DXZU+nK1hmYa+wJ+SBMa+pqn+cTh1gvsQrYe3ptKb8wuAps5K5+Mf8mIjRvpgyf+0D/eNc10RWhiqkwY3Yo6RAV0hvvzK/Cjx+QejzU3vxnETtdXo3uWHjMEIHApVMuu7uuTWCu0wtqaKNdjcoZcHYwqL/4EVsbhwa69mzjWOEytdkkflYcoDp6foZBIOn8mn3ql3dfHe4YXcVEHJofO6C8cvHy8KNXC7LOeXWXs+X+KI/hwCGxjnUICA0EyAYfgNTftfk81bz6DLTcSsV/YmKmHYcfdyKMY/MqzRddrBY4UjBeFKDp806eW+YYn/c5OCkMa1zbZK3TlZd79dfiXlxRZW9/Ztkh0PE4rdcfdHUe/+2pSCk84+WBqHeLXme24sI+9zap8xWVCktTj0Gl/wwxIMP+mQbTsAX/WXzK+0BEOnxgV+McvLB9p6YQomxuwTSVZZHVPbHW3iYxeyWMkJD+bFMGbkcIzR7HLMYoqz/wGtNWpszJwMasTTIlAclojn+Nc9tTrJnC0ageWLgh4r+FLRQrvLr9NFbAXtecduCx5khOMxeFLwwy8MDa0NZy0BGIdR7F9t49it39NkfjOVokwdb77zvSb8vxWZbLqF+sVgztufQrtnSBTSHy44l2Kaou35g/hFfe+ByEo+wcQHr2LA0fewtjhP+JwJDXP2TQm+t3gj87oOua0po2QvxN153UqPHMsqDIDTIgvhPVOJfaqUuYSOct2gy4u6zPUkW0TnafxzB45gDNw6+I6vUHPquH86cEJPHVYcs49pw49FsJKAHu8iYZwT4J/S2oDEoQLePJXvzVVQ0OxFg== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cc0e5a9-9034-4b8c-9c04-08dc3fb2c61f X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 21:00:24.1927 (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: 0M0hWOp3IRjYb3zK2jrwdCsoEQhE3v2IEgolVSwMslAfLNmwpHmQbhCQmtiaNrmMUxMir8bfpv7oKZRCRbgBcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR02MB6786 X-Proofpoint-GUID: N4m04fChId8DVjTgC-qv5VseF_giNG16 X-Proofpoint-ORIG-GUID: N4m04fChId8DVjTgC-qv5VseF_giNG16 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-08_08,2024-03-06_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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.572, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Migration QAPI arguments - uri and channels are mutually exhaustive. Add negative validation tests, one with both arguments present and one with none present. Signed-off-by: Het Gala Suggested-by: Fabiano Rosas Reviewed-by: Fabiano Rosas --- tests/qtest/migration-test.c | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 6ba3cfd1e4..385f696a3d 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -2612,6 +2612,56 @@ static void test_validate_uuid_dst_not_set(void) do_test_validate_uuid(&args, false); } +static void do_test_validate_uri_channel(MigrateCommon *args) +{ + QTestState *from, *to; + g_autofree char *connect_uri = NULL; + + if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) { + return; + } + + /* Wait for the first serial output from the source */ + wait_for_serial("src_serial"); + + /* + * 'uri' and 'channels' validation is checked even before the migration + * starts. + */ + migrate_qmp_fail(from, args->connect_uri, args->connect_channels, "{}"); + test_migrate_end(from, to, false); +} + +static void test_validate_uri_channels_both_set(void) +{ + MigrateCommon args = { + .start = { + .hide_stderr = true, + }, + .listen_uri = "defer", + .connect_uri = "tcp:127.0.0.1:0", + .connect_channels = "[ { 'channel-type': 'main'," + " 'addr': { 'transport': 'socket'," + " 'type': 'inet'," + " 'host': '127.0.0.1'," + " 'port': '0' } } ]", + }; + + do_test_validate_uri_channel(&args); +} + +static void test_validate_uri_channels_none_set(void) +{ + MigrateCommon args = { + .start = { + .hide_stderr = true, + }, + .listen_uri = "defer", + }; + + do_test_validate_uri_channel(&args); +} + /* * The way auto_converge works, we need to do too many passes to * run this test. Auto_converge logic is only run once every @@ -3678,6 +3728,10 @@ int main(int argc, char **argv) test_validate_uuid_src_not_set); migration_test_add("/migration/validate_uuid_dst_not_set", test_validate_uuid_dst_not_set); + migration_test_add("/migration/validate_uri/channels/both_set", + test_validate_uri_channels_both_set); + migration_test_add("/migration/validate_uri/channels/none_set", + test_validate_uri_channels_none_set); /* * See explanation why this test is slow on function definition */