summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/block.c b/block.c
index d3aebeb050..27533f3a81 100644
--- a/block.c
+++ b/block.c
@@ -5043,6 +5043,11 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)
return;
}
+ if (!(bs->open_flags & BDRV_O_INCOMING)) {
+ return;
+ }
+ bs->open_flags &= ~BDRV_O_INCOMING;
+
if (bs->drv->bdrv_invalidate_cache) {
bs->drv->bdrv_invalidate_cache(bs, &local_err);
} else if (bs->file) {
@@ -5078,19 +5083,6 @@ void bdrv_invalidate_cache_all(Error **errp)
}
}
-void bdrv_clear_incoming_migration_all(void)
-{
- BlockDriverState *bs;
-
- QTAILQ_FOREACH(bs, &bdrv_states, device_list) {
- AioContext *aio_context = bdrv_get_aio_context(bs);
-
- aio_context_acquire(aio_context);
- bs->open_flags = bs->open_flags & ~(BDRV_O_INCOMING);
- aio_context_release(aio_context);
- }
-}
-
int bdrv_flush(BlockDriverState *bs)
{
Coroutine *co;