All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH hci-8.2 v2 0/2] vhost-blk: support discard
@ 2026-11-26  9:39 Alexander Ivanov
  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  9:39 ` [PATCH hci-8.2 v2 2/2] vhost-blk: advertise discard on a backend that supports it Alexander Ivanov
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Ivanov @ 2026-11-26  9:39 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 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


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

end of thread, other threads:[~2026-11-26 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-26  9:39 [PATCH hci-8.2 v2 0/2] vhost-blk: support discard Alexander Ivanov
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

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.