block: Move recursion to bdrv_set_aio_context()
commit0d83708a1d2effc5d905cd1d61d0ef47d310ad88
authorKevin Wolf <kwolf@redhat.com>
Mon, 6 May 2019 17:17:58 +0000 (6 19:17 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 20 May 2019 15:08:56 +0000 (20 17:08 +0200)
tree4e3fed82df9f6faef3299634475dede40c6f40ea
parenta3a683c33d38fb29c7a78903e88dda12b84cc88d
block: Move recursion to bdrv_set_aio_context()

Instead of having two recursions, in bdrv_attach_aio_context() and in
bdrv_detach_aio_context(), just having one recursion is enough. Said
functions are only about a single node now.

It is important that the recursion doesn't happen between detaching and
attaching a context to the current node because the nested call will
drain the node, and draining with a NULL context would segfault.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c