From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
To: andrey.zhadchenko@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, svt-core@virtuozzo.com
Subject: [PATCH hci-8.2 v2 0/2] vhost-blk: support discard
Date: Thu, 26 Nov 2026 10:39:10 +0100 [thread overview]
Message-ID: <20261126093912.891440-1-alexander.ivanov@virtuozzo.com> (raw)
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 enables discard on a backend that supports it.
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.
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 (2):
vhost-blk: read any queue attribute of the backend from sysfs
vhost-blk: advertise discard on a backend that supports it
hw/block/vhost-blk.c | 46 +++++++++++++++++++++++++++++------
include/hw/virtio/vhost-blk.h | 3 ++-
2 files changed, 40 insertions(+), 9 deletions(-)
--
2.53.0
next reply other threads:[~2026-11-26 9:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 9:39 Alexander Ivanov [this message]
2026-11-26 9:39 ` [PATCH hci-8.2 v2 1/2] vhost-blk: read any queue attribute of the backend from sysfs Alexander Ivanov
2026-11-26 12:47 ` Andrey Drobyshev
2026-11-26 9:39 ` [PATCH hci-8.2 v2 2/2] vhost-blk: advertise discard on a backend that supports it Alexander Ivanov
2026-11-26 12:47 ` Andrey Drobyshev
2026-11-26 16:08 ` Alexander Ivanov
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=20261126093912.891440-1-alexander.ivanov@virtuozzo.com \
--to=alexander.ivanov@virtuozzo.com \
--cc=andrey.drobyshev@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.