aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block.c2
-rw-r--r--blockdev.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/block.c b/block.c
index d129e60bf2..51f3187cb7 100644
--- a/block.c
+++ b/block.c
@@ -2249,8 +2249,6 @@ static void bdrv_move_feature_fields(BlockDriverState *bs_dest,
/* move some fields that need to stay attached to the device */
/* dev info */
- bs_dest->copy_on_read = bs_src->copy_on_read;
-
bs_dest->enable_write_cache = bs_src->enable_write_cache;
/* dirty bitmap */
diff --git a/blockdev.c b/blockdev.c
index efb1107e80..91a21eb0b8 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1743,6 +1743,7 @@ static void external_snapshot_prepare(BlkActionState *common,
}
flags = state->old_bs->open_flags;
+ flags &= ~(BDRV_O_SNAPSHOT | BDRV_O_NO_BACKING | BDRV_O_COPY_ON_READ);
/* create new image w/backing file */
mode = s->has_mode ? s->mode : NEW_IMAGE_MODE_ABSOLUTE_PATHS;
@@ -1813,8 +1814,10 @@ static void external_snapshot_commit(BlkActionState *common)
/* We don't need (or want) to use the transactional
* bdrv_reopen_multiple() across all the entries at once, because we
* don't want to abort all of them if one of them fails the reopen */
- bdrv_reopen(state->old_bs, state->old_bs->open_flags & ~BDRV_O_RDWR,
- NULL);
+ if (!state->old_bs->copy_on_read) {
+ bdrv_reopen(state->old_bs, state->old_bs->open_flags & ~BDRV_O_RDWR,
+ NULL);
+ }
}
static void external_snapshot_abort(BlkActionState *common)