[PATCH 0/2] qemu-img: fix getting stuck in infinite loop on

Andrey Drobyshev via posted 2 patches 11 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230523162458.704266-1-andrey.drobyshev@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
qemu-img.c                 |  7 ++++++
tests/qemu-iotests/024     | 48 ++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/024.out | 23 ++++++++++++++++++
3 files changed, 78 insertions(+)
[PATCH 0/2] qemu-img: fix getting stuck in infinite loop on
Posted by Andrey Drobyshev via 11 months, 2 weeks ago
Consider the following in-chain rebase case:

qemu-img create -f qcow2 base.qcow2 $(( 64 * 4 ))k
qemu-img create -f qcow2 -o backing_file=base.qcow2,backing_fmt=qcow2 inc1.qcow2 $(( 64 * 4 ))k
qemu-img create -f qcow2 -o backing_file=inc1.qcow2,backing_fmt=qcow2 inc2.qcow2 $(( 64 * 5 ))k
qemu-img rebase -f qcow2 -b base.qcow2 -F qcow2 inc2.qcow2

And then rebase operation gets stuck forever.

The 1st patch is a fix, the 2nd -- an additional test case to catch this
situation.

Andrey Drobyshev (2):
  qemu-img: rebase: stop when reaching EOF of old backing file
  qemu-iotests: 024: add rebasing test case for overlay_size >
    backing_size

 qemu-img.c                 |  7 ++++++
 tests/qemu-iotests/024     | 48 ++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/024.out | 23 ++++++++++++++++++
 3 files changed, 78 insertions(+)

-- 
2.31.1