mirror of https://gitee.com/openkylin/qemu.git
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 <pkrempa@redhat.com> Message-Id: <adc02cf591c3cb34e98e33518eb1c540a0f27db1.1582893284.git.pkrempa@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
eeea1faa09
commit
17e1e2be5f
9
block.c
9
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:
|
cleanup:
|
||||||
QTAILQ_FOREACH_SAFE(bs_entry, bs_queue, entry, next) {
|
QTAILQ_FOREACH_SAFE(bs_entry, bs_queue, entry, next) {
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
|
@ -122,6 +122,7 @@ struct BlockDriver {
|
||||||
int (*bdrv_reopen_prepare)(BDRVReopenState *reopen_state,
|
int (*bdrv_reopen_prepare)(BDRVReopenState *reopen_state,
|
||||||
BlockReopenQueue *queue, Error **errp);
|
BlockReopenQueue *queue, Error **errp);
|
||||||
void (*bdrv_reopen_commit)(BDRVReopenState *reopen_state);
|
void (*bdrv_reopen_commit)(BDRVReopenState *reopen_state);
|
||||||
|
void (*bdrv_reopen_commit_post)(BDRVReopenState *reopen_state);
|
||||||
void (*bdrv_reopen_abort)(BDRVReopenState *reopen_state);
|
void (*bdrv_reopen_abort)(BDRVReopenState *reopen_state);
|
||||||
void (*bdrv_join_options)(QDict *options, QDict *old_options);
|
void (*bdrv_join_options)(QDict *options, QDict *old_options);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue