qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] block/export: Fix crash on error after iothread conflict
@ 2021-04-22 14:53 Max Reitz
  2021-04-22 14:53 ` [PATCH 1/2] block/export: Free ignored Error Max Reitz
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Max Reitz @ 2021-04-22 14:53 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi, Max Reitz

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(+)

-- 
2.30.2



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-28  9:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 14:53 [PATCH 0/2] block/export: Fix crash on error after iothread conflict Max Reitz
2021-04-22 14:53 ` [PATCH 1/2] block/export: Free ignored Error Max Reitz
2021-04-26  9:44   ` Vladimir Sementsov-Ogievskiy
2021-04-26 10:33     ` Max Reitz
2021-04-26 11:01       ` Vladimir Sementsov-Ogievskiy
2021-04-22 14:53 ` [PATCH 2/2] iotests/307: Test iothread conflict for exports Max Reitz
2021-04-26 10:09   ` Vladimir Sementsov-Ogievskiy
2021-04-28  9:46 ` [PATCH 0/2] block/export: Fix crash on error after iothread conflict Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).