test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level()
commitecc1a5c790cf2c7732cb9755ca388c2fe108d1a1
authorKevin Wolf <kwolf@redhat.com>
Thu, 6 Sep 2018 10:28:10 +0000 (6 12:28 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 25 Sep 2018 13:50:15 +0000 (25 15:50 +0200)
treeb50f1d3ced7378edc117f8414df6c8abf18675bd
parent4cf077b59fc73eec29f8b7d082919dbb278bdc86
test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level()

This is a regression test for a deadlock that could occur in callbacks
called from the aio_poll() in bdrv_drain_poll_top_level(). The
AioContext lock wasn't released and therefore would be taken a second
time in the callback. This would cause a possible AIO_WAIT_WHILE() in
the callback to hang.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
tests/test-bdrv-drain.c