]> Git Repo - qemu.git/commit
block: use safe iteration over AioContext notifiers
authorStefan Hajnoczi <[email protected]>
Thu, 16 Jun 2016 16:56:26 +0000 (17:56 +0100)
committerStefan Hajnoczi <[email protected]>
Mon, 20 Jun 2016 13:25:41 +0000 (14:25 +0100)
commite8a095dadb70e2ea6d5169d261920db3747bfa45
tree3139d49c4ca3affbbd21565720366070c8f095a5
parent9f6bc648c40da61a50ea1f51048368faeea5d9a1
block: use safe iteration over AioContext notifiers

It's possible that an AioContext notifier user was close to finishing
when .detach_aio_context() or .attached_aio_context() is called.  In
that case they may call bdrv_remove_aio_context_notifier() during the
callback.

Use safe iteration to avoid crashing when the notifier list is modified
during iteration.  We must not only handle the case where the current
aio notifier is removed during a callback but also the one where any
other aio notifier is removed.

The next patch adds an AioContext notifier for block jobs and they
really could be terminating just as .detach_aio_context() is invoked.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Message-id: 1466096189[email protected]
block.c
include/block/block_int.h
This page took 0.026067 seconds and 4 git commands to generate.