From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a169b79069-2a0199d4-f648-4340-bcde-9bb1c3611c89-000000@eu-central-1.amazonses.com> Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11020089.outbound.protection.outlook.com [52.101.69.89]) by lore.virtuozzo.com (Postfix) with ESMTPS id E22EF80474 for ; Fri, 23 Oct 2026 17:03:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EC2VYUsYeyWE6ABhOuTr9FO3KEuYZP+/ejVGmnMZPgXip2bFMQRYKb2RgE3HLmcFZGIcC0y4CySD31eOQihQNXGmklBbMEPsc2JaAhy4iScWDU5yzfSrC0B6GD/TAtd++P5UgFqycvteuBHWgSx1cMmpV3AhoFYrnAPIC5DaLhUkYzbdDvzA6Lgr+ocN3rrZ4mCDbSWNBoKkFyJMikOM6XNb/vQ1LqsfqBwg2vX32pstcQkQ2Z4qpRalfvve1mKLG7DuzEbnAVhv7vM3J0eYfifOlOAuvPWG8kLAvX41V9cN9IpjGorAXWvWdLqVL6IeqqahP5JaXKb0wTQHqN/vZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=yx6+UPWy8q5CO8ieoexI++5EZRVu0kg8hCom5AJXxck=; b=hh+05JYgV07Mz++D+5PwortKS5RksM50adB5NInkk1udxQK5yTZXUr6RW7ISvXljIv3r/WOefV7gfj5pDvXby4euqqQAVSL5/rmwFMGIZgm4GRCObhL8utA12BBiDKiHo6oSWizu5Cm3qUFGuq7GF4r3Ea/rd9Q9buESfccV5FwubOwY9lcL8BGKM/0yv5y2ZcXZ6imous5j5Sg4FaDbU2fztowen7V1QzsTlMtPQ+M1bhe+A4w0/YU2hzHr0OW4fBKycl0Kb1Y91riY+mGgshOdyfUm0f3QF8KQIXoHY0ZZYsiHKTRSLu20lnUYN83Iu9Z/tzx4kPF3kELYuv9VWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.6) smtp.rcpttodomain=virtuozzo.com smtp.mailfrom=eu-central-1.amazonses.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com; dkim=pass (signature was verified) header.d=amazonses.com; arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.onmicrosoft.com; s=selector2-virtuozzo-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yx6+UPWy8q5CO8ieoexI++5EZRVu0kg8hCom5AJXxck=; b=pTFRMkEQ9p7p8tdCuQnTSrTcJtehQeTdEpoahh7hDuloypeLizeJXCJaviAVxHYrmWttrmGM0HiHGCYIPmBDn2Sm0IrYpoerE/wLgXsn7cphmb21j18DMDwCFYcLIc8DGamgIrZwz/R1Q7dVRFB0YczuibamSXEhsxe+DkP4TXM= Received: from DUZPR01CA0019.eurprd01.prod.exchangelabs.com (2603:10a6:10:46b::10) by MMZPR08MB551666.eurprd08.prod.outlook.com (2603:10a6:190:51::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.15; Fri, 23 Oct 2026 17:03:20 +0000 Received: from DU2PEPF00028D00.eurprd03.prod.outlook.com (2603:10a6:10:46b:cafe::84) by DUZPR01CA0019.outlook.office365.com (2603:10a6:10:46b::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.546.19 via Frontend Transport; Fri, 23 Oct 2026 17:03:20 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.6) smtp.mailfrom=eu-central-1.amazonses.com; dkim=pass (signature was verified) header.d=sashiko.virtuozzo.com;dkim=pass (signature was verified) header.d=amazonses.com;dmarc=pass action=none header.from=sashiko.virtuozzo.com; Received-SPF: Pass (protection.outlook.com: domain of eu-central-1.amazonses.com designates 69.169.224.6 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.6; helo=b224-6.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-6.smtp-out.eu-central-1.amazonses.com (69.169.224.6) by DU2PEPF00028D00.mail.protection.outlook.com (10.167.242.184) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.569.4 via Frontend Transport; Fri, 23 Oct 2026 17:03:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1792775000; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=TVeRHiCmbQLwM4s7tW6YiQxO55OdR0mx3xGrH6/JMtI=; b=1n03DL6WkE5cztlRBxF7iHNeCaiA8ktdEczyVdHQOp4oNZK6TCu9Rrya5wTf5RUn iRxYCRULNVZqhEJ1XKeObdFUYsZVwn8CN2lRq6p0CW3zPMiThYTYZntLLkzRzVfXKcT 05uGqZrFEkZlAHvkgirlZ+nJOrZ6XX8KfxeLmDGzRmFeN2Js+N+uFthggE8HGfhbtr9 fTeSODqeTnmqupSQbobBdaAXJ/lKczslAdazuKvdwnIftVO62Dg3lbf5Q3s+4bBBImv A9dzrcW52bnLcsNkeiIzjWsA9CwGsCqFEvuCL/fOOKJy4cvarB7NdFBZ/aq3S6zapOE gMFFvwkE3g== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1792775000; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=TVeRHiCmbQLwM4s7tW6YiQxO55OdR0mx3xGrH6/JMtI=; b=a87z3fzqpOVui02uTwKdqgfsPS9jqaebjN0Lm9NLvhbAtCK+tKRDMnSDdsy0sPRE 5aPJn3711VxqcI2tSpNjgS2pgdSEmeUzAQhb9NLmZMr8PvedoIi+PIdpy4qW9I0taAn oGbdC9S5TrJ+nd5LCN+cfj//bHywmgt3H+YlHVls= Message-ID: <010701a169b79069-2a0199d4-f648-4340-bcde-9bb1c3611c89-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH QEMU HCI-8.1 v5 07/36] migration: don't refuse a blocker over a migration of another mode To: svt-core@virtuozzo.com, Andrey Drobyshev In-Reply-To: <20261023-vfio_v1-v5-7-ba0bf3c6d122@virtuozzo.com> References: <20261023-vfio_v1-v5-0-ba0bf3c6d122@virtuozzo.com> <20261023-vfio_v1-v5-7-ba0bf3c6d122@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Oct 2026 17:03:20 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.23-69.169.224.6 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D00:EE_|MMZPR08MB551666:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: b87a9a84-794c-4458-28a1-08df31278a85 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-Transport-Rules-Loop: 1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|32142699015|9140799003|61400799027|48200799018|376014|261021121427099003|5023799004|5063699009|4143699003|261009223027099003|10067099003|6133799003|22082099003|16102099003|4113699003|55112099003|56012099006|5113699003|261022105027099003|13003099007|18002099003|3023799007; X-Microsoft-Antispam-Message-Info: kTap64WTHbITyam8gyVrtuCq2ZgxwNdqB3/dvZFh8WNdJJoetLS8HR61c3fAZz2BEOqTrd/eEebN1XC+aPIwrCRsrAKo7VkaEKEoSN499Q/1A1HggWGLrcxlwDCdnKnra1AVxzSTjtzYnOkaeXJVKqmBks9K2P9mH6Yj78FOxgZmEaN9ODQ5eovGoJtbRzdzYJgYSV3CKdBNuXjTBHCNosvGw0itysL16sJLPjwCo6pe5At0jSf+sOGouPXOKCAbRZxwQAoXRNLFpwiPGaaqQecCvjKtd1NXhbqBr656zRdcadqdV8Kzl2KLwG78zFtcmDd1RJYustfaWrbKCdUUSEdErJ2YA7J+uqgL2QqTlr4OsXgsm3OOgiG/o3V1QfUHobnvinVVEiclNS+JKRbi4ScuHreXD2abDTMxL/V36z04uUDrBD8U/Ce3RRkKqRuJxfVAeYN6nr5DrjapeoqR4HiKzGhUEG44XrtTMU0XHUhliOlwNH/4lSGWG+R3mOkRsxswsFdDhH5kb3gkKvH/dY0X3KyAUlMZxk5AKryJsrzoS7SE1uVaxskSDF4P2x34XH0x5dWgf6tk5uR19BKUniKJZmJH8Sy/rJG7pWsCmrGBhduHkySuvcOGKzrugsWRyS53VwQScOg4uu46unspueutdKd2KgcddIkzhaLQq1GlyTd0PiJSi5IlebCADkJtWEH/L6kNwtf1uoVfbOsgLs7tV1XVZPoq9W4KN9GCtXcCEAajJqbzO0TTqLm4gq4XAt5alCRThpVKTsAY+EbtW7xofa+Mk1H3LvyHklTSLa2ImfOiJugzwZQ4LU39FkWcf4rAt+JnKjqmtPPqDj+ApakOTXbGcqVH20L3QLI8pH1FUd6nxWLrXeUtTGt6mnV6 X-Forefront-Antispam-Report: CIP:69.169.224.6;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-6.smtp-out.eu-central-1.amazonses.com;PTR:b224-6.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(32142699015)(9140799003)(61400799027)(48200799018)(376014)(261021121427099003)(5023799004)(5063699009)(4143699003)(261009223027099003)(10067099003)(6133799003)(22082099003)(16102099003)(4113699003)(55112099003)(56012099006)(5113699003)(261022105027099003)(13003099007)(18002099003)(3023799007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 53QhGcTshL5GXZhTBZWp8gE1cQ2K3s04JdN27nyrYcETl9jAQh0Vx2F20kuouaJtfdEFL0Eh/b+9x4Me8xDLcXenVYRpDN//6O9Wmc2FdpvqEwnHBgAG9qtxs551QM+rQ/EhvqlP1h7mfTbrYfMI+eO4qRy367gxOEXw1WEq5Kw2tWd3MtiyIIJ5AysTbRv3bKqT32Z4yhqhL2zqDsBetvSK6kQqNb35ih1UJFk42GY6Tu3lmSQM2CX5FqjNgOMTyGirUVkdv26VUOXCdgY5/3NX6knXq2PKTjNQw3fneY0R1cF+akM0QH3XpBIGrTZPPv4jOm0XZ5e2NUt5XYJlajA2+zW0TRO8Xa45gGAywBL4xxk8lBMg6MyKXugEzKJSWl+HH4cD2VBadPMWyLX6F3u3+q/2LC5grOIJtiMwyQwt+E1kGS+Lal8oiPjcTFRm X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2026 17:03:20.6482 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b87a9a84-794c-4458-28a1-08df31278a85 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D00.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: MMZPR08MB551666 Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] migration: is_busy() infers running migration mode from mutable mig= rate_mode() -- commit 7374a894384272ece1d26f3fa1c922acfae8eea7 Author: Andrey Drobyshev migration: don't refuse a blocker over a migration of another mode This patch changes is_busy() so that a running migration only causes a migration blocker to be refused if the blocker applies to the mode of that migration. A running snapshot (RUN_STATE_SAVE_VM) is still checked as before. > diff --git a/migration/migration.c b/migration/migration.c > --- a/migration/migration.c > +++ b/migration/migration.c [ ... ] > -static bool is_busy(Error **reasonp, Error **errp) > +static bool is_busy(Error **reasonp, Error **errp, int modes) > { > ERRP_GUARD(); > =20 > - /* Snapshots are similar to migrations, so check RUN_STATE_SAVE_VM t= oo. */ > - if (runstate_check(RUN_STATE_SAVE_VM) || migration_is_running()) { > + /* > + * Snapshots are similar to migrations, so check RUN_STATE_SAVE_VM t= oo. > + * A running migration only matters if the blocker applies to its mo= de. > + */ > + if (runstate_check(RUN_STATE_SAVE_VM) || > + (migration_is_running() && (modes & BIT(migrate_mode())))) { [Severity: Low] Can this check pick the wrong mode for the running migration? migrate_mode() does not return the mode the running migration was started with: migration/options.c:migrate_mode() { MigMode mode =3D cpr_get_incoming_mode(); if (mode =3D=3D MIG_MODE_NONE) { mode =3D migrate_get_current()->parameters.mode; } ... } It returns either the CPR incoming mode or the live parameter value. Nothing latches the mode in MigrationState at migrate_init(). The parameter can also be changed while a migration is running: qmp_migrate_set_parameters()->migrate_params_apply() s->parameters.mode =3D params->mode; I did not see a migration_is_running() guard on this path. qmp_migrate_set_capabilities() has such a guard, but the parameters path does not. Consider a normal-mode migration that is running when the user sets mode to cpr-transfer. If migrate_add_blocker_modes() or migrate_add_blocker_internal() is then called: - A blocker for normal mode only is accepted, even though a normal migration is running. - A blocker for cpr-transfer only is refused with -EBUSY, even though the running migration is not a cpr-transfer one. If cpr_get_incoming_mode() is set while an outgoing migration is running, migrate_mode() returns the incoming mode, and the same mismatch can occur. Before this patch is_busy() ignored the mode, so this exposure is new. migration_is_blocked() already reads migrate_mode() live, so the convention is not new. Would it be better to record the mode in MigrationState in migrate_init() and use that value in is_busy()? Alternatively, could changes to the mode parameter be rejected while migration_is_running()? > error_propagate_prepend(errp, *reasonp, > "disallowing migration blocker " > "(migration/snapshot in progress) for: "= ); [ ... ] --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/20261023-vfio= _v1-v5-0-ba0bf3c6d122@virtuozzo.com?part=3D7