Skip to content

qcow2: don't leave partially initialized file on image creation

Maxim Levitsky qemu-devel 5 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 4 repliesApplied
  2. v54 patches 6 repliesSuperseded
  3. v44 patches 5 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v32 patches7 repliesSuperseded
v22 patches2 repliesSuperseded

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/3crypto: luks: Fix tiny memory leakblock/crypto.c+2 -00 replies
2/3block: add bdrv_co_delete_file_noerrblock.c block/crypto.c include/block/block.h+25 -131 reply
3/3block: qcow2: remove the created file on initialization errorblock/qcow2.c+5 -31 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAlberto GarciaVladimir Sementsov-Ogievskiy
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

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

Read the v6 thread

Cover letter [PATCH v6 0/3] qcow2: don't leave partially initialized file on image creation

Use the bdrv_co_delete_file interface to delete the underlying file if qcow2 initialization fails (e.g due to bad encryption secret)

This makes the qcow2 driver behave the same way as the luks driver behaves.

V3: addressed review feedback and reworked commit messages

V4: got rid of code duplication by adding bdrv_co_delete_file_noerr and made the qcow2 driver use this function to delete both the main and the data file.

V5: addresssed review feedback on reworked version.

V6: addressed most of the review feedback.

Best regards,
Maxim Levitsky

Maxim Levitsky (3):
crypto: luks: Fix tiny memory leak
block: add bdrv_co_delete_file_noerr
block: qcow2: remove the created file on initialization error

 block.c               | 22 ++++++++++++++++++++++
 block/crypto.c        | 13 ++-----------
 block/qcow2.c         |  8 +++++---
 include/block/block.h |  1 +
 4 files changed, 30 insertions(+), 14 deletions(-)
Signature · 1 line
2.26.2