From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a15a44bcb9-3abcbb8b-64d8-4568-a5a5-b5b8b80ab597-000000@eu-central-1.amazonses.com> Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazon11023121.outbound.protection.outlook.com [40.107.162.121]) by lore.virtuozzo.com (Postfix) with ESMTPS id E9EAF802A5 for ; Tue, 20 Oct 2026 17:03:41 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BBHByobxROBBZjnJ1XSQYjpbp/sIuZme7qmUO1Hh21XmZADszh6x9cjJXarKNb4bie9HkzdgnCkhpHxveq55Au9k4sjlWGnLqmP8Dc6toC2xQ+Q6XfhlAyPA30plUi6VYGAC6koMUMjOIRGV4YVeU2UbD2DYMgY9s1meMAT6mhxw00vIDNRJZ53ctkAlWBbOS6uymoKT38BEK/1plMpVHDSdEu2ifqVe1On3CU4NQ+ixClJY/1YB5grNtuyxqhB6GwlsBn1YEGd6POleH2FqGsLthslCQ3MHdq1QhHOTE3k2Xiw5FviZHMviN814e652vRUXJBHBOZVV1Dv5qyPksQ== 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=R3m58n/ebG39+4bLcJtedalm//yTBUEokoEYST5rqSY=; b=YLC1+7AZnkPa++P3PMxcljEyYdHnFsmngG1i4BVxaDPEhf8DrUY3TiJBsZYPMI1GWDnd8EUgEYW/428CFisW4UbS8WFhSmtUIg4wwjRCbNxIIW/2xjbbCNaZ1SMW9Qe2zOjCGqjhQoVGvMXmF1zMXcxagFg2Kh1Iy4AAUeEvUVmfwW5Bhjbz9MdSBL83kbGKAipnFI5HXy2nzQ28HSWpn2tgIme4wq3ExPUe5qeaeXofVpHyOx6c5v2dp7AnsO7FTsZB2++GGTniXQvdsV/11xhv9ar/b/Me/06W9BJ8FWt1ZPa+1SnCzM0uVKQsB/Q4Ov59hzYhu8+DWjn3xALMcA== 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=R3m58n/ebG39+4bLcJtedalm//yTBUEokoEYST5rqSY=; b=UFD/LshiaelFfns6LASxR/434Ytm5VFzxksaUvH5hrQ4HWIuMJf+2Rz/+wTBWKWqvaS7hDswFfwgoGfoEMmQ9uZWY255IRNpxW1DTHkoWb+KOdkw1NZ4ESRdhgXUxCWu1LbuwEP0rIhxLzoQGQM+Wj/3KzfRq+ybgFk5n6nu0b4= Received: from AS9PR0301CA0055.eurprd03.prod.outlook.com (2603:10a6:20b:469::25) by PAXPR08MB6335.eurprd08.prod.outlook.com (2603:10a6:102:12c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.546.14; Tue, 20 Oct 2026 17:03:37 +0000 Received: from AM1PEPF000C1ADB.eurprd02.prod.outlook.com (2603:10a6:20b:469:cafe::14) by AS9PR0301CA0055.outlook.office365.com (2603:10a6:20b:469::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.522.19 via Frontend Transport; Tue, 20 Oct 2026 17:03:37 +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 AM1PEPF000C1ADB.mail.protection.outlook.com (10.167.242.106) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.546.15 via Frontend Transport; Tue, 20 Oct 2026 17:03:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1792515816; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=E7dE6oP34sl5GKd5YgH1RNz2Jv2f7+KOsd9z3GbIsvw=; b=QZ/nuAQ6Iidc+shLnEq45IuUvBsttiGjfVayREOxUPy4ypovxESNaT98M2XQ5sLi dZEMOg5dXtkuW00e0uMwbUAfGJsMKOPmdNws24m8x0yvKKvdRVnb3WdhoUBmQVYtqVC +BGvok29Beo5dr1LGMEWygijccDQ3jQsa/jFsPka06YNwdjRN9bPEckb9b+6tl690/i R5MXaOPqStqlgQ8+ZBsefaCxXCw/f/scMZEXrRVoZjleJVX9dTpyqDnwTmVW+gdx/hu pXgzt2lrNDTNWJSK7OtlWDSN8LcvhfpDCj8chSVfqQidNppau1fIX+cGUTikm5DT2+n vy0Thk3QyQ== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1792515816; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=E7dE6oP34sl5GKd5YgH1RNz2Jv2f7+KOsd9z3GbIsvw=; b=oCeMsbygePGe67953MQZmdYOpMR3FecCVQ1hPG+ISKNb4cHGKFZl+Q0lqYqS1tZo h/1dPIcft1U7LnL59S3SMr9HUraeAh8XI2Gmexphy4qTh0SAAfO5qsKd6UIm3D08dIc R1F2Ent3m7ISwTdO0f8+PPmaK4RDkTEBsg00k0CQ= Message-ID: <010701a15a44bcb9-3abcbb8b-64d8-4568-a5a5-b5b8b80ab597-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH QEMU HCI-8.1 v4 27/31] VZ: migration/cpr-exec: take the vhost-net devices back if exec fails To: svt-core@virtuozzo.com, Andrey Drobyshev In-Reply-To: <20261020-vfio_v1-v4-27-83a5668230e5@virtuozzo.com> References: <20261020-vfio_v1-v4-0-83a5668230e5@virtuozzo.com> <20261020-vfio_v1-v4-27-83a5668230e5@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 20 Oct 2026 17:03:36 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.10.20-69.169.224.2 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM1PEPF000C1ADB:EE_|PAXPR08MB6335:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 331092f7-931e-4093-9147-08df2ecc1511 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|704162011799003|9140799003|32142699015|376014|48200799018|61400799027|4113699003|5113699003|55112099003|18002099003|16102099003|22082099003|10067099003|13003099007|4143699003|5023799004|261009223027099003|56012099006|5063699009; X-Microsoft-Antispam-Message-Info: UTSVOJ6KZ/d7vPHGIIbHoJrtA09JJKhjBpUyUA1trb+bOu83shF8A2P8F45Rm8i8as5IuuRd/zBVb7/cJ0fICHTr2Gt4FYNz2PKKcnwNkOdPdectbBpxQwpACUnxglWEEf675KL4709q8F35JVuesPKzHJzelhAXaV7SIPNP7aWHH9/NabWMH7R/RGAcDweOXgHVPYx37tBl3AEhDvNeQb/ad7JeGJ9nzFE9Z69icYD16ErOQznZW0EcMnSeqbpC063Fwm6qZy1PKKIVNbQMAMsrwa13fGPLDNzdpH3mCpD8kqHNhpCyuhZNMXdUG6Zgje38TNsmv/pzVv9xYztc6/JFFhjC5LKTcZP4E5mPhY6bP+QhOj0EUp1Nud2ZJwvo1/cJuSQcSNzch0gr1aPIKtYzjPHAJcYW0wAxC6CzAI7OTxIBpV6kZwoSvikKfvasDSp6/4WZl0Ih3fevUrfmd8SXAaPyY0mRoHdyDd6i33r+WJkRSkh3JBWiIDrLq5myjHf8d4qhKlWdlQhA74QtLjU1d6xzqk9hMJ6541rksZ9JPzC0ZtlB6vuNBo2DaN7VxApfdqvKz2oI45BfbIOpun9pKpParNc8jXIZFtQRg+NeQf66g4glgsBV3MU1q2ba3CvklSXFu8j7jRrJzmik6pfhAb+1cvUAxicEvubqkPLc8sE+IaeqhPerUjNmHpv4JFfuYtfgCl9uWCJCFiZzeEa1MSJlkIcm+A2zwGr61CbRjUo1x6EicSsriuJiWaQDHlZ7KggLVopLiyK51GIhvA+RKsRsDfgxFqXLwoqUO5Nv6L9updi+UAPsBjKBBkMnRsugyntnB1gw9SauIDXT2Ay44I81nzGvuZeHCIFqVtjM9gg8N4f+oxQj9+6D3SSG 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)(704162011799003)(9140799003)(32142699015)(376014)(48200799018)(61400799027)(4113699003)(5113699003)(55112099003)(18002099003)(16102099003)(22082099003)(10067099003)(13003099007)(4143699003)(5023799004)(261009223027099003)(56012099006)(5063699009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VU+spugYGKzUCMxuZYuSTFWc/Z9IH2ftPTQ4z2JAMxQ9eAu3opPedLI0NsVesdx7QqN8tstXEow15sb33e1UVqXI7Ug+xEZAedenh00cZdHUQ/b/RVHCp/7uzGbXF1Jp0pyQ2S+3UeV1pSp/Kht0R/vyo3QDjAWrIQ3M4nInIvHMZ/IlYwpNR49JrYJh2FBSouGb8nPcTBkhdx5TU2LpkIJ/ShF+CFwQVRH3s7Gq31Maah8rGsDg1bNurBHLYjiSe4ovt1WJwV0tQh4iXHtJHtI8Dr6ICcYykenMj3qjKomHJmFFJXFNmqrZkmTylBr2fuclyrz/1RBNsSnzYvF64VBwXIW/Uur6btOg1MvSdt0q6GMRum+hUSm4aqXrfYC8IBuSWhMIBvfjfevi+dk0qfjDSEJk1QjKWGDbg/8008O1+nmmsQczwva+OTl7+FQt X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2026 17:03:37.0973 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 331092f7-931e-4093-9147-08df2ecc1511 X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: AM1PEPF000C1ADB.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6335 Thank you for your contribution! Sashiko AI review found 1 potential issue(= s) to consider: - [Low] vhost-net: cpr-exec failure path does not re-apply busyloop timeout= (poll-us) -- commit 3c0903d7d2ea3ce9e525bbd0a16e4a5b7320f49d Author: Andrey Drobyshev VZ: migration/cpr-exec: take the vhost-net devices back if exec fails This patch makes the cpr-exec failure path take the kernel vhost-net devices back with VHOST_SET_OWNER after they were released with VHOST_RESET_OWNER. It also re-applies the vring call and err fds, and marks released devices with a new cpr_owner_reset flag. > diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c > --- a/hw/net/vhost_net.c > +++ b/hw/net/vhost_net.c [ ... ] > +/* > + * Take the ownership back when the exec fails and the VM goes on in the > + * old QEMU. VHOST_RESET_OWNER has reset the kernel device, but the dev= ices > + * are stopped, and vhost_net_start() sets everything up again when the = VM > + * resumes. > + */ > +void vhost_net_cpr_set_owners(void) > +{ [ ... ] > + /* RESET_OWNER also dropped the vring fds set by vhost_dev_i= nit() */ > + for (i =3D 0; i < dev->nvqs; i++) { > + const VhostOps *ops =3D dev->vhost_ops; > + struct vhost_virtqueue *vq =3D &dev->vqs[i]; > + struct vhost_vring_file file =3D { > + .index =3D ops->vhost_get_vq_index(dev, dev->vq_inde= x + i), > + .fd =3D event_notifier_get_wfd(&vq->masked_notifier), > + }; > + > + r =3D ops->vhost_set_vring_call(dev, &file); > + if (r =3D=3D 0 && ops->vhost_set_vring_err) { > + file.fd =3D event_notifier_get_fd(&vq->error_notifie= r); > + r =3D ops->vhost_set_vring_err(dev, &file); > + } [Severity: Low] Is the busyloop timeout also lost here? vhost_dev_init() programs it only once at setup time: hw/virtio/vhost.c:vhost_dev_init() { ... if (busyloop_timeout) { for (i =3D 0; i < hdev->nvqs; ++i) { r =3D vhost_virtqueue_set_busyloop_timeout(hdev, hdev->vq_index= + i, busyloop_timeout); ... } The value comes from the user-configurable poll-us tap option: net/tap.c:net_init_tap_one() { ... if (tap->has_poll_us) { options.busyloop_timeout =3D tap->poll_us; } ... } The value is not stored in struct vhost_dev. As far as I can see, nothing i= n the vhost_dev_start()/vhost_net_start() path re-applies it. So with tap,vhost=3Don,poll-us=3DN, after cpr_exec_cb() calls vhost_net_cpr= _reset_owners() and execvp() fails, vhost_net_cpr_set_owners() restores onl= y the vring call and err fds. Could the poll-us setting then be silently dr= opped on the old QEMU's device? If so, the comment "vhost_net_start() sets everything up again when the VM = resumes" does not hold for this setting. I did not verify in the kernel whether VHOST_RESET_OWNER actually clears vq= ->busyloop_timeout, so this depends on that behavior. Could the timeout be = saved and replayed here, or the comment and commit message be adjusted? --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/20261020-vfio= _v1-v4-0-83a5668230e5@virtuozzo.com?part=3D27