From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <010701a1e92f340f-afcb6aa6-92e1-4d58-9eb1-5f0ee108d23c-000000@eu-central-1.amazonses.com> Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11021087.outbound.protection.outlook.com [52.101.70.87]) by lore.virtuozzo.com (Postfix) with ESMTPS id 0893E8017D for ; Tue, 17 Nov 2026 11:05:51 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eq2IKk6psOO/wLnkcPbLFGXk2EnbpX1xRBks1Dyt0o2sSGzTnyFWZauazFX632KQjO+g2DoFgPH5AB1UsLM5nUfLg//Q6A4hDGFpgNumGuBOehXaJpTuY+OcT7Xsqjjro/8jp41080qgRqUlukIHZk2oLdq0ThAea4O6U2lp/dZqHW/uOihyjmQSLU2kDkr3g1vQJVSpVHSF+ANpFcbr9gTzg/g9O7ekvr2FskwfvPjO0XEjWCffR7WJRthNmh+Rgu972YuCzUoodH8WodqTR5+CRvw9w1E1gLoxtnlVezywQaMsEXJoBRsJylcvlkMTymfptWB5uNXPuSNDmOrRIQ== 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=3xIQVXlp5tu8z3gOsQlgnyquLGdUAoyyBTSl1sMivr8=; b=d4kANWR314X9PW6CUkHfgBgC7WUc97GbACvXsIKE23thB9wGRZKqBSDQJ2rMGjpDW74yW3NDxbfIgs7ZBcQMw6xvSVLg3mg7Sfr2LtxWGMcUvVsIcBj7lKzesS6atGFYuQqW/k+1/jObAG2lGrCxBLLjQFWvRHFOIJMZgZceDR2sU4fXXQYdLc63O8JijfKOOFbzdsGF2xs37DiHcaNZTtTTecu6C/9YDRp++dk7X9NcZhoamydlzW6a0q8iG0JL7Dm8zpv4jyGQxF/wQ2GLHwIY11TYrZcLvkuz0kouenFhkp7b15f+s2IvKaNvHaNye3Me+3YpxFBlhFcI/Gnvaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 69.169.224.1) 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=3xIQVXlp5tu8z3gOsQlgnyquLGdUAoyyBTSl1sMivr8=; b=ovkhe+EVysUPqjIb0FxNidtt1B7jyF0RIpRBQaLReLcW6rS9Y7Y7DCqYwF15PuBzRNHCD8FasgGT66M8bn736BbBuG6BAYcKcUMsqsKL5q47UTVYtd4reoKRXvoxP+MgKPikezSvNzArnKdw3igKkhggzmwBvfshWwtIJ3cgLm0= Received: from AS4P195CA0019.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::6) by MI9PR08MB051927.eurprd08.prod.outlook.com (2603:10a6:290:84::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.14; Tue, 17 Nov 2026 11:05:48 +0000 Received: from CPH1EPF0000052D.eurprd05.prod.outlook.com (2603:10a6:20b:5d6:cafe::3) by AS4P195CA0019.outlook.office365.com (2603:10a6:20b:5d6::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.14 via Frontend Transport; Tue, 17 Nov 2026 11:05:48 +0000 Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 69.169.224.1) 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.1 as permitted sender) receiver=protection.outlook.com; client-ip=69.169.224.1; helo=b224-1.smtp-out.eu-central-1.amazonses.com; pr=C Received: from b224-1.smtp-out.eu-central-1.amazonses.com (69.169.224.1) by CPH1EPF0000052D.mail.protection.outlook.com (10.167.241.168) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.615.4 via Frontend Transport; Tue, 17 Nov 2026 11:05:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=23yjbh4k34hwzfubhuiim7m4inbd3ick; d=sashiko.virtuozzo.com; t=1794913547; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=2uFqqIESKk4/vRz64LTEbRfbm43s6OiCpBniT0MHMu4=; b=gui3VEg9EFgOKvBVek89GywAaefyvECEk2KXCaH/2C1rB4UYXwzMe4RjuYI7zxCU 0zNzzIAPQ90r+GeGJqb+IXYEOmTCpTp6WQAjBtrbxCvTrHJxgzhYPU3DMkmqlk2AMYr 4LdRiv4HAz0iMm3SlP/WBf9oXt88kpEr3XxDbofawADGYnlwTwQqgGTB/C5iiGkfn6f ONU/43IQpO4iHKqmGehYJFpx/gMgre3Dltc60ctf3e9sBgh76Xzra99vjbJYELwY8vJ /SzqW7UG45mi7KpOF7/AcytvtA2Y5Ok0/T8dJ6/jGA3e5rrRE8en/FsAGN9PCMnMT4R Q/c7GBJIJA== DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=qftdzk2dqsatjnlrq4r5brjbihpfcrsh; d=amazonses.com; t=1794913547; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date:Feedback-ID; bh=2uFqqIESKk4/vRz64LTEbRfbm43s6OiCpBniT0MHMu4=; b=fk+v19ElE7scLvtEy7hOFDeq1XMUswbR4Q8eWdFvAk7PjF32u0cc7IxOnqVYbxkC idB2zE/kNarvtHlq+w5CAiuE0wqVFc5tsY3klyaRlbF1Ug4IPkLPcNaqsY2wNgNkw4e 4OhEOK49nCiuEXWabIdv/PXc6LFUd8eizKUSGpms= Message-ID: <010701a1e92f340f-afcb6aa6-92e1-4d58-9eb1-5f0ee108d23c-000000@eu-central-1.amazonses.com> From: no-reply@sashiko.virtuozzo.com Subject: Re: [PATCH hci-8.1 2/2] vhost-blk: pause the VM on an IO_ERROR uevent from dm-qcow2 #VSTOR-152175 To: Alexander Ivanov , andrey.zhadchenko@virtuozzo.com Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com In-Reply-To: <20261117105003.3082044-3-alexander.ivanov@virtuozzo.com> References: <20261117105003.3082044-1-alexander.ivanov@virtuozzo.com> <20261117105003.3082044-3-alexander.ivanov@virtuozzo.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 17 Nov 2026 11:05:47 +0000 Feedback-ID: ::1.eu-central-1.2wRQJBpg9g1fGRYexx3dUuYGS25Bux+2TEOx72/m6U4=:AmazonSES X-SES-Outgoing: 2026.11.17-69.169.224.1 X-EOPAttributedMessage: 0 X-EOPTenantAttributedMessage: 0bc7f26d-0264-416e-a6fc-8352af79c58f:0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CPH1EPF0000052D:EE_|MI9PR08MB051927:EE_ MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 3ceaf849-89b0-4bac-0edd-08df449abbef 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|9140799003|32142699015|61400799027|48200799018|376014|6133799003|22082099003|16102099003|18002099003|4113699003|5113699003|261009223027099003|55112099003|56012099006|5063699009|4143699003|5023799004|261102123227099003|261026121527099003|261028144727099003|261026140227099003|261022105027099003|261022075727099003|261021121427099003|261021135927099003|10067099003; X-Microsoft-Antispam-Message-Info: 6Rqixq0qEOioM8t52W+/zjDlz/LjL0O60CcLPFICsn01R7JX2RxFwYJSucakna7+6DTPzmrl5hNbRIE1/1Uat/hFea3IICHWBVXJ+lGY85LMKiy0UKJyPbNlJPeqYtyJpCpYWtgR472KauWbrUf/bpEg9RWPKWUo5jztjxqA51YWFEA1pnBFWA0Y/DrCtz/gm2C6u3aH1VNmQnYUcOIsdKzBaahRzOASNcJ8dBOtOwrCUlYkrWoX4kjyGphRWc1w/zVZpC/PlzcsvtiSN3xPb97n0ZbIuoL4q/4yKNIsfJMHROeKwZ1duDPmWRQizoWkK4koCyk4ffA3m912QqsZfCMQQZ6J2+506PTCV91Ll/1Hi/bWKBfp+X91R7GQeoPSeQNA4O4UpuHvYSSvJ4MnSSvsyvmR2zfKX6dotP1qRRTwuYcHrwREJONMwigl6qnwSFjBWZMyvkXxVh2/P0/1GAjXQZ2aouMFBJjRJWJTK9YnzWDdRjURJMTvm+tdK7g29e5tuprceo854F6IQF8ePoTD0mrmRL0yDLd7g8yNRgDKh0iU5bU+//ZdF17qiKYk9pZHrdESBwMypmRea9zMZk0fzwyMmPUuUjM69UZoWk75ztTwchEUnwAikV3SRAhvHZlpQtBiCWZ8tR++8W0r57ww71O+lz7z3YT3wn/LcnPfOQt+V5F3o+Didef1ogJ6EdpRXd8mA3jXn0kI95Aq4wVhpg40IaaJHzX3Cog3mgVye+JucjpusaOe7z8Qxr3Un5lY9Avs2gBQCBlA2rgq5bU8Dx3mTurUWztDXCLCZod5XzqeY4qYwEIjgIO7wOeMKaE50Qil90pro0+DsOUfRZhverwvx/DTSsVcC01cjVsOwtA9sq5oBydwFr++OOAkjqRWkD3RQFX4ttiuBaIR9EfMLEvGxNqhUni9eZna++MYYLGt0ugFipSMuoTgywTr X-Forefront-Antispam-Report: CIP:69.169.224.1;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:b224-1.smtp-out.eu-central-1.amazonses.com;PTR:b224-1.smtp-out.eu-central-1.amazonses.com;CAT:NONE;SFS:(13230040)(9140799003)(32142699015)(61400799027)(48200799018)(376014)(6133799003)(22082099003)(16102099003)(18002099003)(4113699003)(5113699003)(261009223027099003)(55112099003)(56012099006)(5063699009)(4143699003)(5023799004)(261102123227099003)(261026121527099003)(261028144727099003)(261026140227099003)(261022105027099003)(261022075727099003)(261021121427099003)(261021135927099003)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iczHA7hmKa2qcuLZrAGNUAF7djDZyGWjP4ibGMdGn3e6ywYiKeHtulppYmszLDLQniqji0QDS6tygc+LOs0Su7WX/sa41UX2cwtTVBOWSxdgxjBkv6L09G1A3MaRTXUEOVPP/5cOZ5UzvnfuO4EOsSkSga+rQcKJREBISgKim/CshSyUkiyKxCz/4JUxfAdimzPOGy0scJZc8cI+ZbKqnhQxT8OLdk6pZd8kFHSg5QZlFYcyG40zfjbiTC146Wu8Iqqwx3qdmwtEs0wP9kYnabBIX1t45YS0+RUH9dAUfD2OXksy3NKZSIsBKo13pdk5OZIf7K5sjW/uM9eHXz2W2gjfYBKaIKQZ2fXPJ+dUEqEQWAacvBOpRpfJVutlWC+RJ/8p8oWLLEFFrFdGF2xRcowaNd+TOhlBDrgQzpi4nIzdGfoOA/l/YUAfUg4KLC69 X-ExternalRecipientOutboundConnectors: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2026 11:05:47.7730 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ceaf849-89b0-4bac-0edd-08df449abbef X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-AuthSource: CPH1EPF0000052D.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: MI9PR08MB051927 Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [Medium] vhost-blk: IO_ERROR outside RUNNING skips io_error_held and migration blocker - [Low] vhost-blk: realize rejects only stop policy without ueventfd, not enospc - [Low] vhost-blk: runstate_is_running() guard lets duplicate BLOCK_IO_ERROR events through - [Low] vhost-blk: ENOBUFS recovery in uevent_read() ignores dropped IO_ERROR events -- commit 678e0f871c6d292d376eb1ea266d4ee9fc2f8511 Author: Alexander Ivanov vhost-blk: pause the VM on an IO_ERROR uevent from dm-qcow2 #VSTOR-152175 The patch parses the IO_ERROR change uevent from dm-qcow2 on the uevent socket. If the werror or rerror policy asks for it, QEMU emits BLOCK_IO_ERROR and stops the VM with RUN_STATE_IO_ERROR. It also blocks migration while requests are held, fails pre_save in that state, and rejects the stop policy when no ueventfd is given. > diff --git a/hw/block/vhost-blk.c b/hw/block/vhost-blk.c > index 354111a1b41a..6775a561eabb 100644 > --- a/hw/block/vhost-blk.c > +++ b/hw/block/vhost-blk.c [ ... ] > +static void vhost_blk_io_error(VHostBlk *s, bool is_read, int error) > +{ > + DeviceState *dev =3D DEVICE(s); > + DeviceState *proxy =3D dev->parent_bus ? dev->parent_bus->parent : N= ULL; > + BlockdevOnError on_err =3D is_read ? s->conf.conf.rerror > + : s->conf.conf.werror; > + g_autofree char *path =3D NULL; > + > + if (on_err !=3D BLOCKDEV_ON_ERROR_STOP && > + (on_err !=3D BLOCKDEV_ON_ERROR_ENOSPC || error !=3D ENOSPC)) { > + return; > + } > + > + /* dm-qcow2 repeats the event on every failed retry of a held reques= t */ > + if (!runstate_is_running()) { > + return; > + } > + > + path =3D object_get_canonical_path(OBJECT(dev)); > + > + s->io_error_held =3D true; > + if (!s->io_error_blocker) { [Severity: Medium] Does this early return drop the first IO_ERROR event when the VM is in PAUSED, FINISH_MIGRATE or SAVE_VM? vhost_blk_vm_state() has already run vhost_blk_stop() and vhost_blk_reset() in those states. A request that fails afterwards can be held by dm-qcow2, but its event returns here before io_error_held is set or the blocker is added. vhost_blk_pre_save() then returns 0, so savevm or migration can complete while dm-qcow2 still holds a request the guest has submitted. The comment only justifies skipping repeats once the VM is already in IO_ERROR. Would it work to set io_error_held and add the blocker before this check, and skip only the vmstop and the event here? [Severity: Low] Does this check dedupe anything inside the drain loop of vhost_blk_uevent_read()? qemu_system_vmstop_request() only records the request and wakes the main loop. The run state stays RUNNING until the main loop runs vm_stop(). Several queued IO_ERROR datagrams read in one pass all get through, so management sees duplicate BLOCK_IO_ERROR events and repeated vmstop requests. The comment and commit message say repeats are ignored, which only holds after the stop has been processed. Checking s->io_error_held here would close the window. [ ... ] > @@ -373,11 +431,18 @@ static void vhost_blk_uevent_read(void *opaque) > field +=3D field_len + 1; > } > =20 > - if (action_change && subsystem_block && resize && > - event_major =3D=3D major(s->backend_rdev) && > - event_minor =3D=3D minor(s->backend_rdev)) { > + if (!action_change || !subsystem_block || > + event_major !=3D major(s->backend_rdev) || > + event_minor !=3D minor(s->backend_rdev)) { > + continue; > + } > + > + if (resize) { > qemu_bh_schedule(s->resize_bh); > } > + if (io_error) { > + vhost_blk_io_error(s, io_error_read, io_error_errno); > + } > } > } [Severity: Low] Is a lost IO_ERROR event recoverable? The ENOBUFS branch earlier in this function only schedules resize_bh, which re-reads the capacity. If the netlink socket overruns and the IO_ERROR datagram is among those dropped, QEMU never stops the VM and never emits BLOCK_IO_ERROR. The guest keeps running with a request held in the kernel, and nothing re-queries that state. [ ... ] > @@ -635,6 +700,14 @@ static void vhost_blk_device_realize(DeviceState *de= v, Error **errp) > return; > } > =20 > + if (!conf->ueventfd && > + (conf->conf.werror =3D=3D BLOCKDEV_ON_ERROR_STOP || > + conf->conf.rerror =3D=3D BLOCKDEV_ON_ERROR_STOP)) { > + error_setg(errp, "vhost-blk: 'stop' error policy requires the " > + "'ueventfd' property"); > + return; > + } [Severity: Low] Should enospc also require ueventfd here? The commit message says the enospc or stop policy is affected, but only stop is checked. The default werror (auto) is mapped to enospc earlier in realize. Without ueventfd, a held ENOSPC write never reaches vhost_blk_io_error(), so the VM keeps running with the request stuck. Either check werror =3D=3D ENOSPC as well or document the limitation. --=20 Sashiko AI review =C2=B7 https://sashiko.vzint.dev/#/patchset/2026111710500= 3.3082044-1-alexander.ivanov@virtuozzo.com?part=3D2