On Fri, Aug 07, 2026 at 01:56:36AM +0200, Niklas Cassel wrote:
> Looking at the write_granularity in virtio-blk + file-posix:
> for blkcfg.zoned.write_granularity, which is what virtio-blk exposes to
> the guest, it is initialized using:
> https://github.com/qemu/qemu/blob/v11.1.0-rc3/hw/block/virtio-blk.c#L1257
> conf->logical_block_size:
> https://github.com/qemu/qemu/blob/v11.1.0-rc3/hw/block/virtio-blk.c#L1183
> 
> and the value we set to the qemu block layer - bs->bl.write_granularity,
> which file-posix initilizes using:
> https://github.com/qemu/qemu/blob/v11.1.0-rc3/block/file-posix.c#L1498-L1501
> the sysfs value for physical_block_size.

If we are using sysfs, I wonder why this code does not simply read:
/sys/block/<disk>/queue/zone_write_granularity
instead.


But that would still be inconsistent with blkcfg.zoned.write_granularity which
is initialized using conf->logical_block_size.


Kind regards,
Niklas

Reply via email to