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 6C72980063 for ; Mon, 30 Nov 2026 16:26:41 +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 6AUGPRvD019748; Mon, 30 Nov 2026 19:25:28 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AUGPRvD019748 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="NMHMo6Ex" Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 6AUGPAVl019656 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Mon, 30 Nov 2026 19:25:10 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 6AUGPAVl019656 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-6bb082d3146so3575068a12.2 for ; Mon, 30 Nov 2026 08:25:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AL+hErEOLwd0Jzvk+5asjYM0S9BSud+0toDb4hkZpdTrWRw6INMtuEALGXkoamdKQMG+P4ymnMKkdg==@openvz.org X-Gm-Message-State: APuU4Z8Lu/VS96itHddxRss33H8ndwD7uISSFj0VDfvqYrCOhRKT1Xj3 kGwTjVxf4PH9f+E4kbo0keY/EuezQXCC2FdeHW/tDoGV149xac7hjI3sLMK91Brg0myqjmHzAdV qO0qeHt7hCSr9nLsQosHjVOuqEK1/TSGFj71zhdnnm/ZOdx/8UORW2g== X-Gm-Gg: AZFdTZckBIjqaFu2EIL8EbgDAgJe8mwqeKBH2UFt2geAth0kV5QjbWY0p7FajPWXtxq qIAe/WvwbzzanNCeOrwG+6ze//dqSiQ6yZ60efAZgSj4JWPHb928UmTFXXzFL5V6brj0598TXCb 7CHFFrosT+fbxDMi5nb3LfxyHDu6U4EAIovq7IujNsrnJjif1yst6jI0zOg5OXCpX38bpwqfCYc z6qVmXrO008QH4UETUu3TOs8fcYexVm7cI6Se7ZzZ8apxcc6AQ+TVanhVa56LZspvXfiwSDUDxo 8AkLHwcFgPa5BYmvk5M6ys1NDjO/pPNbAIdgczHZIze7a+OOADUSh6WvFLc6fkoe+4oQ58ObVot yyRP1V+woGvsTBUbMd7SObmLnGa8= X-Received: by 2002:a05:6402:1e94:b0:6b5:8247:7bc7 with SMTP id 4fb4d7f45d1cf-6ba37ed4f03mr26246472a12.44.1796055910280; Mon, 30 Nov 2026 08:25:10 -0800 (PST) X-Received: by 2002:a05:6402:1e94:b0:6b5:8247:7bc7 with SMTP id 4fb4d7f45d1cf-6ba37ed4f03mr26246454a12.44.1796055909752; Mon, 30 Nov 2026 08:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1796055909; cv=none; d=google.com; s=arc-20260327; b=j9TbWxXsTLaBVg78H7gc3lPyilSFBCG61TynRoeqO+LzmgVspgY6R0OkKdpuMzZkNM /YjPLPKMqv9plfI5a5CG+dNd2tRVpaDQ5n0cfsfDO0WffmaEgWIxJND/ss+u2BDbvnLp 1IGnNyRtZJwhtkGFwJPSSQsuI8Mj7nR22GGR37o17J3kRJ2ZkVLejvZIxe5bgK0g4P50 T8kDmJoG6UHqOkZGIg92m+DAnJuq6cZCYeKnrSfZ/P5C1q8oP8lzybAhuynfivs9R+RF +9pkwKYXWA7cl97jaR0snsQ6hxpTXYLDZ2RGVfZTlizabLKCSPBAAiKyt4MHjIZVdW1I 1YJw== 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=3l+CJdyX4YLSKeN3uu5kFGInMCymOXVV5QIHy0Hl5Xs=; fh=CMILZ+goaghq6B4UpCDhf0EQp6kYD0LAlmOkUiVCOvs=; b=GdwoG7mBylQ40xiM+1x2XmUlni2Uyxvq0LTWPwpX7epCUeHowuqyEPiyz0ite9Uwck MGR71aQZrmWtlL4FxhlFYnqqg+x+GUzWHWwOtYQXmAV3iNA9S8Yn23A/aW+Vlq+29WwI CrIPN+lT7pylk6zmsEyRwj66+v8OrnnDMQYztiKgHQ+5Q66BZyddmvPlSUQT/KqTl5gX iSJNNbIe6nSRoZTjISRwVQABPbdJR1gPozIi8Q0Tjmn6y5RBw47Dk0kckO+/mwVDC3sz WLZHKtuEsCqpcM+l03iK7bM7UVfi/32qKIxM6WcUfieZnUR2jCiA6/WDXJA9qq+ZVSah uktQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=NMHMo6Ex; 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 4fb4d7f45d1cf-6ba3739870fsi27607869a12.183.2026.11.30.08.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 08:25:09 -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=NMHMo6Ex; 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=3l+CJdyX4YLSKeN3uu5kFGInMCymOXVV5QIHy0Hl5Xs=; b=NMHMo6ExTf3/ sIynvyHrFmpGzSH55Q1NDhaDmkO3sDe3qmub7VviR6TvS+Hct3GNSGrtfTonx015F2DkFU90GQ2CW io3+XVwRdXoVZXu1/pSdDx2Qh+fo/UdtNSZQoF8JUrJtcIMfGgQxbc8EO1RZCzt6zFF81eWFbPUZz bg31lSF2UPrCf94+oZgM9KlTJF/l2AiBk/YiPlt5RVQZfaXXW+aAMj6xnPcHT6bg+axFTi7Bj+LXk ZFpqG+BaWZRa80K14xfebqKY3DMVxVJWv4WDgv4NSrCmXG6gHaa/Bh2RCocjV/UFGbi4kYGU97iye Sf89l1esI/bjaX/+13Z56Q==; 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 1xY4BO-00Gm8b-0r; Mon, 30 Nov 2026 17:25:00 +0100 From: Alexander Ivanov To: andrey.zhadchenko@virtuozzo.com Date: Mon, 30 Nov 2026 17:25:03 +0100 Message-ID: <20261130162507.1822477-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 v2 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" v2, which lets the ENOSPC reach vhost-blk and goes on top of "drivers/vhost/blk: fix write zeroes errors, support VIRTIO_BLK_F_DISCARD" v4. 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 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 | 303 ++++++++++++++++++++++++++++--- drivers/vhost/vhost.c | 91 ++++++---- drivers/vhost/vhost.h | 4 + include/uapi/linux/vhost.h | 33 ++++ include/uapi/linux/vhost_types.h | 21 +++ 5 files changed, 389 insertions(+), 63 deletions(-) -- 2.53.0 _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel