From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a121401f20-56768e6c-f677-434d-a5e8-3e128af009e3-000000@eu-central-1.amazonses.com> Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11021116.outbound.protection.outlook.com [52.101.70.116]) by lore.virtuozzo.com (Postfix) with ESMTPS id 7DB0F808A3 for ; Fri, 9 Oct 2026 15:20:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cYncaTVM4fm5CYLFpqAshPNJ7EGdrS16Y6QkbZP1YGv+RzVMA2iD7KpXYm5C068ONURzXvtdetBBKozfKSiXnWfqwrGXMsMhDoB4xeBx1PA9iOVBppTGOa2e/Vies1J/yE8kWbSAFz18zKABervfrgp2F1mrmyDplCaJCpbpaDasNuo+2Ks4hXLqCFPUX7/ath3Y7UcZpYxOO8SiPeJwvofbxAb6hMfR6M3Y5gaiT9NtFYXX9W/rmj6ooauhhoNH2gqC+BoWKOvVM689kM4FZ7TfAZ0l7cPeKeTnbzzVONKl0wKM41pq9/HgZBvDXksoEMkCXLT893++eZYB4sAegg== 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=oCCzQ5ltqUBplfTPzKHdtfzCNjno8HFzDfYcvV4idsI=; b=gKJccbgPwHhE0fCxFIhrY9axUHAVjb+ibvT3oy+ouZuO5XJP6j1Iiq/6Q3f5mWoaynkCrKjzX+TCm+/ca8QScmk0KI0RiKjyregAgDJXlvi73sIef1klojwtYsLxNbqRpYAtPcXPsx5KFUWVDN2b74bUEm/HLpvR5eptSoyU0eLhnhdH6gHXTafZXUBBNJ789PkbxNQd3+VK2yinjJ+mYkWAkp6JWCD8JhIUM7fxTyhcHi2fCUbiDEDsIP6/6d8le+RhniMxBBoqFb5BRGGOMngQqzAjXKhhSMawg5ALuVrlPFmIFg7UQZZIY07nSSamPjCj0HCdfmz49uaaSIaXfw== 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=oCCzQ5ltqUBplfTPzKHdtfzCNjno8HFzDfYcvV4idsI=; b=gCs5uPBVQ9m9ROzFpLbv6yE7W8U4d0DTYV8RHcTnUW1osMwmwA1AdR7VOo2GkyWdGmAjcs9VXdoduih6LMRndQHNTcY8T0zxpYtHnyFSaIxs+5UQcZ8vBMvUa4jzOYIhLENsLLETdVa5U9WWFhSxZLRuzy9gPK87yo20L9BvkS0= Received: from DU7PR01CA0010.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::23) by BESPR08MB328646.eurprd08.prod.outlook.com (2603:10a6:b10:145::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.522.5; Fri, 9 Oct 2026 15:20:14 +0000 Received: from MAD0EPF000008AC.eurprd04.prod.outlook.com (2603:10a6:10:50f:cafe::80) by DU7PR01CA0010.outlook.office365.com (2603:10a6:10:50f::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.472.21 via Frontend Transport; Fri, 9 Oct 2026 15:20:13 +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 MAD0EPF000008AC.mail.protection.outlook.com (10.167.241.185) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.522.6 via Frontend Transport; Fri, 9 Oct 2026 15:20:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1791559212; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=HTUIyeSZQbXyOIeBypnckpQU5VQj/HNOnpJp+VU9iIM=; b=tuq2Ct8VJk1gI4lsWHrqFv4Nqsn2lWlA4QFzC/jKMFBN4MeGY2p5xUno1VCG0kW+ FddXqbILA+/3VXACppHxUNq3C0BO3HXZp83jTxmQzpHzNtgAJyvll/wpnv8QvB1OUjB Qtth36C7HTtvRBkWLu5ETAGY1HtKTpXlKOz+ACoCEEXuNhn3qllddw4srNVjJPCZ5wC 6GtfZf1xebr8SpzTvx+CSioSRmKEK3UCrRJd8+5L9hm2+gQenFEwHhiJH+cRFcEtVVY ceKIY4xHAP+kU3XXuCiw3d+rH30PT/4GC/OKexsdxxiXEmmpQ0RJsmRVkkjd7rUymaz jNSVzFTeRA== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1791559212; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=HTUIyeSZQbXyOIeBypnckpQU5VQj/HNOnpJp+VU9iIM=; b=faTtUiLGvRl+BkEG2BnAfEJlXy6LfqSJEgjCNYmxza252uMbVwcmVybWCcNIhT3M 1mH8UPv3XOc4cF7+EbXqUWo9DANAjIdo6LBgYf+Dq8cmjhZT+NSmCP4fQA7kEv22jMv FlIZeK5BZo95fxzMLgucAaATHxQMXXdSST29qHs0= Message-ID: <010701a121401f20-56768e6c-f677-434d-a5e8-3e128af009e3-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH QEMU HCI-8.1 13/21] migration: Fix crash on second migration when cancel early To: svt-core@virtuozzo.com, Andrey Drobyshev In-Reply-To: <20261009-vfio_v1-v1-13-2ae91d5b8048@virtuozzo.com> References: <20261009-vfio_v1-v1-0-2ae91d5b8048@virtuozzo.com> <20261009-vfio_v1-v1-13-2ae91d5b8048@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 9 Oct 2026 15:20:12 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.09-69.169.224.6 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MAD0EPF000008AC:EE_|BESPR08MB328646:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 2958d255-3388-4765-c66c-08df2618d0d4 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|48200799018|9140799003|61400799027|32142699015|376014|13003099007|4143699003|4113699003|10067099003|56012099006|5063699009|18002099003|5113699003|16102099003|55112099003|22082099003; X-Microsoft-Antispam-Message-Info: ecDdNQ3gLZQJ5dsbuZDdW+cTZCbYDtqd6AebqAp0pGk9IDeYmgnJ/Y6u4AeNQ9g6ijOMpXMLsN2WuzS2m6psJgNeso3BHfFNJHMDytnEN5oLUmqV6llExJNKxI3FPngoTqAJGk3mYoHFgQWWYxhHFDg/Jb7b/wzcD6kHQ0mQJsnaBWPPtVSGnV327wXlpmXGfbW1obhvj+mAVS13npPUXp5U3YwR9PvPJ9OjbWoNzTOsRYNEZiro6dZXIcgZpjEhVMioOyFPpXVZpRtwxf9QPukoQQff3EIX59pMpYDI+Y3bhzFHc+N+LdoXCHNIfqbV7OdnM4Rp40XICWu9FOJXtziS3m/RD1mZ3fcGXLM9fPw93TnGbAr2NEMzSKfdeIoMsJYbBLLTqhknbq/3G1yj7mJgDq/k7DBIyr3Oth3J8xppcR8Nmc1CRFsiJp+zf0f3b+patjXt4VFogzL6Q6iW/qb7UciLn6IwWazkSjtn6po1eEraMlB6HUTlYqn4DJ5nd9w+QCAQA1+hf38Q6aabsIZyIL+CD4KdB+nQjYAQgVL2Me4vyAd/ArRy582oxPwuFxiGgirTQ4o7FV1/z/CXnfDKDD3dEadMCbR37tc0JbgFUNsLWyS5l6eNQqrndVMxSrSuB90sxO4OHSkMM/Z45iEyqQJOO08j8L2hJM3gMWICWv8e5XogH02cyWVMv3LeaJOqzn8MEQd6jxa0IJqSb36QW9VXJlB5saQvC8Uo15hX3hC2TE42XuaAzgtmyVuvVxVyQvbYJpzceWTt3RzLHtybcvwS5mxTgB24QczkpT8yDLo/ZIqYIj4LaLOVd7ycz/Tty1iaR4JXHZNgwksBsOi85KsrAy+5jESvlx4OYqOhltzHYkm/+OThbmAFK02f 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)(48200799018)(9140799003)(61400799027)(32142699015)(376014)(13003099007)(4143699003)(4113699003)(10067099003)(56012099006)(5063699009)(18002099003)(5113699003)(16102099003)(55112099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vh2VHuhZll+3cmq7noK0uK93lH70IOzNt45Hv+I+5kVNoQGSOxzPgRBshLxSAIeztFIEqY2VBxziQ5880V26ri41azpItBQMI9W7wXCMfAiLh36zsE1a3H3d0Oy2gQSAO159KJNjnndRt+B07FmRcSMYcK3zdhhki7mwff/k/Oc7RIMQoTEObhDPGmhmOcEujCsT8G/I44QIBez5pAR8R4nHpw1B8wsUCyzry362l0lpCu1okGSxSi4W3gwq1m3nWYQbZ8nRhrV6+IPDeRwaZCO5UqsF9yR+sckx4Wq0RkS4mvzumW79AJ0cJmuF9KzvXIuGpZeaZ6lVQTFR32yP0w564bLzof4ZQENlZGlj46+0bbNeeARqcPLz1OHfzJZOnSB1vztF3AFnVGLU7kXvfrwsdyE4VDo6xE7qOyMJ6gB9ItVDRMSf+YW5uexEhQ9y X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2026 15:20:13.3659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2958d255-3388-4765-c66c-08df2618d0d4 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: MAD0EPF000008AC.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: BESPR08MB328646 Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] migration: stale comment in qmp_migrate_finish_cb() describes a rem= oved call -- Commit ea2a5dd391e35be2ede79c38ea1ba67a80a4cdb1 Author: Peter Xu migration: Fix crash on second migration when cancel early This commit changes migration_cancel() so that it calls migration_cleanup() only when the cpr-transfer HUP gsource is still pending. It also makes qmp_migrate_finish_cb() destroy the HUP source on entry, and it adds assertions around the hup_source handling. Link: https://lore.kernel.org/r/20260417184742.293061-1-marcandre.lureau@re= dhat.com Link: https://lore.kernel.org/r/20260421175820.302795-1-peterx@redhat.com > diff --git a/migration/migration.c b/migration/migration.c > index 81d5d4dd4c06..ab1f1641c217 100644 > --- a/migration/migration.c > +++ b/migration/migration.c [ ... ] > @@ -2246,11 +2251,22 @@ static gboolean qmp_migrate_finish_cb(QIOChannel = *channel, > void *opaque) > { > MigrationAddress *addr =3D opaque; > + MigrationState *s =3D migrate_get_current(); > + > + /* > + * Detach and release the GSource right after use. We rely on this = to > + * detect this small cpr-transfer window of "waiting for HUP event". > + */ > + cpr_transfer_source_destroy(s); > =20 > qmp_migrate_finish(addr, NULL); > =20 > cpr_state_close(); > - cpr_transfer_source_destroy(migrate_get_current()); > + > + /* > + * This is redundant as we do cpr_transfer_source_destroy() at the > + * entry, but it's benign; glib will just skip the detach. > + */ > return G_SOURCE_REMOVE; > } [Severity: Low] This isn't a bug, but the comment placed just before return G_SOURCE_REMOVE in qmp_migrate_finish_cb() describes code that isn't there. It says that a redundant cpr_transfer_source_destroy() is done at entry and that glib will skip the detach. In this backport, the trailing cpr_transfer_source_destroy(migrate_get_curr= ent()) was removed. The only destroy call is now the one at function entry, and no second call follows the comment. Could the comment be dropped or reworded? It could say that the source was already destroyed at entry, so returning G_SOURCE_REMOVE is harmless. As it stands it may mislead readers. Runtime behaviour is correct. --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/20261009-vfio= _v1-v1-0-2ae91d5b8048@virtuozzo.com?part=3D13