From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11022082.outbound.protection.outlook.com [52.101.66.82]) by lore.virtuozzo.com (Postfix) with ESMTPS id 9647580063 for ; Tue, 1 Dec 2026 00:30:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yUZtFReEVw7n3TOiQV/h+y6tP3Gr4aicO65vTpqFfPCDnhzuJ8GDQfjpX8OO21C+66b4vi39vmXXTztvotzdxAtOegtBbK2aDfcaWsHGpB+Voz898hNqoc/8bdGNBZKby+j9lXB+flKqZ84T2f/QnBlNjY3QQFZwzToL2kAiSuVmpe6prmABrBQml3DUiOsuh7DJWO+mZMgOnH07BPfjhS4YMLCtT4MASwvaMIIdd3MO5DlxzZ/oznbpFhJswObaYtxB8NsL+zLGJ6lTRXOkx3Edrz67hO1+z7AdfU/G5t8Cv/WbyPc71+oyLjOq8PBVqSS16BYx+z4MIfP0TzeAhA== 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=1Yqy3P198sZbbax2221QBFuUeLjdy6gxnwrb1uigfxU=; b=FNsX/PlwJXr8tVII0sum0HU0QEJcutWCCZ7/qxqawtN8wuOKxBDYWc+RXmyIYmhg0rxezzoOAqBNe1LIdjjjouHxl20hnyDp48WCqa8HuEWudbKogTj+cDsAp47WfOQDBFdjOAORzi3Vm3vt606dD/FYohN1LKDF16nHliPAbcv6hqZ2qCKqd9fkP0rJ0m2x66Jc0YNWNwflsRy+6vBpwjfsHhsoHoeV8xBRnjJI9U2awjNM+9hr32KTr/e+uWiUDsFd7GPRuUJwBb96s0jpsY9C/O16mTPjVyKu7WbWojxg/z8tqfMwvSQvuXLxFYvjd/QFo8aw6AK202VCG2fx6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.2) 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=1Yqy3P198sZbbax2221QBFuUeLjdy6gxnwrb1uigfxU=; b=XEUmg0dee/sPKpiDyx0c8wPmQCJ3+NgflhNvRWY8Ncp4NWkb7Ay8Dh4/9qRH4Yo4izLAGkn/VcveaTFJw3CJ4NcChW7GygSVXKgDwBIFuaylUb5khQFQmNq89vdfXNsUQvgM8I5FI1EAznvHhLyW2+dlwe/M3VzYkl0/CE/liNc= Received: from VIVP296CA0053.AUTP296.PROD.OUTLOOK.COM (2603:10a6:800:353::13) by AMBPR08MB743383.eurprd08.prod.outlook.com (2603:10a6:20b:78a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 00:30:30 +0000 Received: from ZR1PEPF0000E6BA.eurprd07.prod.outlook.com (2603:10a6:800:353:cafe::44) by VIVP296CA0053.outlook.office365.com (2603:10a6:800:353::13) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 00:30:30 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.2) 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.2 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.2; helo=b224-2.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-2.smtp-out.eu-central-1.amazonses.com (69.169.224.2) by ZR1PEPF0000E6BA.mail.protection.outlook.com (10.167.241.73) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 00:30:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1796085030; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=vG7MHbE4+WbbqRDPDklE2okhMqGnMNAVsSloLibVrBA=; b=wagDBnsTLoYmgDd0FzeMh/sJuAl39WlWI3AUsWO2dAh8IDIYByh/Hx39GXW7gBdg LviqHUFfd6dhfl/TlogmDZL3l/uh55IEOa+G1+ZpgcKsOfP/jD1lY7Nh07wqXs/wuTo 8qYnbHE1+lQfXraGpGxQEsx1kn9aH3gnC3AWQlpIHmXQXHdpP4ShLbkX0sDN3oI2sM/ VXuOK1shHYX5JyXTpI+bglkgt6LT5sBc7ym3ij3j9K/NKiila78SKvMes5K6IXK04q6 +ndl30Y2RBLH5FoeT/Z2Zbrc0cA7ZRa9ueIzd/thtbJPScYmSrAiposfMKS5B5PYYvP jVeCKikkoQ== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1796085030; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=vG7MHbE4+WbbqRDPDklE2okhMqGnMNAVsSloLibVrBA=; b=NS5gKho9NjGk4qvr+xtuEaZmeLpjHAxg7kwnP8xF+cFh2G3+PS9m+E/e6r16GiQz H3lxB7fZZUTGfFaN/pCFx50IZ1lwll+SBRo7h88e04h4cxU8HFgKcfy1lu45Gd4eNr6 zL1s4fXbsYiajXpHBoGGihm+T8NplPIXVShNl0Mc= Message-ID: <010701a22f029bec-701aecce-b69c-4043-9487-5de399bd72df-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH hci-8.1 1/2] migration: fix source hang on cancel before the channel connects #VSTOR-155277 To: "Denis V. Lunev" , svt-core@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com In-Reply-To: <20261125193204.1424799-2-den@openvz.org> References: <20261125193204.1424799-1-den@openvz.org> <20261125193204.1424799-2-den@openvz.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 1 Dec 2026 00:30:29 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.12.01-69.169.224.2 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZR1PEPF0000E6BA:EE_|AMBPR08MB743383:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 1ee4b901-9a18-4a7a-ae39-08df4f424de9 X-LD-Processed: 0bc7f26d-0264-416e-a6fc-8352af79c58f,ExtAddr X-MS-Exchange-AtpMessageProperties: SA List-Id: svt-core@virtuozzo.com X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|704160211799003|61400799027|9140799003|48200799018|376014|32142699015|4143699003|4113699003|5113699003|16102099003|18002099003|22082099003|13003099007|55112099003|10067099003|5063699009|56012099006|261028144727099003|261026135527099003|261026121527099003|261022075727099003|261022105027099003|261026140227099003|261009223027099003; X-Microsoft-Antispam-Message-Info: =?utf-8?B?MTd5em5maHhpUnFmOUtiRUVDQnYrSXVXYXYweE5RMm4yY0FrYlNlc2pBaWpr?= =?utf-8?B?dzJKQXczdS8wMDZ1eGljblN3ZWFkRUhEZ1ZIMnpMVE5nWVlsV21VR3JNcnRm?= =?utf-8?B?aWJGbjMra0RraGw1SXhJeHk0ZytFdFVQV2Y3L3p4ajlDSUxNS3luVFNFYi9t?= =?utf-8?B?SlN6NGFRS0FVaHdOYS9ObDMyMW1PSHJJYUdZQTU2S1BmbVRWQlVUaWo1WVlH?= =?utf-8?B?ZFBXc3R5TmJHcmhoVVpsa2ZOMnA0WFl4ZzZOSWtPTURpdE5ucDhjMUFoMHM3?= =?utf-8?B?TDFNSG5GUlZUa1NXRGRXdThMc2ZwaGVyL1BBUVUwK0FaVEFjM1kxOWRxcW1l?= =?utf-8?B?TzRVRnBTVkNoUVpwRDdiS3dDLzY3Zk1rdzBiS3F4VGgvelQ5Q2RINjF1VDlI?= =?utf-8?B?dGZXc24vVGZOVXFvRXNXZzMyQXg3RzZibjl2aUJza0wxdjFqVnRVcDFNVmZK?= =?utf-8?B?dlZyTUpXQjhUS0k2MjRFeGgzVW1ETGYzVlY5QWRKU1VJT1U0NEVtUzBrdGlQ?= =?utf-8?B?ZENHb0FkdjgrcWwycVlHamdBY1BtSWY4RmFkZEx2TU1qVFZTR1Jkd3Jxdkcw?= =?utf-8?B?QzlpTm9qOEhldUE2UnkzdlB4WGFZVm45cDMxdHBheDV0WlRReHRZWnVzb1dT?= =?utf-8?B?aFRFUnFEQjdMd3Nsdk9aVWNHWU5VdGNYMWxGV083ZWFXeXAyRjVZRU1ucjAy?= =?utf-8?B?WW5VNXZiYjhEayt1Rzd2bzh3TUZQcG1FSGNCSWFqM3Btck5XYWxzd0premdz?= =?utf-8?B?elpENkcwdERRVzlZYm1kNTNwSjZxTmhWZW9pSWhNcWhSY0VaMlFSa3ZqUWVX?= =?utf-8?B?bUU4dlJVTVZFdW5mb1hzS2U0elZFa0IwRURZOHNGN1BQUDFjUEJ2UU44UmpC?= =?utf-8?B?SlRVZ1FEL3ZJR2tYMHhyRXZxWVNqMzMxK3Fra3hWejlmWUtYNGFlZUd1RTgx?= =?utf-8?B?eFAvVDdlWUVrY05yRGdHZ2hBSDVRMnQwTFJQV3VvTTVDZDBTNnB3V2hpM2FL?= =?utf-8?B?cTZZV1R2K0VUK09FUm1kVWdCMHZjZGV5MlVnTUtQWk1zU2ZoMTFjSzRQZ295?= =?utf-8?B?cnpXQXowVHkzbmNyWFh0MkpvOGFvTkdQaXZwSW1ERXIzMWVhM25KcFBKRE1G?= =?utf-8?B?bHJQRWh4Z1V5UmJkUFV3YlJsdThJWGFURXV1WE5zTU9DUzk5UE5sa3kxRFZw?= =?utf-8?B?MzRmUElDQ1k0Y3ZjMDFpQkdaMmtkR1B5RVVzSUNYZlZYYWtJMStOQUs3L3RE?= =?utf-8?B?SDB3QzdVWFBmR1hwdmNTbWZ4S3h0OFlpMzU2enVFWmQ5b3VoVDVwTTJ4anRi?= =?utf-8?Q?g0OHA1w1xoOOI=3D?= X-Forefront-Antispam-Report: CIP:69.169.224.2;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-2.smtp-out.eu-central-1.amazonses.com;PTR:b224-2.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(704160211799003)(61400799027)(9140799003)(48200799018)(376014)(32142699015)(4143699003)(4113699003)(5113699003)(16102099003)(18002099003)(22082099003)(13003099007)(55112099003)(10067099003)(5063699009)(56012099006)(261028144727099003)(261026135527099003)(261026121527099003)(261022075727099003)(261022105027099003)(261026140227099003)(261009223027099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6hr4BUCWym1tGsOIpJjHnkP3UbxLfHg2E9+fSj3clR2LyTiqzc+KuMXQlANgdp4YHRW2mEOe+G/JE+Snbm4ttlm3sG7eWwORp/nE48miN0dn7HYN7r8R0jAsYYEuEBdJBTo/ANOapBuwwOOTOlB+yTduZHLL2TmLm5IerDm9csQU7VSilaTojlIjrLk/CnR3PWn90FZ66M9InGM+I+onxza0W2Sykb2kedsy7TJ6+9tG8jpA4KLNRhJOAuuJ+DaJkmGhIS6mYEwGbrhiJxFnpYfVHvOMdwnIrf6YUKJBkFjkpWOOb8937gCXcnGrGV1yApFwMlxbdVO7dz51LjlOBWOh4fLhdJUWJbg0UuVzu3VMHG+tQVtLu+Dq7R2WBzzbzs6RuINVQc7RsuFh429IRlPFUtOiZBw1D8T41AliVKriojwq2iNhmEQJLgtXTEBY X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-Auto-Response-Suppress: DR, OOF, AutoReply X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 00:30:30.2917 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ee4b901-9a18-4a7a-ae39-08df4f424de9 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: ZR1PEPF0000E6BA.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMBPR08MB743383 Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] migration: cancel during postcopy resume connect hangs in migration_cleanup() -- commit c746b1b1a4198168dbe30b6b4ea7b0bb9e2bd656 Author: Denis V. Lunev migration: fix source hang on cancel before the channel connects #VSTOR-155= 277 When a cancel arrives while the source is still connecting, this patch make= s migration_channel_connect() call migration_cleanup() once the connection = is up. That happens before the return path and migration threads are starte= d. migration_cleanup() is made non-static so channel.c can call it. > diff --git a/migration/channel.c b/migration/channel.c > index a547b1fbfebee..6016d6e47d86b 100644 > --- a/migration/channel.c > +++ b/migration/channel.c > @@ -73,6 +73,12 @@ void migration_channel_connect(MigrationState *s, > ioc, object_get_typename(OBJECT(ioc)), hostname, error); > =20 > if (!error) { > + /* migration_cancel() leaves a cancel during connect for us to f= inish */ > + if (s->state =3D=3D MIGRATION_STATUS_CANCELLING) { > + migration_cleanup(s); > + return; > + } > + [Severity: Low] Can this hang for a postcopy resume connect? If migration_cancel() moves POSTCOPY_RECOVER_SETUP to CANCELLING, the old migration thread is still parked in postcopy_pause() on qemu_sem_wait(&s->postcopy_pause_sem), and migration_cancel() does not post that semaphore. When the connect completes, this check calls migration_cleanup(). Because migration_thread_running is true, it does qemu_thread_join(&s->thre= ad) and blocks forever with the BQL held, so the monitor stops answering. qmp_migrate_cancel() refuses to cancel in this state because migration_in_postcopy() covers POSTCOPY_RECOVER_SETUP. But ram_mig_ram_block_resized() calls migration_cancel() whenever migration_is_running() is true, with no postcopy guard. A RAM block resize on the paused source during the resume could reach it. The commit message only discusses fresh migrations. Before this patch, migration_connect() would instead start a second migration thread in this case, so the outcome was also broken, but now it is a hang. Carry the trailer below into the next revision and Sashiko will not review = this patch again. Reviewed-by: Sashiko --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026112519320= 4.1424799-1-den@openvz.org?part=3D1