Skip to content

qemu-img: Allow rebase with no input base

Max Reitz qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 3 repliesApplied
  3. v13 patches 11 repliesSuperseded

Changes in v3 from the cover letter

- Patch 3: Move test to own file so it doesn’t run for qed or qcow2 v2 (because it can’t, it requires zero clusters)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qemu-img: Allow rebase with no input baseqemu-img.c+34 -270 replies
2/3qemu-img: Use zero writes after source backing EOFqemu-img.c+9 -20 replies
3/3iotests: Add test for rebase without input basetests/qemu-iotests/252 tests/qemu-iotests/252.out tests/qemu-iotests/group+164 -00 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/3R-b
2/3R-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 0/3] qemu-img: Allow rebase with no input base

This series allows using qemu-img rebase (without -u) on images that do not have a backing file. Right now, this fails with the rather cryptic error message:

$ qemu-img rebase -b base.qcow2 foo.qcow2
qemu-img: Could not open old backing file '': The 'file' block driver requires a file name

Yeah, well, OK.

With how rebase currently works, this would lead to the overlay being filled with zeroes, however. This is where patch 2 comes in and instead makes rebase use blk_pwrite_zeroes() whenever it handles an area past the input’s backing file’s EOF.

(Note that additionally we could try to punch holes in the overlay whenever it matches the new backing file, but that’s something I’ll put off for later. (We don’t even have a reliable method for punching holes into an overlay yet, although I would like to have such because it could make active commit more efficient.))

And patch 3 adds the usual test.

v3:
- Patch 3: Move test to own file so it doesn’t run for qed or qcow2 v2 (because it can’t, it requires zero clusters)

git backport-diff against v2:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/3:[----] [--] 'qemu-img: Allow rebase with no input base' 002/3:[----] [--] 'qemu-img: Use zero writes after source backing EOF' 003/3:[0059] [FC] 'iotests: Add test for rebase without input base'

v2:
- Patch 1: Added example to the commit message, and made a note that this is about rebase without -u [Eric]

git backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/3:[----] [--] 'qemu-img: Allow rebase with no input base' 002/3:[----] [--] 'qemu-img: Use zero writes after source backing EOF' 003/3:[----] [--] 'iotests: Add test for rebase without input base'

Max Reitz (3):
qemu-img: Allow rebase with no input base
qemu-img: Use zero writes after source backing EOF
iotests: Add test for rebase without input base

 qemu-img.c                 |  72 ++++++++++++---------
 tests/qemu-iotests/252     | 124 +++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/252.out |  39 ++++++++++++
 tests/qemu-iotests/group   |   1 +
 4 files changed, 207 insertions(+), 29 deletions(-)
 create mode 100755 tests/qemu-iotests/252
 create mode 100644 tests/qemu-iotests/252.out
Signature · 1 line
2.21.0