[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/29] block: Introduce 'bdrv_reopen_commit_post' step
From: |
Kevin Wolf |
Subject: |
[PULL 05/29] block: Introduce 'bdrv_reopen_commit_post' step |
Date: |
Fri, 6 Mar 2020 18:14:34 +0100 |
From: Peter Krempa <address@hidden>
Add another step in the reopen process where driver can execute code
after permission changes are comitted.
Signed-off-by: Peter Krempa <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
include/block/block_int.h | 1 +
block.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 6f9fd5e20e..f422c0bff0 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -122,6 +122,7 @@ struct BlockDriver {
int (*bdrv_reopen_prepare)(BDRVReopenState *reopen_state,
BlockReopenQueue *queue, Error **errp);
void (*bdrv_reopen_commit)(BDRVReopenState *reopen_state);
+ void (*bdrv_reopen_commit_post)(BDRVReopenState *reopen_state);
void (*bdrv_reopen_abort)(BDRVReopenState *reopen_state);
void (*bdrv_join_options)(QDict *options, QDict *old_options);
diff --git a/block.c b/block.c
index 876bd45182..aaa387504e 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) {
--
2.20.1
- [PULL 00/29] Block layer patches, Kevin Wolf, 2020/03/06
- [PULL 01/29] qcow2: Fix alloc_cluster_abort() for pre-existing clusters, Kevin Wolf, 2020/03/06
- [PULL 03/29] iotests/026: Test EIO on allocation in a data-file, Kevin Wolf, 2020/03/06
- [PULL 02/29] iotests/026: Test EIO on preallocated zero cluster, Kevin Wolf, 2020/03/06
- [PULL 05/29] block: Introduce 'bdrv_reopen_commit_post' step,
Kevin Wolf <=
- [PULL 08/29] stubs: Add arch_type, Kevin Wolf, 2020/03/06
- [PULL 04/29] block: Fix leak in bdrv_create_file_fallback(), Kevin Wolf, 2020/03/06
- [PULL 07/29] qemu-storage-daemon: Add barebone tool, Kevin Wolf, 2020/03/06
- [PULL 15/29] qemu-storage-daemon: Add --nbd-server option, Kevin Wolf, 2020/03/06
- [PULL 13/29] qapi: Flatten object-add, Kevin Wolf, 2020/03/06
- [PULL 14/29] qemu-storage-daemon: Add --object option, Kevin Wolf, 2020/03/06
- [PULL 06/29] block/qcow2: Move bitmap reopen into bdrv_reopen_commit_post, Kevin Wolf, 2020/03/06
- [PULL 10/29] block: Move common QMP commands to block-core QAPI module, Kevin Wolf, 2020/03/06
- [PULL 18/29] qemu-storage-daemon: Add main loop, Kevin Wolf, 2020/03/06
- [PULL 17/29] qemu-storage-daemon: Add --export option, Kevin Wolf, 2020/03/06