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 EDF6180063 for ; Tue, 1 Dec 2026 12:50:57 +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 6B1Cnb7g008003; Tue, 1 Dec 2026 15:49:38 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6B1Cnb7g008003 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="fVgQgn7X" Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6B1Cnaa1007988 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Tue, 1 Dec 2026 15:49:36 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6B1Cnaa1007988 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-c50c9af44d6so1121415466b.1 for ; Tue, 01 Dec 2026 04:49:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErFOH2TZgqZhUt1+xyfOw6h+FeHIxxh9i/pzDPf+UOVi1IfE0PUA3/nH9/IeNi4UXhIFEDHQ4g==@openvz.org X-Gm-Message-State: APuU4Z/sqho8trm3Rsw6KYWJ2mC5uCICDRF9iOwc/S6liBisWwenzX+i PYwZXptB09f9RoeNybZBuz4P2z05EGM/YWIRYI2RUNx36s5E0nWzeuiGwtcyFF2JYYgQB1IvLqT T5MAs6oqLfT/FZlfMG8yQy0wDZjfzlC8kEHVd68YYf1kmB31g6IXANA== X-Gm-Gg: AZFdTZdN8XDZidC9ZMpK/f0Mlb+rtUk2Vcv4c47946bm5SISS0GveJzcdYKmtb448Bz XOc1d5qsMgjHRca6bNGN+Hwz1RaBjpFmDpdxTlxNqlcC566GQUNkTOFh28PCAxCJ+UiKcZ+QbB/ AkF+8MlaywYTYHJ1uDI+p+djFP4tv1UnVwQmI7zPboqxUCDzy4doh2pfmU5T3W05lQRKwIlLQzv t/pRlyKfGQ7Y/+qlF8v2/bS+pb0K+7PEoQSxN+j3Ft2J93dMQetJKYOz+1Psdr10FDLvy8QvSjK EDbdI9haY9wcH0WaNRP6jR6TTG63+afr8Eg5z6f5oEMRU16WLo5CS4zrN89HCo0OUcH05l7GtyA 1eqzOAae8XNfc/K64wFZ8mdgz+hQE X-Received: by 2002:a17:907:3dac:b0:c51:9b3f:454 with SMTP id a640c23a62f3a-c519b3f096bmr1783840866b.18.1796129375941; Tue, 01 Dec 2026 04:49:35 -0800 (PST) X-Received: by 2002:a17:907:3dac:b0:c51:9b3f:454 with SMTP id a640c23a62f3a-c519b3f096bmr1783837866b.18.1796129375352; Tue, 01 Dec 2026 04:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796129375; cv=none; d=google.com; s=arc-20260327; b=Hi9kEQOuLusWYM2CED3Kj7J5vX9CRy4rNc7//uZprD2yiUWbFGmhm2R+yBp9iYFJZS uckzJLhV2mDaG28eqTcHAQbtT1kw8A9R5ELzH8R7kUVQfHND1PxS9J6hvl6zsfWRwVPY t5v8e//fbFwLJdlSYA1B6O9ABpmHtOfrJzkNcUlTwI3SxhlB4L00bsdTgYxi04+azr5v J/NBUlpekXNHK0/G40lLQ0s8/K79jleWmtMhIgeY1ph/WJutNSPxa9ZSqbzxU/sSRaBH rmv+hi2P2zpWGtGuHwqDM5roAs45C1k0H1Fzkn7A1sJJRu3GTqlfnXjQ8syPkv4S+zqj HrGw== 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=cW+zLq47qzh95HHgWzalwlWywNqXbBtcjQqhO6avY0Y=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=dukILu9wI9edYKSdfxHmLwnkrZOATyK3pr8dfSt/9dUMni1mg5jGAMzFH4uRI0nEVG 6/wo3FDQgYUI6nUl/lPafNwcK/hEhupf3LpGLj47upg2e7jPJ7/gLIk5HlNZ8OYrXYe+ I5DU4X9rCPjuVIE6jmlds5S4HF8LW3j0b6CZRwYMqO5j+juS3cS2B+vebl/4FyuiX4sl hHLX7JDkfkrBFAV4FO2+BfTjSlnaZ+uSTtiwlTb4Vki1F/NQ2Tp/229RKidymD2T5AqB pAFGVS1HiYZq8JEIXiyiXXUj/oce9W08n7SaXZGEyIQWOb+1qxtI19g6XL6wBVvMZOUd RLNQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=fVgQgn7X; 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-c513b070731si2215586866b.258.2026.12.01.04.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 04:49:35 -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=fVgQgn7X; 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=cW+zLq47qzh95HHgWzalwlWywNqXbBtcjQqhO6avY0Y=; b=fVgQgn7XBmns 0bo/kBZa9k7nvxlQSIuK4DTuSfXz8ness7m+ZpApZJBe185Uhhma9OVjUmDSNWDc+YAfMej3MckoB 9G/EXeUv1/e/lYkEs6tk/vp7EllYrleZqmCEPlP8avFWAQ0Jmez8NBQUO4/I8f2kSTYMa/RHd96jz BRQK/++i0qdkF3ITAZ3suSYoSb6HgJvnst9FZC7dYNqZTSr+N5YQHnLYTtgorAycVd+2mDtfCf+ai q6KuITZuiE250t9a3U5EJXbgtSTbqbDDzJqMMNiAl3XzlPOVFgry5+b7iDbrURAQmj9paDlfqfenV tfUSFLz9jJ/T2HrM9U2dzA==; 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 1xYNII-004oY7-1E; Tue, 01 Dec 2026 13:49:25 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Tue, 1 Dec 2026 13:49:27 +0100 Message-ID: <20261201124931.1969095-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 v4 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 - after every stop of vhost-blk, not only one caused by the eventfd: reads the list with VHOST_BLK_GET_HELD_REQS, as a request in flight can be held while the stop waits for it - 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 v4 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 v4: - patch 3: keep the held list across a failing VHOST_BLK_SET_BACKEND, adding the requests held by the vqs it had started, so that the saved heads are not lost (item 2 of the v1 review, missed in v2 and v3) - patch 4: return -EIO instead of -EFAULT for a fault on the guest memory of one entry, so that -EFAULT, which ends the call, means only a fault on the array of the caller - cover letter: say that QEMU reads the list after every stop - cover letter: name the QEMU series v4 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 Assisted-by: LLM 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 | 313 ++++++++++++++++++++++++++++--- drivers/vhost/vhost.c | 91 +++++---- drivers/vhost/vhost.h | 4 + include/uapi/linux/vhost.h | 39 ++++ include/uapi/linux/vhost_types.h | 21 +++ 5 files changed, 405 insertions(+), 63 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel