All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH hci-8.2 v3 0/4] vhost-blk: support discard
@ 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
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Alexander Ivanov @ 2026-11-27 12:46 UTC (permalink / raw)
  To: andrey.zhadchenko; +Cc: andrey.drobyshev, svt-core

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(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-30 14:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27 12:46 [PATCH hci-8.2 v3 0/4] vhost-blk: support discard 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 ` [PATCH hci-8.2 v3 0/4] vhost-blk: support discard Andrey Drobyshev
2026-11-30 14:09 ` Andrey Zhadchenko

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.