From nobody Fri Nov 1 05:39:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1708074458; cv=pass; d=zohomail.com; s=zohoarc; b=B9sue+ph/FkP9yMVUmqGgZF4FR2gaB5e/TCUIYoFTE7W4gN/HVvITK7SfjKUDKBH2WffOPToa/09PieZptnyjW/BwtX5xBBn1pI857TOuV6IWqEO5SDNSS/TUdbBNU1uO9oVQnP8QKNcg0HgG+PSyUyrMvngKCVrQVCvt4WTs0Q= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708074458; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Kc4uUJAbKKnVToZiVQkTJkASjOeEICBQEEk/7Zz8wI4=; b=gUL8ah11aVEy/aFebNoAOo/+iadbemUmz+DFUnJORAUOqEhaK/PuDqUi/K8oX/ebqUv6cCdBEWT2tL8YXvV1tMIV5vO+HQvAfEmqpGLxsuxmrh9tJ8RkBzZoCWqglbdSnp34tdV+E1ShI0laMSARE5p0lGC1omS41CMZSORCenU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708074458186395.3562304306839; Fri, 16 Feb 2024 01:07:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rauB9-00025U-1G; Fri, 16 Feb 2024 04:06:43 -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 1rauB7-00025B-Uc for qemu-devel@nongnu.org; Fri, 16 Feb 2024 04:06:41 -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 1rauB5-0003sS-MR for qemu-devel@nongnu.org; Fri, 16 Feb 2024 04:06:41 -0500 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41FNH0YR003311; Fri, 16 Feb 2024 01:06:36 -0800 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3w69bg4q5f-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 01:06:36 -0800 (PST) Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by CO1PR02MB8521.namprd02.prod.outlook.com (2603:10b6:303:158::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.27; Fri, 16 Feb 2024 09:06:34 +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.7270.036; Fri, 16 Feb 2024 09:06:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=Kc4uUJAbKKnVToZiVQkTJkASjOeEICBQEEk/7Zz8w I4=; b=W8P9nwSFNo1tlM6ClXRbwtT2tLLs3kyGpAnGVWFtj23/3ccXVTnZjnAlO 0Y4UxlOOn7gzdkDwg926YAcJI5LXpfL5ZlssxW1X/P7O7LjIq4iZ2ON4+fuj7pJi UJlv1XyS1PzJyDMLxnnJIIT2L4pMGSS7zd0e1LHSWAkR0leiSqRIB3mOJ7U5p1d9 PRx0/sWZ1XLbk6nZGxEJFngzJwQY4Od+6LJC3YT01cjOO2rKigofER7x1UPPLF0S KKKP2Q6DSywJWn+pOGJDgpaMY5zs1KBm5aMueHNCdaH7hzv1fU2snB26HqOhsYy8 Bkjacrrxvai02zoXACwC7NflxQviQ== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K/lH4pL9d1n0s6iCfAH1ced2usd9aZumMhKa41KiTh3vraeHYfoqw0dHif89cEifmXgTQF+aKWJnZxEa0+ElZzxd0Y50TREu+2OSiRoDFiT+AnZiGRuzZ8upO0OjUBub9Nyq6Zv88YaydA4K070bp7aPTyNMzyYhQqJK+9usBDVuEQLKcTBZVSYkpStikuzN0oz9ByUc1P2LRFJEIaqGZNmQsg+YZZk1jcSptak4SQ6kAWYUv2V393fXQUpha7Pl4j6X3XtGiTf1fzazH/yUaGQJ2cAT6d6cX/KDU8cTzC9+Y288vvCNSPFy1GzSyjezTMTMKure1Gqy84RAz6Zuxg== 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=Kc4uUJAbKKnVToZiVQkTJkASjOeEICBQEEk/7Zz8wI4=; b=bgH8VKe4oGB3+V9k/PXQVBqvwRrlZY6p39mfhSXSwFNFK8r7RjQ60YA6RtO2t47fW5Oa9PqNgQenm0oSSoMHIwxtSfJg6lLS87te17e9B3ecdVxDTH62VE2BD6XcqT3hTJHpWkYCXMZO3uvmMaRHrxGO+rNlx+gA7x6ey2kQOF3wGkdebFWVuuP8T+zuhXjwxHs1tKdjwtmKUFR/nbsTQ6pAKj3g3MPYVeqKMy7Fzdy1tYSXLeJRJpwpGSQiZZqyPZYODPzi6IIchSPdVs15Z0RKfsIZlOArrGUkkWkTMfZPB02d0HpzvvC3SXOYqP+VxvnwsBXmI4OcdceADf7eIg== 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=Kc4uUJAbKKnVToZiVQkTJkASjOeEICBQEEk/7Zz8wI4=; b=J2Yh9j5PIMZJHdCcDlkhIgQ9oe9vKh5IX395ySPlaIN+ykDq62tod1UhSHY+TVXWeMIwXd8a9GG89HPnl6Kb9eid3VVA3UK4rRHflL4XbL2vQz7ImzhDCDaxRBg6fQn6z2BiET9aw3kdPsCfWPLtTKcn4g1ha/T7wsIAQZ5zi5Jg4A5cpYScvNIxAdB+GgjSBuUDWeFoAedSdoWSoERQ1XUbTTy/3OcGxlMLb1ehKSyF4bs0JyqUsABhfGhaSmQqwIGapqpi1IhItpo2SLYEXKzuZrHg2XvAWucfBFJ7eD0tXkKNaJkjovVp+2sW9M2peGNhKaNudKdLCOBzyYB6Ow== From: Het Gala To: qemu-devel@nongnu.org Cc: armbru@redhat.com, berrange@redhat.com, peterx@redhat.com, farosas@suse.de, Het Gala Subject: [PATCH 1/3] qtest: migration: Enhance qtest migration functions to support 'channels' argument Date: Fri, 16 Feb 2024 09:06:22 +0000 Message-Id: <20240216090624.75445-2-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240216090624.75445-1-het.gala@nutanix.com> References: <20240216090624.75445-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PH8PR20CA0012.namprd20.prod.outlook.com (2603:10b6:510:23c::10) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|CO1PR02MB8521:EE_ X-MS-Office365-Filtering-Correlation-Id: 24220c7c-e2e0-40c9-138a-08dc2ece92e6 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: YfFKOtMrYSKu7xG6q+p9ENP/8y4QBwsKK3LFD4yIGHL2AtgAUhUXyJbgurSVRP90IOkiFiTZDwNau6NYoFiu/CttdF7FdzIFdTvi5ZzibUWHM4wr/aA443UcE9vrxlbteguNuQvHAF+P+itx3oA5KcSC2HEXLEHbmqwJU5uBp7LXjn97P5LMrBHSJ6b6jqRdYbJ4TtGXgq2dnwAB9KMKcEx1qyvLtyCwL+NWM2dWGOSJIdY55DczUgjYLauT4DFIUIYqUqZIOsJ5GrCtXNfLrqBwrRI7x0QW5k8tAFrAL3x/Zy5yTdWak3JtRHKZhnxHGEeNMK0dZsb3SHYQCfUsKBZDanQk75pW0YsY0CZ7x/0ZNPO8K9psw2pCUvFwCtaP9GERnGkbfpIy6NBCV1pyJvxHpCa260ZBn39Z6yQlo+fbz6gVhj1MwaA3hItGJFzDvnlqyVOd9yI/Um4EqGVxqQiAJPskGmGvJD6+mUgybYLcBs5TgSe58tEZIYHGwqCsn4rCczlpnWxHmJWKFUXRopi79TDc0qnkKQD1wHrpsVCdbw6gYSmovu0L4SmDTQsiDfEy+aHa03oSWf57VhrKIQUakm4UWmbk5G+AK8ulReUywUomgYsCC1QMEczASAZl 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)(136003)(396003)(39860400002)(366004)(376002)(346002)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(30864003)(66946007)(44832011)(66476007)(2906002)(8676002)(5660300002)(4326008)(8936002)(6916009)(66556008)(6666004)(26005)(83380400001)(38100700002)(107886003)(1076003)(36756003)(41300700001)(38350700005)(86362001)(316002)(2616005)(52116002)(6486002)(6512007)(6506007)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4qnRejwibJAYQqEOQPe9FkbzNq6JOjooCFvO8Mx57Y889que19/IZ4q0deDc?= =?us-ascii?Q?ZA95hKOV/Wh/E5UgRENwHBrwaaD49iJtOTCk4PynABe76xyvB+gsNtVJSj0o?= =?us-ascii?Q?aFPxvg8dMl+lTKUsPAcrTpMAUxxRFLHNBq859XLqcXqnuV5HsYRjtV418QKV?= =?us-ascii?Q?fjhhyFAfSZ6u9b8eCHSRdnSLQXQx6+hJnkgroiNBJeInfVsdaSDo0rss4vvr?= =?us-ascii?Q?JJNahLwQIsbYhRcEYhU7oNXWmiUAwvrMF+vAMgnrUfG61C8h/9V2GVivgkVF?= =?us-ascii?Q?dEsqjx6ivc4VwhX9r1DmasgiSg1qUUc0TSZK2KSxPrhAmF8qgFm/UMj932Ki?= =?us-ascii?Q?/Rm86kDgD8JpAiltkGqjqhpb2+KnhxgMhne219U+xVj2zIQ2Zua1IPeaj/yO?= =?us-ascii?Q?w9AumPpy1fZNmNGjiduTM4foyQk3gh1DsqmA1UQSZ0j6T6Y1eb5hPQXTIrBG?= =?us-ascii?Q?DEiuMfZCkVC0yAECgP4Eog+c17XamH8WN46lMA69WzhvLl9Ilm9CYhs1vKli?= =?us-ascii?Q?DvKhatv2mhP5W1RSTglsavqZrVVJpHhxb44PZ5tma7GzCEKFMSkB3A0faleX?= =?us-ascii?Q?a31DiQvL8ZXgz+7UEmR9rNI9i6pwMcXqmsY7wi0j+cSb0zS2PSu5jCYDzRxC?= =?us-ascii?Q?oqx7PiDot48W0Im63DTef17ok1k7jP8dxH4r5ObtCkOIhFnnDB/44Acu8qkg?= =?us-ascii?Q?gqkKng+wRUQJNSrFeh10/nMkadui+/28unwgrC7TR/AkOqhbcd6TqcgtlTR2?= =?us-ascii?Q?i4f8l1Ek/zXw55J0uXnsh75Y+bA2gcEWTxjQGVAQAxvK40D76h/oHPgSOjTk?= =?us-ascii?Q?onYuTHKVqyBSPX/4XZF7OunGg0fnUHTtLXnCzTgdOfxaTHZIS2tAMH4/JL0E?= =?us-ascii?Q?hmJfkOoqy1mk2QwJ6wDTK5WT3nQArvwK8T84FjVSGPJ8taGor7GSCv/3scf0?= =?us-ascii?Q?v9nedpqxCmdj2Zu4bh3URksd6xtumvzLCh5W3w2xhIRVY5frh5lfhXaXSMWS?= =?us-ascii?Q?2qzQqN73AhfAU+6JE/5vscqV/M7pqY+VZk14Zg+RNXvclZMuscxhpvbLEw5y?= =?us-ascii?Q?EpAy5FVWWETQK3xCZh7kvrZBUU8Y+bKt73P4AL8RolB4K3/Q2vp7cA9I+bgh?= =?us-ascii?Q?mRNOHdMzCMz6cFv9D9yn77IJte0E6QXEzB94fEuxnPQh63PaOyeB5/1m3XJo?= =?us-ascii?Q?+mvZSyuuefFMuHEr67Ewg3s/9GECf1WQR9CnxuLErbfY/G6KOTuac+ZM56rG?= =?us-ascii?Q?fu9l2JxeWxmkrhbvfK0rweW6kj1RFKDi/dVBN/ZKjaJ06TdEVy1jXr8PZORv?= =?us-ascii?Q?Msm4BqNo3m4ed6SUrABXLjXtqXfS+YsVSKzeH7RjAWJQ3OQdCuBHlCZg6Ze1?= =?us-ascii?Q?YMd4seiAnYYFd+8WDjXCxnAdymgVyKLTUBMimmjQ1NhA/ql3F2KC+4/r4pCB?= =?us-ascii?Q?6b0T+PsF3OFgBaoN6pmlaeIXwYiFFmJi8rgX09nXUtRGUU7+i1j5WZkUDHkd?= =?us-ascii?Q?B83aZs1x9wy0xxtxejahoJpzaiDlV/mUa2M3YYzTcqDeROqxdffBLfLEV/J3?= =?us-ascii?Q?IMXzEd8Upu/z9a/0lnCrNYq2VHNt7CfZznJTCymq7qrlQfqlEW2zck3HmCBM?= =?us-ascii?Q?xg=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24220c7c-e2e0-40c9-138a-08dc2ece92e6 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 09:06:34.3647 (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: Aump1QiBf8NzAlWxWyLQFjbnlWfSJdgeAP9KkXtAu+GPX379uTOIEemx7bYZZ3E9WKM6jUpWKke8eis5NUQMmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB8521 X-Proofpoint-GUID: ZrjeYCJNJOiL3S9VFsiPiSxUclo-bFrb X-Proofpoint-ORIG-GUID: ZrjeYCJNJOiL3S9VFsiPiSxUclo-bFrb 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-02-16_07,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.772, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1708074460949100011 Content-Type: text/plain; charset="utf-8" Introduce support for adding a 'channels' argument to migrate_qmp_fail and migrate_qmp functions within the migration qtest framework, enabling enhanced control over migration scenarios. Signed-off-by: Het Gala --- tests/qtest/dbus-vmstate-test.c | 2 +- tests/qtest/migration-helpers.c | 93 ++++++++++++++++++++++++++++++--- tests/qtest/migration-helpers.h | 11 ++-- tests/qtest/migration-test.c | 33 ++++++------ 4 files changed, 112 insertions(+), 27 deletions(-) diff --git a/tests/qtest/dbus-vmstate-test.c b/tests/qtest/dbus-vmstate-tes= t.c index 6c990864e3..0ca572e29b 100644 --- a/tests/qtest/dbus-vmstate-test.c +++ b/tests/qtest/dbus-vmstate-test.c @@ -229,7 +229,7 @@ test_dbus_vmstate(Test *test) =20 thread =3D g_thread_new("dbus-vmstate-thread", dbus_vmstate_thread, lo= op); =20 - migrate_qmp(src_qemu, uri, "{}"); + migrate_qmp(src_qemu, uri, NULL, "{}"); test->src_qemu =3D src_qemu; if (test->migrate_fail) { wait_for_migration_fail(src_qemu, true); diff --git a/tests/qtest/migration-helpers.c b/tests/qtest/migration-helper= s.c index e451dbdbed..d153677887 100644 --- a/tests/qtest/migration-helpers.c +++ b/tests/qtest/migration-helpers.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" #include "qemu/ctype.h" #include "qapi/qmp/qjson.h" +#include "qapi/qmp/qlist.h" =20 #include "migration-helpers.h" =20 @@ -43,7 +44,70 @@ bool migrate_watch_for_events(QTestState *who, const cha= r *name, return false; } =20 -void migrate_qmp_fail(QTestState *who, const char *uri, const char *fmt, .= ..) +static char *socketAddressType_to_str(SocketAddressType type) +{ + switch (type) { + case SOCKET_ADDRESS_TYPE_INET: + return g_strdup("inet"); + case SOCKET_ADDRESS_TYPE_UNIX: + return g_strdup("unix"); + case SOCKET_ADDRESS_TYPE_FD: + return g_strdup("fd"); + case SOCKET_ADDRESS_TYPE_VSOCK: + return g_strdup("vsock"); + default: + return g_strdup("unknown address type"); + } +} + +static QList *MigrationChannelList_to_QList(MigrationChannelList *channels) +{ + MigrationChannel *channel =3D NULL; + MigrationAddress *addr =3D NULL; + SocketAddress *saddr =3D NULL; + g_autofree const char *addr_type =3D NULL; + QList *channelList =3D qlist_new(); + QDict *channelDict =3D qdict_new(); + QDict *addrDict =3D qdict_new(); + + channel =3D channels->value; + if (!channel || channel->channel_type =3D=3D MIGRATION_CHANNEL_TYPE__M= AX) { + fprintf(stderr, "%s: Channel or its type is NULL\n", + __func__); + } + g_assert(channel); + if (channel->channel_type =3D=3D MIGRATION_CHANNEL_TYPE_MAIN) { + qdict_put_str(channelDict, "channel-type", g_strdup("main")); + } + + addr =3D channel->addr; + if (!addr || addr->transport =3D=3D MIGRATION_ADDRESS_TYPE__MAX) { + fprintf(stderr, "%s: addr or its transport is NULL\n", + __func__); + } + g_assert(addr); + if (addr->transport =3D=3D MIGRATION_ADDRESS_TYPE_SOCKET) { + qdict_put_str(addrDict, "transport", g_strdup("socket")); + } + + saddr =3D &addr->u.socket; + if (!saddr) { + fprintf(stderr, "%s: saddr is NULL\n", __func__); + } + g_assert(saddr); + addr_type =3D socketAddressType_to_str(saddr->type); + qdict_put_str(addrDict, "type", addr_type); + qdict_put_str(addrDict, "port", saddr->u.inet.port); + qdict_put_str(addrDict, "host", saddr->u.inet.host); + + qdict_put_obj(channelDict, "addr", QOBJECT(addrDict)); + qlist_append_obj(channelList, QOBJECT(channelDict)); + + return channelList; +} + +void migrate_qmp_fail(QTestState *who, const char *uri, + MigrationChannelList *channels, const char *fmt, ...) { va_list ap; QDict *args, *err; @@ -52,8 +116,16 @@ void migrate_qmp_fail(QTestState *who, const char *uri,= const char *fmt, ...) args =3D qdict_from_vjsonf_nofail(fmt, ap); va_end(ap); =20 - g_assert(!qdict_haskey(args, "uri")); - qdict_put_str(args, "uri", uri); + if (uri) { + g_assert(!qdict_haskey(args, "uri")); + qdict_put_str(args, "uri", uri); + } + + if (channels) { + g_assert(!qdict_haskey(args, "channels")); + QList *channelList =3D MigrationChannelList_to_QList(channels); + qdict_put_obj(args, "channels", QOBJECT(channelList)); + } =20 err =3D qtest_qmp_assert_failure_ref( who, "{ 'execute': 'migrate', 'arguments': %p}", args); @@ -68,7 +140,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, const char *uri, + MigrationChannelList *channels, const char *fmt, ...) { va_list ap; QDict *args; @@ -77,8 +150,16 @@ void migrate_qmp(QTestState *who, const char *uri, cons= t char *fmt, ...) args =3D qdict_from_vjsonf_nofail(fmt, ap); va_end(ap); =20 - g_assert(!qdict_haskey(args, "uri")); - qdict_put_str(args, "uri", uri); + if (uri) { + g_assert(!qdict_haskey(args, "uri")); + qdict_put_str(args, "uri", uri); + } + + if (channels) { + g_assert(!qdict_haskey(args, "channels")); + QList *channelList =3D MigrationChannelList_to_QList(channels); + qdict_put_obj(args, "channels", QOBJECT(channelList)); + } =20 qtest_qmp_assert_success(who, "{ 'execute': 'migrate', 'arguments': %p}", a= rgs); diff --git a/tests/qtest/migration-helpers.h b/tests/qtest/migration-helper= s.h index 3bf7ded1b9..52243bd2df 100644 --- a/tests/qtest/migration-helpers.h +++ b/tests/qtest/migration-helpers.h @@ -14,6 +14,7 @@ #define MIGRATION_HELPERS_H =20 #include "libqtest.h" +#include "migration/migration.h" =20 typedef struct QTestMigrationState { bool stop_seen; @@ -25,15 +26,17 @@ typedef struct QTestMigrationState { bool migrate_watch_for_events(QTestState *who, const char *name, QDict *event, void *opaque); =20 -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, const char *uri, + MigrationChannelList *channels, const char *fmt, ...); =20 G_GNUC_PRINTF(3, 4) void migrate_incoming_qmp(QTestState *who, const char *uri, const char *fmt, ...); =20 -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, + MigrationChannelList *channels, const char *fmt, ...= ); =20 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 8a5bb1752e..e7f2719dcf 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -18,6 +18,7 @@ #include "qemu/module.h" #include "qemu/option.h" #include "qemu/range.h" +#include "migration/migration.h" #include "qemu/sockets.h" #include "chardev/char.h" #include "qapi/qapi-visit-sockets.h" @@ -1350,7 +1351,7 @@ static int migrate_postcopy_prepare(QTestState **from= _ptr, wait_for_suspend(from, &src_state); =20 g_autofree char *uri =3D migrate_get_socket_address(to, "socket-addres= s"); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 migrate_wait_for_dirty_mem(from, to); =20 @@ -1500,7 +1501,7 @@ static void postcopy_recover_fail(QTestState *from, Q= TestState *to) g_assert_cmpint(ret, =3D=3D, 1); =20 migrate_recover(to, "fd:fd-mig"); - migrate_qmp(from, "fd:fd-mig", "{'resume': true}"); + migrate_qmp(from, "fd:fd-mig", NULL, "{'resume': true}"); =20 /* * Make sure both QEMU instances will go into RECOVER stage, then test @@ -1588,7 +1589,7 @@ static void test_postcopy_recovery_common(MigrateComm= on *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, uri, NULL, "{'resume': true}"); =20 /* Restore the postcopy bandwidth to unlimited */ migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0); @@ -1669,7 +1670,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, "tcp:127.0.0.1:0", NULL, "{}"); wait_for_migration_fail(from, false); test_migrate_end(from, to, false); } @@ -1708,7 +1709,7 @@ static void test_analyze_script(void) uri =3D g_strdup_printf("exec:cat > %s", file); =20 migrate_ensure_converge(from); - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); wait_for_migration_complete(from); =20 pid =3D fork(); @@ -1773,11 +1774,11 @@ static void test_precopy_common(MigrateCommon *args) } =20 if (args->result =3D=3D MIG_TEST_QMP_ERROR) { - migrate_qmp_fail(from, connect_uri, "{}"); + migrate_qmp_fail(from, connect_uri, NULL, "{}"); goto finish; } =20 - migrate_qmp(from, connect_uri, "{}"); + migrate_qmp(from, connect_uri, NULL, "{}"); =20 if (args->result !=3D MIG_TEST_SUCCEED) { bool allow_active =3D args->result =3D=3D MIG_TEST_FAIL; @@ -1869,11 +1870,11 @@ static void test_file_common(MigrateCommon *args, b= ool stop_src) } =20 if (args->result =3D=3D MIG_TEST_QMP_ERROR) { - migrate_qmp_fail(from, connect_uri, "{}"); + migrate_qmp_fail(from, connect_uri, NULL, "{}"); goto finish; } =20 - migrate_qmp(from, connect_uri, "{}"); + migrate_qmp(from, connect_uri, NULL, "{}"); wait_for_migration_complete(from); =20 /* @@ -2029,7 +2030,7 @@ static void test_ignore_shared(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); =20 - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 migrate_wait_for_dirty_mem(from, to); =20 @@ -2455,7 +2456,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"); =20 - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 if (should_fail) { qtest_set_expected_status(to, EXIT_FAILURE); @@ -2558,7 +2559,7 @@ static void test_migrate_auto_converge(void) /* Wait for the first serial output from the source */ wait_for_serial("src_serial"); =20 - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 /* Wait for throttling begins */ percentage =3D 0; @@ -2869,7 +2870,7 @@ static void test_multifd_tcp_cancel(void) =20 uri =3D migrate_get_socket_address(to, "socket-address"); =20 - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 migrate_wait_for_dirty_mem(from, to); =20 @@ -2901,7 +2902,7 @@ static void test_multifd_tcp_cancel(void) =20 migrate_ensure_non_converge(from); =20 - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 migrate_wait_for_dirty_mem(from, to2); =20 @@ -3234,7 +3235,7 @@ static void test_migrate_dirty_limit(void) migrate_dirty_limit_wait_showup(from, dirtylimit_period, dirtylimit_va= lue); =20 /* Start migrate */ - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 /* Wait for dirty limit throttle begin */ throttle_us_per_full =3D 0; @@ -3275,7 +3276,7 @@ static void test_migrate_dirty_limit(void) } =20 /* Start migrate */ - migrate_qmp(from, uri, "{}"); + migrate_qmp(from, uri, NULL, "{}"); =20 /* Wait for dirty limit throttle begin */ throttle_us_per_full =3D 0; --=20 2.22.3 From nobody Fri Nov 1 05:39:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1708074457; cv=pass; d=zohomail.com; s=zohoarc; b=hv3+j1+pPn8MFQi8oLK+Y8JW5+9qeE+GM0IOA+VPkF6MK05x7ZsUaMp8sQlIlYIj0BmXr6Y4YCNq5VkDaFm/z62tI8t63GRrx3TSGUgb87PrNh0AsYOygqYBL6xbpAEgm7CQHSz8w9+JX0ttbioxFf3yM6PqkbFu2IDjenenlV8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708074457; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hwWa4ydQACrkEjLzxBeHe31jylI99pgtZP9E/LsevGI=; b=CaaUdI4cLpRAf23SJuPW64SVWINXXI42b8YcJ//X2XgWQ0+mas/V/Chhfic0SVzMacVg6dA5Y3q086Rk/A9lZ5c7ZIl6X7sLXvBMSopaIFl5me9nFSaiFJfo/HrGXRVKuiOI/3JQG4yQ0LHWSjFC0bJTI/IRMazaDZzMlnX6Arg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708074457336281.42175322490925; Fri, 16 Feb 2024 01:07:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rauB8-00025J-Fh; Fri, 16 Feb 2024 04:06:42 -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 1rauB7-000251-Ct for qemu-devel@nongnu.org; Fri, 16 Feb 2024 04:06:41 -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 1rauB5-0003sZ-PQ for qemu-devel@nongnu.org; Fri, 16 Feb 2024 04:06:41 -0500 Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41FNH0YS003311; Fri, 16 Feb 2024 01:06:38 -0800 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3w69bg4q5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 01:06:38 -0800 (PST) Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by CO1PR02MB8521.namprd02.prod.outlook.com (2603:10b6:303:158::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.27; Fri, 16 Feb 2024 09:06:36 +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.7270.036; Fri, 16 Feb 2024 09:06:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=hwWa4ydQACrkEjLzxBeHe31jylI99pgtZP9E/Lsev GI=; b=ZfBAeJrgSOrpOKx9ZV9vK7EW5SrcqtkhGgVZebq67tNYtlvYPLTAxNpQk 04P4O4A63U91y45zj7sADohQZTlax0EfeqXWyAm7PruBUHCG1plRLGj8lKrr2IDa X+AnsRc3DVcHmRBgnStbAfxbw4HBztL7B+JGiQeFdmVRnD97tCyxtvTeNe2IcLy9 9swH8mTKKvNr/MntzODEvnZ5wFkyDFCI9WZHtew6kUKsKtjOhSgF7qSGoaPbrWVA Vk4+b52vR5MvxOk422jA/mYRlY+DuCtxqlpyHYkNOFRtz1mTHc3rTzFdm87ke/LP oPDcIR+sxim7Jn48djigmEjgqiM1w== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P57V1hY7OPNclvwGenmWaUROU+eqdL1sz/y3hCQABUzzR0IiwGIOwL4ezKAgrfoOCSYZxcuVNcFkWqKEqOqsfTyVkbtiqjGRduu/O28h8rbMjWFbmt2u+w4x9IlCXaNnR0xhtknhMeGFqXyTnfZfGfIu3nZQTXcV9L4oQBhvvdOHn6LLDNsBSfpGe+SygN2QF8MZbogtkSmE452BE+NfXoib0JVE6pGib2cOqDxe33JcJ4/RU9KQsTiE2UOtMWurZYjn41l78l6ry0uNlVQO9l8GdkLAqxy/HaUXSIdywXnEz+rx1Ix6r0WeNetq97pRhAzPEmsNwqjVQuqaipDR9Q== 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=hwWa4ydQACrkEjLzxBeHe31jylI99pgtZP9E/LsevGI=; b=jKXmMpaNPlnxdBZHQU8CzWufPU/uGrZXDiykh+ToUpLa6cYNETq65vXIPuJipsT06sm+RFtmY/uOwMcazT1KdLN6nXOY894AIO5nA9o01jrp3PDFDQ6bMT1OIfIR3O4MYyhRCgDMlGG5fS9XCTzbtzJQVsSzJs6PR/dXn5LSer4pXBAUR+p5ZzDh7PM6fNbGlrduusDdSUrWOvGDBE5yUSdLyKTAcfUU6fTvkiQTp7cq13pmVcaa02b317xABOUQjHwhDtGcknQYUvPJRNkPTvk8zP1ua/5nR+TUUnEfG3kSU40z3EIQzeEHBxqtko5umy//qcamC2ZQJ2UJpjcmVA== 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=hwWa4ydQACrkEjLzxBeHe31jylI99pgtZP9E/LsevGI=; b=BaNeP6j9KhwR9n+AKthOI/9DE1UVdb97rB5mEvHk9VLOo7lNYx06mIxbKfBal2YkcXUYEbMVB6NGvLFhxbx++tD3cPplKvSYB1IuXF/dY0qwWB2ru5wXFgd68ppaFw8em1ZNDqrRXInJAfVL05lOKXEPozYJXZ+7lVubLc59H03cl5dUOPcaFRxDeuPQLvqQLCqcJ8j0OiMjeC9I4r0v0UnUkrSzc4AJl+Y7m4M2EVXl/oiiiffHNCQg1AN0ToaR/FyQYujr53n1aiQ6y1NTxQmKX9VGFJIPZxx4J0gWAGpX4G/QMhXHskbUitXkfPawX7/ImoXMy2QlV+gsfZaT6A== From: Het Gala To: qemu-devel@nongnu.org Cc: armbru@redhat.com, berrange@redhat.com, peterx@redhat.com, farosas@suse.de, Het Gala Subject: [PATCH 2/3] qtest: migration: Introduce 'connect_channels' in MigrateCommon struct Date: Fri, 16 Feb 2024 09:06:23 +0000 Message-Id: <20240216090624.75445-3-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240216090624.75445-1-het.gala@nutanix.com> References: <20240216090624.75445-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PH8PR20CA0012.namprd20.prod.outlook.com (2603:10b6:510:23c::10) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|CO1PR02MB8521:EE_ X-MS-Office365-Filtering-Correlation-Id: 45897fdc-c83a-4b59-61c0-08dc2ece9415 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: wfih5rKEk6uQJx8xe9oNaZcSp/FsHN2KDYvt2+nKqI2pRWqox2cqTzvgmXyEEn2XvA+7CJ5QLccUZkGa0lEifP1faA5iWXihFMSTVSRUf2q2WcIeWcBwaltz3y3mJvwlxMT/C1WebI2xoSapc7jc8UMoG1NbACEtiD41sVXa0uFLZLUUTTBDJKJ4lcYzRdAaAATRWCFIQS/XbK+Z68XnMEyirP5X8Q8Z6wkLB2yi7yxC5wZ7swntEusa5TNlTT3u6Yb9EwBJH+G1WKX51s+OY5nnoOHD958tt70TsMHuxoZpAonnyRvjY/tmyNPW+ju/m9aIa4aFzfII+6tqyLGjyZkKdI8g7KoDMVECih9uksc/WhCFBww895r6t6cZrF6RRNsKiQR861/YiC7apdQu/zv8Fh3Xo7LedMfqFt7R9MZIv4hisWQh+uHYSFjxiS0YzfEz3FJM+uqo4pSGiL6tJdIPwZe3T523K/s2oNXTpeCXVn4A3TODsNeV8FR5re/f0183Wgwft+Vve+O1gRh2eppfUvlfEO3OQ5NqOaqBRqoiUibK1SmHaTn4UfOHl2dhcAh2FrQ3aSYJMTzhJEC+yhbE3MGBqlLuI+AbT9WYpq1o3Xx5lizvKvZ8LHRaM7F4 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)(136003)(396003)(39860400002)(366004)(376002)(346002)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(66946007)(44832011)(66476007)(4744005)(2906002)(8676002)(5660300002)(4326008)(8936002)(6916009)(66556008)(6666004)(26005)(38100700002)(107886003)(1076003)(36756003)(41300700001)(38350700005)(86362001)(316002)(2616005)(52116002)(6486002)(6512007)(6506007)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+yJYg+hbU6fZTynmYmv0BGA7yOZ5m4GRFVY7Ch6FjunMnysJI6tETQ/2eCNF?= =?us-ascii?Q?nuo7wQCog7Nvx1imE3WawFVszt/Wvac1VtS3W+pGJiS49JzLDYGKwQgKen+L?= =?us-ascii?Q?lZxRS7LSVRs4B+ACs0on7f4F6QtFsXWBMDIDt98nWNfXxegPrAonBAB7Un7C?= =?us-ascii?Q?oS7jJA2WJDKlaOeC8wU6TN771fy6fdqiDB6Ad/n/x66I1kNOflODNww8AgR9?= =?us-ascii?Q?kWWzfUTajYfKh5CHZknMNJURdZ0PxpjV+GGldTZ+FpViQAOR6GndxN2B6UIg?= =?us-ascii?Q?v4hN6UveJQB/vLEOXmXocfjUUkfjDQkxymJ9in9LeQYGox1jdviQunTzno0V?= =?us-ascii?Q?7Jom0YEeDe0NQBde+VOrePYrh/eUHmG4P+lZjtpJuhLmAxNFTQXCmcKBmrcg?= =?us-ascii?Q?5lG1rJBM6/EJdwdCY0ZtXRzYGMKkQ74/HQMBJMcVXCD6F9F96lrvigYwY9TJ?= =?us-ascii?Q?GdtAk07CSJrEYOI9AC/EoTe7y/e7t62BQiTTqrbeFKo1CgOh5+2W0t/VdpJl?= =?us-ascii?Q?zgAZ8F9qS3mPtsBUCjsJd1YcS30i6cuyOkYBhTPRvOYeC98qJJB7E0agDvx2?= =?us-ascii?Q?xGxk/IdNm6hRgX+RwI528xgIsikjwwKBIt1eTd+l5Mbx+RGHMqhgn5wutzpe?= =?us-ascii?Q?xa80CYI/5nr1fClZpWYZOsnuC4eww/8TtUcfnQg2jPY+8D8CAHIyASf+B+4n?= =?us-ascii?Q?2VfYf7jgZinc6SMgJ7HIXtnPc1BqEKl4cJp7fcBf5/DZoxo7VHJTCe2ThnXM?= =?us-ascii?Q?5q6EFj/6IVYny7QS/mE/j7lBrvEPipoKiIio42PPz9Z8KlxjTW6JwM3flASL?= =?us-ascii?Q?2mcYrl5DDyVJSrOel5RUrbi7sBswcdR/0avTfxnXwKiJDtbb3HU+RmuPmreo?= =?us-ascii?Q?mxR3MM4eK5paH5jzfXBYspLGwIzFkKEVB/Vabj/hNvlDJAJ6AOCd0e47EOsq?= =?us-ascii?Q?emFL8oXIu5KbNsqiW0zYav8dr8HsQN1mlbZhkkryYvFsrH+C8M7uzcUwEFA7?= =?us-ascii?Q?Kn5TyYvxtnkYHtC/48NwzIkZZKcdCxLkZpQFyWVZh2GrcM5tbLX6MXgoaV1E?= =?us-ascii?Q?3nVXjxnXmWpl523+kIBBGiTLFmY4cuO+IEVvDesDKZqIB8fb5PipBvkYdNZM?= =?us-ascii?Q?ancthA3rLOWYceIT1WUhODcU1TT8a+8LN2iDvczR7Xys00K7fI3uruCYVqxl?= =?us-ascii?Q?fSMrNNE6+gHgdsDs8WiXX7Z5BMuk/qX9LvdZ4Pa7wvFFXYD9jDTnCHabD/4F?= =?us-ascii?Q?4hFoj3YKI9ltNriKYzCS3ZXgCWtgkKUhETMnNPxnTUaZq+46MEuuPUky3ihP?= =?us-ascii?Q?LFZndFnSgT9B3evF3+Ie6NoQLMm0I/lHLvG/8lFyqvsTteXNbh7vM3A0RdXJ?= =?us-ascii?Q?IO/WJmpNh521M7iAuo961KQ8a/3B7RIRpEkK2yLaa0h7W63uiSPoMQxIGRgt?= =?us-ascii?Q?xfO0nIDGw4lmggOQpmdvY5ocKAGr1utWqX+F/Jmgkrmir7W3k9fuTetqKYTl?= =?us-ascii?Q?37yfX2v56ZxGIyZOEfc9CcAzfdUcyr0SufuElFuGTZLnlNh4J9OelCkdtEj5?= =?us-ascii?Q?SgDCVY/jGTDiBCjm4TXHahzshvkyoSwuuzc3YAYr0xpFbXQspmmZKcXwwO3O?= =?us-ascii?Q?OA=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45897fdc-c83a-4b59-61c0-08dc2ece9415 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 09:06:36.3907 (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: PVqWDCK/NNXAr3VfROtKY91/tUslPh8O1Fq9UuMfw5NLeTklI1D1Ep83VeML1WcCOeHmH0b+iQPib5mgs7YcIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB8521 X-Proofpoint-GUID: hF06Yhx4o4Wqq2vJI3pqEXVmMX_AvNeC X-Proofpoint-ORIG-GUID: hF06Yhx4o4Wqq2vJI3pqEXVmMX_AvNeC 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-02-16_07,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.772, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1708074460318100002 Content-Type: text/plain; charset="utf-8" migration QAPIs can now work with either 'channels' or 'uri' as their argument. Signed-off-by: Het Gala --- tests/qtest/migration-test.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index e7f2719dcf..0bc69b1943 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -704,6 +704,13 @@ typedef struct { */ const char *connect_uri; =20 + /* + * Optional: list of migration stream channels, each connected + * to a dst QEMU. It can be used instead of URI to carry out + * the same task as listen_uri or connect_uri. + */ + MigrationChannelList *connect_channels; + /* Optional: callback to run at start to set migration parameters */ TestMigrateStartHook start_hook; /* Optional: callback to run at finish to cleanup */ --=20 2.22.3 From nobody Fri Nov 1 05:39:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass(p=none dis=none) header.from=nutanix.com ARC-Seal: i=2; a=rsa-sha256; t=1708074458; cv=pass; d=zohomail.com; s=zohoarc; b=ViPyvSxYUsiJnr5P0eQdnOj0cUpmS6FLwJAKKynzD3/HxJ/fqyyU8RdwqTTPOKrf+mAVQX5HfQxCveV+iL5SfWlmwNod5Cn+Yii1FHm5rMcsMid6LQtQscxFHcUyb6ilpHTx+q0ywTtSQw/G2sUSC5XuQ0uYlY85Ur4IKRagZK4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708074458; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8wR87dIDhi4kjZ5//Fd6BW6JjdVFRyo5dwvrvPb8FEA=; b=dtFKLh0o/au32iI96VBMxmJsDqsxBtgROseKZicun8oUXiP+bET1QJGlzDxeFIuZHKXaiMOwskO2mH/B9ZDI9epgArqr42ge3H/k30oodtI2t7CPYZ8aPvOG3gT7l8CHinMIzFOpWphdgBkIJnNjv2QSdXIxlc8ptishXWb9NpM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=nutanix.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1708074458709758.6845122874762; Fri, 16 Feb 2024 01:07:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rauBB-00026V-D9; Fri, 16 Feb 2024 04:06:45 -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 1rauB9-00025T-0B for qemu-devel@nongnu.org; Fri, 16 Feb 2024 04:06:43 -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 1rauB6-0003sk-VN for qemu-devel@nongnu.org; Fri, 16 Feb 2024 04:06:42 -0500 Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41FNHCVg031610; Fri, 16 Feb 2024 01:06:40 -0800 Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3w67jacvmp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 01:06:39 -0800 (PST) Received: from SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) by CO1PR02MB8521.namprd02.prod.outlook.com (2603:10b6:303:158::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.27; Fri, 16 Feb 2024 09:06:38 +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.7270.036; Fri, 16 Feb 2024 09:06:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= proofpoint20171006; bh=8wR87dIDhi4kjZ5//Fd6BW6JjdVFRyo5dwvrvPb8F EA=; b=FWa68d4wabAnzxRXwCfdk+P9JNs6Sjz2/gEnOoqk/3ALedSP7QsDPw2h4 gwlvBs+NkCARQu86BzFEnQ4k7P9Eyl24ZUIegOh9CvG+UqD2z7pqujO8P7umOfBr 9S0eXwukIUqHFkh707lYI4gLOBkwrGV8Q90l3412H8Y/LE8URvPAbBCKVKS3sKQT 7Qc7TwNqQ/OmqDoTwmFP3lbUuq/emdSG+RSVYBGD4Wcs1G7l/4lhQVogezz8klFP rvXnvTrOnptdh0NKNY+VCACl4eRh/zLqUOTi9JAidHJD+FSjar9NPCAWdogEbEME AhWNO4E1ieqhqtQkDreJedavOp/+A== ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VjE1Q9k64Wn6L+xLsVGfgo8E1CFoKxLvHWDRn7tdDagwqCko+rn5ekxKBxC2LwHgXbUeeuQ6QDI/KazH3hddaZtS16d9fah9EiAmn3i3wc2tfmYAME1u4h/nF15JaX7CYU1MSRy3UCkIQ960FTGM6zFb7/axgGKF/qfzQM6POl+TcKDsonNf2UBqMSycfqTt4QqpRvYkIrNUq6KjJJHfdEYmC4RKFFQblSL8/9dKKBuz/2v5pkAajucfZqrL38Qq78Ka5lBEJnroYAmVIsJ+9nm0GdBc4wO/pfWQYb7c3l+l2qLbHwTu7EVNtjzuVDPzTgSgmkLjhRUEJukSC5I4RQ== 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=8wR87dIDhi4kjZ5//Fd6BW6JjdVFRyo5dwvrvPb8FEA=; b=exo24+LAJ4LPKcap8xKkZSr2vjrddM4b+V6BptmH50+wA87i141LV3MnP421YPy/S0l+lk7IfkFRAH4IvoNcrCjcqG5xrPrXOmv2ltem51f1W22PfJgSknH0q216KQqnIh2jU97uquqQtfE1uSYtsTGDkwbZFXu+h+GQRVeX/479E5j52zWw8MIzDte/rtR9eqWcx9ipUhI5vCgumxbqzzJufrTls3ueV2PLres137jV1rRnUkHcsNh7T9X3T6+R5nunSudYTjD5i5AvF5C8VkKMGOeoaAPOImew1fzL+qk72KiXAAVsLLZ7geFduwclCKYhyTjkwOtZ51La6kl7Vw== 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=8wR87dIDhi4kjZ5//Fd6BW6JjdVFRyo5dwvrvPb8FEA=; b=rw8e5SeLfYOHiTqQy4Xo4tgTRdAPVETFfisxXmE5xiJggzKLVwQJEv3PsSWKZlxmaqYB1UD4LYSWrsiDHJAYCurO8M8fqsnnqCTHxc35g6n4HTW37aURLfG7aOZFR14iZyhrA+ewdQDwTNaTp/CVCNOOSqY+rkcjNohXqHchZoQXynAAb2rUhP/BniryXwSorYiTvTDAIoXyyQiAdHR3oTARlI96Ai6Ni5RxZAI18DisU7/PYEGFi7QBBa0UHknYiKPjwKUcBKgd4A5UITQF5zBHPFvSmMD6KBO7hRv1a5oeN3w00DOciD22h8AU3hO2jUWzvIRoKRGVLLO2SXPTBg== From: Het Gala To: qemu-devel@nongnu.org Cc: armbru@redhat.com, berrange@redhat.com, peterx@redhat.com, farosas@suse.de, Het Gala Subject: [PATCH 3/3] qtest: migration: Add negative validation test for 'uri' and 'channels' both set Date: Fri, 16 Feb 2024 09:06:24 +0000 Message-Id: <20240216090624.75445-4-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 In-Reply-To: <20240216090624.75445-1-het.gala@nutanix.com> References: <20240216090624.75445-1-het.gala@nutanix.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: PH8PR20CA0012.namprd20.prod.outlook.com (2603:10b6:510:23c::10) To SJ2PR02MB9955.namprd02.prod.outlook.com (2603:10b6:a03:55f::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ2PR02MB9955:EE_|CO1PR02MB8521:EE_ X-MS-Office365-Filtering-Correlation-Id: e36cf57a-0ec4-4d75-475d-08dc2ece9530 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: c/z8TX7FE67gLiFTeY3mIt3UE74rBc9XdT0mqKdH7ZWcDtC2JoJgUsYBVhvoBt4J44HPwU7HZB4PHmha6bPr2ilNgvI/aMzQGBppuZCY11U4HHuMbK+sbhUvFNx6ps2BVBI3Qsrlm+QcpAs1SRQQL+v1uKykGQVV9x9A1RKJX5LbgrsMVDGf8rqfmOjJQB2Zhxfv3F0l+Jxzh4AMqMeVlgtLk7a1J+ymNQmAIVEC3Iav/zOxO8PLYeA+WO+960ZJj7gv7KO3ABYqnmkDsk28BIANmXfO5afkjc5mamaM05yaiXtU+snoBpf20DKdKNH4C07Co8Xfv7L0gdts/MFVRi59ERPT9csxC9aysolbtOfpmKatG8Jl5cpsuG9Bm8WKiEGmHbN1RZnTQaVZaQ+RiRafU0n9ydxl3SHXPuLgTGJyxAcBsA4x5W2MVoGK97T7WSc/o7r+km6j0WZK6kdqlzqJyU3bhT1k/d6EK3hVMXAvHL31SXAt0fFdIe1kQ3hIJ33KKjvgzVnPc1eG+d+TJtWLQt9ZeJ2QZfOUYMHMfRlvAd1WwJv514pXLAwXXmU3tvO1iuU08iw0cCfnr7pjr3XUK3JUkz9aDZ/2z133ode5fiZ6nJonj7+DX+arkqYX 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)(136003)(396003)(39860400002)(366004)(376002)(346002)(230922051799003)(64100799003)(1800799012)(451199024)(186009)(66946007)(44832011)(66476007)(2906002)(8676002)(5660300002)(4326008)(8936002)(6916009)(66556008)(6666004)(26005)(83380400001)(38100700002)(107886003)(1076003)(36756003)(41300700001)(38350700005)(66899024)(86362001)(316002)(2616005)(52116002)(6486002)(6512007)(6506007)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?CRcwstRWLtouyfVf16Rm+Uuh8AR1vF5FZZ+I+Pot0vNqIrJvmW4uBo2/P0mW?= =?us-ascii?Q?+b4OtZ+7JqypIQVevwJMxTsvcFKyJI92rM1XQSXfaEP8w3y59lY0BIn7RJbi?= =?us-ascii?Q?sQLKTbyp0znNqJ3YjnYwGZ+n1l5nZx1fPJ0McJXwup6FFfOx0WqdZsLlk966?= =?us-ascii?Q?J1d0HZ+raqzstLLTPvZ44sa+Ca5cKjxg/mSAz2Or0kZKn5r8yrvZCO2MH373?= =?us-ascii?Q?nngvc/+0TnUAOtBAW+PiV+/pmsGaD24JAMD73M74MyhoIcRWYooTZtTuXMp6?= =?us-ascii?Q?dObkWlPi06nHbr6e8OUQjbnt7d5+hixY4UrM8lMY7dIMYu4z5mtnHLsbhIcV?= =?us-ascii?Q?W5N5JlW59JLcnDQBY641rGqGnZjCwZvG40YgXYsOg7duekJ+U3KXHPIDGY/o?= =?us-ascii?Q?/S+uZWRuSJzL1W8W1V4flAXFO4m5XupJIcyCsovdbV+W0yFXU2IvNsIn7/Dc?= =?us-ascii?Q?USq9z/iaEtq+arZl11GZ28ttgRi/NkaGdVbfO3Lu4vEuho6rob5F+FYZD9zy?= =?us-ascii?Q?UF4qj201JTYH7hEhISo4N9q7YxhqS5r4d36xAqjW8JvnkpLe9F1LWepnLpjy?= =?us-ascii?Q?kd3kr1b8rKN+IQzdo3B0Gr2WvI+Ljd3PkmO74xyaSIgIHZRjRRpSSahN651o?= =?us-ascii?Q?KqxmFa7CTzBDjx7tIFwq4tAkekEOXUCZrTcDSv24fx/xxEhOpywL2ajFoxpH?= =?us-ascii?Q?WJorFFjqqurE3IVm0fxv2rx8xE8oBRyb/jOPCvHMdOxysQVntW5j+NdR/5WY?= =?us-ascii?Q?ylch4u9PwhNfwDNMg4PJpYtk02ZPDXBTuMVPXpLCL3+ZgJxoFlHRpv4Qc52B?= =?us-ascii?Q?1uDHOaealmElbmEh5C0/KbT0OPDlaY0tnhPFptC2Qe0NSAf1PmaKE+kEB+bb?= =?us-ascii?Q?WYU40tftm5Q4GmV1aM/Mc+9mOcG2xHAj+oJrwS4pxCOUOdwP21uXTTcvN1Do?= =?us-ascii?Q?32S+IcdkG2SYwdhU4ku/wtkisG1DM4vB4vTY4fub/gzJIzn4wczUHEzn0+Wz?= =?us-ascii?Q?XQwvmir+KUyDzYMtWvR4GvuxNEavKYVGkjMqdifO1bH4NF6A2JqaUtkHfZvJ?= =?us-ascii?Q?zW4aBp3vyVgjGpRUH6m/1+d0X+TiFElCINoRV4H9QpN5hNdni72rlZDl3ozG?= =?us-ascii?Q?B0kakE8/WZJ3GUMsfaUM8hOpev1lp4RHnd94iaB8OW+tcx7y2SVW1pc4Edus?= =?us-ascii?Q?MSzhDo3BdFVtwm+y0OiJFlij8xLBeRMczkkFE6KrDeIpOo3QFLIDm5iqdxs9?= =?us-ascii?Q?JGiCAzTT4Gz/tu3O6QvnofRb3edz3QiLKCGm4fr/jAH2Obo7iBuSXyO5gNkR?= =?us-ascii?Q?DU9OeC1Cv/n/uSjccw1lYqm/8m4yLppgnqmi8+6OJIbSxzLI45njks1VLgLW?= =?us-ascii?Q?uuFm84i1nCYbo5x/C8vatJwifi+Oi10v+BU3qyWPxG2e2kov4vT/6d3vDZqs?= =?us-ascii?Q?DM5PimcqNogQ8FP38xaNSHQgSJIKEI/WH3WdLeJpN/R9azBhTH+x2CUx3u5g?= =?us-ascii?Q?ErY+tLBqwg865CL/334EpKPf7BO7sPH8AyCJKAgv9E+6f148SRSC6nAm3VIo?= =?us-ascii?Q?4QrbwlRV8qT1TgkQUStYA9CkaV1k30BmZygvyzblR2JBUFOMDhrDS3zaNG3U?= =?us-ascii?Q?cw=3D=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: e36cf57a-0ec4-4d75-475d-08dc2ece9530 X-MS-Exchange-CrossTenant-AuthSource: SJ2PR02MB9955.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 09:06:38.1969 (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: ui8d3FAQI0DOkxwGxv9aPFf8EFWDUm0pt+aJbwQMOG5fiFcdqpJ72XM7H3b9BmIxxFrD5dh2MjbDdIgad9Mfzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB8521 X-Proofpoint-ORIG-GUID: zKtWPXX6-wwfjN0dgtcLuiLCRdwV5F_K X-Proofpoint-GUID: zKtWPXX6-wwfjN0dgtcLuiLCRdwV5F_K 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-02-16_07,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.155.12; envelope-from=het.gala@nutanix.com; helo=mx0b-002c1b01.pphosted.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.772, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @nutanix.com) X-ZM-MESSAGEID: 1708074460913100007 Content-Type: text/plain; charset="utf-8" Ideally QAPI 'migrate' and 'migrate-incoming' does not allow 'uri' and 'channels' both arguments to be present in the arguments list as they are mutually exhaustive. Add a negative test case to validate the same. Even before the migration connection is established, qmp command will error out with MIG_TEST_QMP_ERROR. Signed-off-by: Het Gala --- tests/qtest/migration-test.c | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 0bc69b1943..9b9395307f 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -26,6 +26,7 @@ #include "qapi/qobject-output-visitor.h" #include "crypto/tlscredspsk.h" #include "qapi/qmp/qlist.h" +#include "qemu/cutils.h" =20 #include "migration-helpers.h" #include "tests/migration/migration-test.h" @@ -2516,6 +2517,86 @@ static void test_validate_uuid_dst_not_set(void) do_test_validate_uuid(&args, false); } =20 +static MigrationChannelList *uri_to_channels(const char *uri) +{ + MigrationChannelList *channels =3D g_new0(MigrationChannelList, 1); + MigrationChannel *val =3D g_new0(MigrationChannel, 1); + MigrationAddress *addr =3D g_new0(MigrationAddress, 1); + char **saddr; + + addr->transport =3D MIGRATION_ADDRESS_TYPE_SOCKET; + + saddr =3D g_strsplit((char *)uri, ":", 3); + if (!saddr[0] || saddr[0] !=3D g_strdup("tcp")) { + fprintf(stderr, "%s: Invalid URI: %s\n", __func__, uri); + } + addr->u.socket.type =3D SOCKET_ADDRESS_TYPE_INET; + addr->u.socket.u.inet.host =3D g_strdup(saddr[1]); + addr->u.socket.u.inet.port =3D g_strdup(saddr[2]); + g_strfreev(saddr); + + val->channel_type =3D MIGRATION_CHANNEL_TYPE_MAIN; + val->addr =3D addr; + channels->value =3D val; + + return channels; +} + +static void do_test_validate_uri_channel(MigrateCommon *args, bool should_= fail) +{ + QTestState *from, *to; + + 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. + */ + if (args->result =3D=3D MIG_TEST_QMP_ERROR) { + migrate_qmp_fail(from,=20 + args->connect_uri ? args->connect_uri : NULL, + args->connect_channels ? args->connect_channels : NULL, "{= }"); + goto finish; + } + + migrate_qmp(from, + args->connect_uri ? args->connect_uri : NULL, + args->connect_channels ? args->connect_channels : NULL, "{= }"); + + if (should_fail) { + qtest_set_expected_status(to, EXIT_FAILURE); + wait_for_migration_fail(from, false); + } else { + wait_for_migration_complete(from); + } + +finish: + test_migrate_end(from, to, args->result =3D=3D MIG_TEST_SUCCEED); +} + +static void +test_validate_uri_channels_both_set(void) +{ + g_autofree char *uri =3D g_strdup("tcp:127.0.0.1:0"); + + MigrateCommon args =3D { + .start =3D { + .hide_stderr =3D true, + }, + .connect_uri =3D uri, + .connect_channels =3D uri_to_channels(uri), + .listen_uri =3D "defer", + .result =3D MIG_TEST_QMP_ERROR, + }; + + do_test_validate_uri_channel(&args, true); +} + /* * The way auto_converge works, we need to do too many passes to * run this test. Auto_converge logic is only run once every @@ -3544,6 +3625,8 @@ 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); /* * See explanation why this test is slow on function definition */ --=20 2.22.3