summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorKevin Wolf2017-05-04 18:52:37 +0200
committerKevin Wolf2017-05-11 12:08:24 +0200
commit4417ab7adf1613799054be5afedf810fc2524ee8 (patch)
tree07b0be1c2077c7eecddab8e36fe4af21140b43d7 /include/block
parentmigration: Unify block node activation error handling (diff)
downloadqemu-4417ab7adf1613799054be5afedf810fc2524ee8.tar.gz
qemu-4417ab7adf1613799054be5afedf810fc2524ee8.tar.xz
qemu-4417ab7adf1613799054be5afedf810fc2524ee8.zip
block: New BdrvChildRole.activate() for blk_resume_after_migration()
Instead of manually calling blk_resume_after_migration() in migration code after doing bdrv_invalidate_cache_all(), integrate the BlockBackend activation with cache invalidation into a single function. This is achieved with a new callback in BdrvChildRole that is called by bdrv_invalidate_cache_all(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block.h2
-rw-r--r--include/block/block_int.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 877fbb0d9a..80d51d8f12 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -369,8 +369,6 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp);
void bdrv_invalidate_cache_all(Error **errp);
int bdrv_inactivate_all(void);
-void blk_resume_after_migration(Error **errp);
-
/* Ensure contents are flushed to disk. */
int bdrv_flush(BlockDriverState *bs);
int coroutine_fn bdrv_co_flush(BlockDriverState *bs);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 1b4d08e8df..563792580c 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -473,6 +473,11 @@ struct BdrvChildRole {
void (*drained_begin)(BdrvChild *child);
void (*drained_end)(BdrvChild *child);
+ /* Notifies the parent that the child has been activated (e.g. when
+ * migration is completing) and it can start requesting permissions and
+ * doing I/O on it. */
+ void (*activate)(BdrvChild *child, Error **errp);
+
void (*attach)(BdrvChild *child);
void (*detach)(BdrvChild *child);
};