If s->replace_blocker was already set by an earlier invocation of
mirror_complete(), then there will be an assertion failure when
error_setg() is called for it a second time. The bdrv_ref() operation
should only be done a single time too.

I thought about using an early return with an error, but that might
break existing users that (accidentally) issue duplicate
'job-complete' without using 'replaces'.

A paused job does not accept the 'complete' verb, so using an
externally throttled node was the best I could come up with for the
test.

Fiona Ebner (3):
  block/mirror: fix assertion failure upon duplicate complete for job
    using 'replaces'
  iotests/041: add test for mirror with throttled NBD export as target
  iotests/041: add test for duplicate job-complete with throttled target

 block/mirror.c             |  28 +++----
 tests/qemu-iotests/041     | 153 ++++++++++++++++++++++++++++++++++++-
 tests/qemu-iotests/041.out |   4 +-
 3 files changed, 169 insertions(+), 16 deletions(-)

-- 
2.47.3



Reply via email to