On Mon, May 11, 2026 at 22:21:35 +0200, Denis V. Lunev wrote:
> qemuDomainBlockResize() issues block_resize via QMP, which updates the
> qcow2 header on disk and bs->total_sectors in qemu, but the cached
> disk->src->capacity in libvirt is left at its pre-resize value.
> 
> All current readers re-read capacity from either QMP or the file itself
> before returning to the user, so the staleness is not externally
> observable today. Still, the cached field should reflect what we just
> asked qemu to write; keeping the two in sync avoids surprises for any
> future consumer that trusts the cached value.

None of those values are stored in the status XML so they will be
missing in certain situations. Each caller who wants to read the
'capacity', 'allocation' or 'physical' field *must* update it before any
read.

The commit message doesn't IMO provide enough justification to do this
since each caller will update it.

Reply via email to