From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (mail.openvz.org [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 9CB5480031 for ; Tue, 1 Dec 2026 08:52:05 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6B18oq3r021367; Tue, 1 Dec 2026 11:50:52 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6B18oq3r021367 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="XL2QEW/n" Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6B18oNUu021250 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 1 Dec 2026 11:50:24 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6B18oNUu021250 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-c5216aab52bso161989766b.1 for ; Tue, 01 Dec 2026 00:50:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErEfn9qOXA7PhRvXjFsQ9Q7XvXQX0l87KnGCN2wuNsdAdYpO/vcJd0oTqxP0zjQprqL7d61ADA==@openvz.org X-Gm-Message-State: APuU4Z8eCQZcPt7G2EgN1b3UIj+wQp/2O3scn6EVuVv/Rg6b78SIELRP gww3w34hGtIrkNcaaYGhVZ7S1uV+gVcpP7ofTSpG6u6Tg8LQlgZKvYef/GeKOIoDbmdhXV9t2cp 07vcCn/m1azxxy4/llIsLYWW4Gp89Lg36tJo5h9ewe2mh+I3AW2etLw== X-Gm-Gg: AZFdTZc9jIArq3mhArYNxkNgLhyPeVJBkiYe0ujcLxd39MYxpKYlOJG9JhlOypjT5nH TyCvNVo9HIA8ImsDJHrnp1OaAUZ0fp7Om0V0xbobYfUKCt6i/6PZHAmnAI3KA6OhGirsEIMN/KY 4xRcxcL9lyt9zgMY7Imz2A9Mu1Pe1TPF6skY009btKHPJCAXtl1JC1qzxLfdmPVBgPKoo2wM74k mz554BjFeTh4LH1InXaVWvhRFTdQ5GmZ1MDY1Gs0qg9y3RZWQQor+oZUi+RuUTivgd5m7K/givs AoiGCsOKMTNYtWbiHYJrxd48s7n26vaIVKiT8QNXxt1De8COCuBUfO6kS5XT6vqwTcSIw2G+EJj 0eROczZ5S8Xu9JyF29WqvLjTaOao= X-Received: by 2002:a17:907:6eaa:b0:c46:d837:b358 with SMTP id a640c23a62f3a-c513a4355afmr3027060766b.3.1796115023635; Tue, 01 Dec 2026 00:50:23 -0800 (PST) X-Received: by 2002:a17:907:6eaa:b0:c46:d837:b358 with SMTP id a640c23a62f3a-c513a4355afmr3027058666b.3.1796115023127; Tue, 01 Dec 2026 00:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796115023; cv=none; d=google.com; s=arc-20260327; b=Rclf6e0kHTbYlhWb3YoWEZBkKamHPnywCYc6GrhyWjj9c1VPkA2ouCE8CqMUsvg0UB I5QR+y3ZTjFkNPIIY2d50ksf8O9C11iUA9NliH2vGGk7S8ec7KSRtknqsfxBdu6FiYqs X+AtA2Fra0zs4d/RDcPdqteb62FderCM0vcXSwRsG252X+Jm+76T5rftBXEkwXmnMLB8 IGRrX5dOqK8AYyU/3BGBysz10JmyhkmfdAi8aLv8czbFUbjFxxZZVxDrnRYiD0aMedNZ JWOu6xoLgMPcj9VkrqhAbC5wNOyPbXJfeRomCZhgAjO7y2FVl3osihrkG9p/hgqrx/yV 54lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=pudTc7ucGTwPqMiUzIGZye9ONxDYVrMYzhrssPYXVxo=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=iDtL7eK4Iqrdppo+Brvl/q8SJMigvuMBOAHm3X8aDv4s40ZJMMtjH3d0mPXgb3LC2V DetM2lFCjKQm2fS+a9OmZmMyYF4QVGS8dSIj50L1zA2jTvb+ZEpQz3KjuRVmiCHX5pKf /sN5FpIirpFJSAh3HnF+i79A2OhGXrHSoewdAt6P0CcEdXdLJ8pDO7HaYRuMvPSYl9Vq TLvLqC0P8hRH6XkqSVtO7iLE7jt8CU6ATKpcjLKs/hhY4iWsgsbVQgtHBMrAYt8v8Cd0 jrhz/t0qNI8yWpfaCTYhAErI85Unn8HhwO/5P/wpMAE/6FklJ831JImEa1qAMWHRcjn6 h1tg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="XL2QEW/n"; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id a640c23a62f3a-c513b0a1464si2309290566b.270.2026.12.01.00.50.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 00:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b="XL2QEW/n"; spf=pass (google.com: domain of alexander.ivanov@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=alexander.ivanov@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=MIME-Version:Message-ID:Date:Subject:From: Content-Type; bh=pudTc7ucGTwPqMiUzIGZye9ONxDYVrMYzhrssPYXVxo=; b=XL2QEW/norRG hyxxP78AUBTZxmGo5hakBVo0P7SmvOKRdewy+a9MnyDrf8bSwsVvGFETCA/4PY9SqT+C+Q94XpEME G1N9p9ZxtLYjekrbHxAjGTpJ/CwHKIlKKRiecI9u9lHeKXY1AaBaBC7SWm1pq8zPsLG7CcGd9Y6Wq yHjtGQbY973KC+F0LNrXOHl9H54G8x/IrGjqKsbm/XBe5AACveyK1JvPjg8dbIVNXLIhR/g8dwsoj TjcW/m1ZLS1XDD6UCNztSjujVJWbOW02NYWaV/Q86F5NYGpdAD5jdzOoJ9e5Vk9J8pmxYTRAD7MhP 8g9Qo7c1jeOzYBHA3ySk1A==; Received: from ch-vpn.virtuozzo.com ([130.117.225.6] helo=sky) by relay.virtuozzo.com with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1xYJYo-000HJh-1u; Tue, 01 Dec 2026 09:50:13 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Tue, 1 Dec 2026 09:50:16 +0100 Message-ID: <20261201085020.1884923-1-alexander.ivanov@virtuozzo.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.2 v3 0/4] drivers/vhost/blk: hold requests failed with ENOSPC until QEMU resubmits them X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org With report_enospc, dm-qcow2 and dm-ploop fail a request with ENOSPC at once, and vhost-blk passes it to the guest as VIRTIO_BLK_S_IOERR. The guest gets a write error, where QEMU with werror=enospc would pause the VM until space is freed. This series lets QEMU hold such requests in vhost-blk: - VHOST_BLK_SET_ERROR_POLICY selects the requests to hold on ENOSPC: writes (with flushes, write zeroes and discards) and reads - VHOST_BLK_SET_ERROR_FD sets the eventfd signalled when a request is held - VHOST_BLK_GET_HELD_REQS returns the vq and head of each held request - VHOST_BLK_RESUBMIT submits held requests again by vq and head, on resume or on the destination of a migration A held request stays out of the used ring and is not counted as inflight, so stopping vhost-blk to pause the VM does not wait for it. QEMU uses them as follows: - when it starts vhost-blk: VHOST_BLK_SET_ERROR_POLICY and VHOST_BLK_SET_ERROR_FD, before the backend is set - on the eventfd: stops the VM and vhost-blk, then reads the list with VHOST_BLK_GET_HELD_REQS - on the next start, or on the destination of a migration: VHOST_BLK_RESUBMIT with the saved vq and head pairs, after VHOST_BLK_SET_BACKEND, which empties the list Patches 1-2 move the descriptor chain walk and the request parsing out of the avail ring path, so that a head taken earlier can be parsed again. Patch 3 holds the requests and reports them, patch 4 resubmits them. The series goes on top of "dm-qcow2, dm-ploop: report ENOSPC at once for vhost-blk disks" v3, which lets the ENOSPC reach vhost-blk. The other parts: - QEMU: "[PATCH hci-8.2 v3 0/5] vhost-blk: support the werror/rerror policies" - libvirt: https://bitbucket.org/openvz/libvirt.ovz/pull-requests/403 - ploop.ovz: https://bitbucket.org/openvz/ploop.ovz/pull-requests/530 v3: - patch 3: copy the held list to userspace in VHOST_BLK_GET_HELD_REQS without held_mutex, so that a faulting user buffer does not stall the completion path - patch 4: say in the uapi which VHOST_BLK_RESUBMIT errors fail the rest of the entries and which concern only the failed one - rebase on top of rh10-6.12.0-211.75.1.26.6.vz10 and the dm-qcow2, dm-ploop series v3 v2: - cover letter: say how QEMU uses the ioctls and name the QEMU, libvirt and ploop.ovz series - patch 3: hold a request split into several bios only if none of them failed with an error other than ENOSPC - patch 3: say that a guest reusing a held head after a backend restart gets it accepted - patch 4: fail a head out of range with -EINVAL and a head in flight with -EBUSY before the descriptor chain is walked - patch 4: on error, set nr to the index of the entry that failed - rebase on top of the dm-qcow2, dm-ploop series v2 and the VIRTIO_BLK_F_DISCARD series v4 - patch 3: say that a discard is held as a write, as werror covers it in QEMU - patch 4: say in the uapi that VHOST_BLK_RESUBMIT needs the backend set https://virtuozzo.atlassian.net/browse/VSTOR-152175 Alexander Ivanov (4): drivers/vhost: split the descriptor chain walk out of vhost_get_vq_desc() drivers/vhost/blk: split request parsing out of the guest kick handler drivers/vhost/blk: hold requests failed with ENOSPC drivers/vhost/blk: add the VHOST_BLK_RESUBMIT ioctl drivers/vhost/blk.c | 304 ++++++++++++++++++++++++++++--- drivers/vhost/vhost.c | 91 +++++---- drivers/vhost/vhost.h | 4 + include/uapi/linux/vhost.h | 35 ++++ include/uapi/linux/vhost_types.h | 21 +++ 5 files changed, 392 insertions(+), 63 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel