From: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
To: Alexander Ivanov <alexander.ivanov@virtuozzo.com>,
andrey.zhadchenko@virtuozzo.com
Cc: svt-core@virtuozzo.com
Subject: Re: [PATCH hci-8.2 v3 0/4] vhost-blk: support discard
Date: Fri, 27 Nov 2026 17:24:54 +0200 [thread overview]
Message-ID: <ed6ba34f-6cad-44a6-9dfa-c1cfaab4fc02@virtuozzo.com> (raw)
In-Reply-To: <20261127124658.1180997-1-alexander.ivanov@virtuozzo.com>
Reviewed-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
On 11/27/26 2:46 PM, Alexander Ivanov wrote:
> vhost-blk in the kernel now handles VIRTIO_BLK_T_DISCARD. Detect discard
> support of the backend the way write zeroes does and advertise the
> discard limits in the config space.
>
> Patch 1 generalizes the sysfs reader used for write zeroes.
> Patch 2 factors out the probe of the backend built on it.
> Patch 3 enables discard on a backend that supports it.
> Patch 4 fails realize when the kernel lacks a requested feature.
>
> The series applies on top of "vhost-blk: advertise write zeroes on a
> backend that supports it" (VSTOR-141684). The kernel side is sent
> separately.
>
> v3:
> - patch 2: new, move the sysfs probe of the backend into
> vhost_blk_probe_backend()
> - patch 3: use vhost_blk_probe_backend() instead of an open-coded copy
> of the write zeroes probe
> - patch 3: drop the warning at realize, see patch 4
> - patch 4: new, fail realize instead of warning when the write-zeroes
> or discard property is on and the kernel does not support the feature
>
> v2:
> - patch 1: new, turn vhost_blk_has_write_zeroes() into
> vhost_blk_read_queue_attr()
> - patch 2: read discard_max_bytes of the backend at startup and do not
> offer VIRTIO_BLK_F_DISCARD when the backend does not support discard,
> the limit cannot be read or the backend is opened read-only
> - patch 2: advertise VHOST_BLK_MAX_RANGE_SECTORS, shared with write
> zeroes, instead of UINT32_MAX >> BDRV_SECTOR_BITS as the range limit
> - patch 2: warn at realize when the kernel does not support discard
>
> https://virtuozzo.atlassian.net/browse/VSTOR-141683
>
> Alexander Ivanov (4):
> vhost-blk: read any queue attribute of the backend from sysfs
> vhost-blk: factor out the sysfs probe of the backend
> vhost-blk: advertise discard on a backend that supports it
> vhost-blk: fail realize when the kernel lacks write zeroes or discard
>
> hw/block/vhost-blk.c | 80 +++++++++++++++++++++++++++--------
> include/hw/virtio/vhost-blk.h | 3 +-
> 2 files changed, 64 insertions(+), 19 deletions(-)
>
next prev parent reply other threads:[~2026-11-27 15:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 12:46 Alexander Ivanov
2026-11-27 12:46 ` [PATCH hci-8.2 v3 1/4] vhost-blk: read any queue attribute of the backend from sysfs Alexander Ivanov
2026-11-27 12:46 ` [PATCH hci-8.2 v3 2/4] vhost-blk: factor out the sysfs probe of the backend Alexander Ivanov
2026-11-27 12:46 ` [PATCH hci-8.2 v3 3/4] vhost-blk: advertise discard on a backend that supports it Alexander Ivanov
2026-11-27 12:46 ` [PATCH hci-8.2 v3 4/4] vhost-blk: fail realize when the kernel lacks write zeroes or discard Alexander Ivanov
2026-11-27 15:24 ` Andrey Drobyshev [this message]
2026-11-30 14:09 ` [PATCH hci-8.2 v3 0/4] vhost-blk: support discard Andrey Zhadchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed6ba34f-6cad-44a6-9dfa-c1cfaab4fc02@virtuozzo.com \
--to=andrey.drobyshev@virtuozzo.com \
--cc=alexander.ivanov@virtuozzo.com \
--cc=andrey.zhadchenko@virtuozzo.com \
--cc=svt-core@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.