block: don't keep AioContext acquired after external_snapshot_prepare()
commit2d24b60b7747f7bf40fd00b0375b6bd988d4f0d9
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 6 Dec 2017 14:45:43 +0000 (6 14:45 +0000)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 19 Dec 2017 10:25:08 +0000 (19 10:25 +0000)
tree3c33713a1daf9ec806943f893cd326d849540022
parentb9464ba19f821ea6b29969104dc48dcdb26243dd
block: don't keep AioContext acquired after external_snapshot_prepare()

It is not necessary to hold AioContext across transactions anymore since
bdrv_drained_begin/end() is used to keep the nodes quiesced.  In fact,
using the AioContext lock for this purpose was always buggy.

This patch reduces the scope of AioContext locked regions.  This is not
just a cleanup but also fixes hangs that occur in BDRV_POLL_WHILE()
because it is unware of recursive locking and does not release the
AioContext the necessary number of times to allow progress to be made.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20171206144550.22295-3-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
blockdev.c