Skip to content

block/export: Fix crash on error after iothread conflict

Max Reitz qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2block/export: Free ignored Errorblock/export/export.c+4 -03 replies
2/2iotests/307: Test iothread conflict for exportstests/qemu-iotests/307 tests/qemu-iotests/307.out+23 -01 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchVladimir Sementsov-OgievskiyStefan Hajnoczi
SeriesR-b
1/2R-b
2/2R-b T-b

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

Read the v1 thread

Cover letter [PATCH 0/2] block/export: Fix crash on error after iothread conflict

Hi,

By passing the @iothread option to block-export-add, the new export can be moved to the given iothread. This may conflict with an existing parent of the node in question. How this conflict is resolved, depends on @fixed-iothread: If that option is true, the error is fatal and block-export-add fails. If it is false, the error is ignored and the node stays in its original iothread.

However, in the implementation, the ignored error is still in *errp, and so if a second error occurs afterwards and tries to put something into *errp, that will fail an assertion.

To really ignore the error, we have to free it and clear *errp (with an ERRP_GUARD()).

Patch 1 is the fix, patch 2 a regression test.

Max Reitz (2):
block/export: Free ignored Error
iotests/307: Test iothread conflict for exports

 block/export/export.c      |  4 ++++
 tests/qemu-iotests/307     | 15 +++++++++++++++
 tests/qemu-iotests/307.out |  8 ++++++++
 3 files changed, 27 insertions(+)
Signature · 1 line
2.30.2