[PATCH 0/3] block: measure for commit

Jean-Louis Dupond posted 3 patches 13 hours ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260608110346.3231998-1-jean-louis@dupond.be
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
block.c                            | 65 +++++++++++++++++----
block/mirror.c                     |  2 +-
block/qcow2.c                      | 90 +++++++++++++++++++++++++++---
include/block/block-global-state.h |  7 ++-
qemu-img-cmds.hx                   |  4 +-
qemu-img.c                         | 37 ++++++++++--
tests/qemu-iotests/178.out.qcow2   |  6 +-
tests/qemu-iotests/178.out.raw     |  6 +-
tests/qemu-iotests/290             | 45 +++++++++++++++
tests/qemu-iotests/290.out         | 61 ++++++++++++++++++++
10 files changed, 289 insertions(+), 34 deletions(-)
[PATCH 0/3] block: measure for commit
Posted by Jean-Louis Dupond 13 hours ago
In some cases we want to calculate the size an image will be after we commit A into B.
This for example on block storage, where you need to resize the target storage before you start the merge.

These commits adds the functionality to do this.
First of all a commit that adds bdrv_open_backing_chain_until. So we can open an image up to base image B.

And then a modified qcow2_measure that calculates the size of B after A has been merged into it.
This with taking into account the discard-no-unref setting of the base.

Jean-Louis Dupond (3):
  block: add bdrv_open_backing_chain_until
  block: support measure for commit
  iotests/290: add test case for qemu-img measure

 block.c                            | 65 +++++++++++++++++----
 block/mirror.c                     |  2 +-
 block/qcow2.c                      | 90 +++++++++++++++++++++++++++---
 include/block/block-global-state.h |  7 ++-
 qemu-img-cmds.hx                   |  4 +-
 qemu-img.c                         | 37 ++++++++++--
 tests/qemu-iotests/178.out.qcow2   |  6 +-
 tests/qemu-iotests/178.out.raw     |  6 +-
 tests/qemu-iotests/290             | 45 +++++++++++++++
 tests/qemu-iotests/290.out         | 61 ++++++++++++++++++++
 10 files changed, 289 insertions(+), 34 deletions(-)

-- 
2.54.0