From 17e1e2be5f9e84e0298e28e70675655b43e225ea Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 28 Feb 2020 13:44:46 +0100 Subject: block: Introduce 'bdrv_reopen_commit_post' step Add another step in the reopen process where driver can execute code after permission changes are comitted. Signed-off-by: Peter Krempa Message-Id: Signed-off-by: Kevin Wolf --- block.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'block.c') diff --git a/block.c b/block.c index 876bd45..aaa3875 100644 --- a/block.c +++ b/block.c @@ -3695,6 +3695,15 @@ cleanup_perm: } } } + + if (ret == 0) { + QTAILQ_FOREACH_REVERSE(bs_entry, bs_queue, entry) { + BlockDriverState *bs = bs_entry->state.bs; + + if (bs->drv->bdrv_reopen_commit_post) + bs->drv->bdrv_reopen_commit_post(&bs_entry->state); + } + } cleanup: QTAILQ_FOREACH_SAFE(bs_entry, bs_queue, entry, next) { if (ret) { -- cgit v1.1