diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2017-06-28 15:05:20 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2017-07-11 17:44:58 +0200 |
commit | 169b87935966791a860f59a2b17c4e0c7b953779 (patch) | |
tree | 2c76d00277ffe3d6b651737e7113b9530f117a9f /block/qcow2.c | |
parent | 5f72826e7fc62167cf3a37383d1c1151bc9971fe (diff) | |
download | qemu-169b87935966791a860f59a2b17c4e0c7b953779.zip qemu-169b87935966791a860f59a2b17c4e0c7b953779.tar.gz qemu-169b87935966791a860f59a2b17c4e0c7b953779.tar.bz2 |
qcow2: store bitmaps on reopening image as read-only
Store bitmaps and mark them read-only on reopening image as read-only.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170628120530.31251-21-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 790b5b1..1a31f1d 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1555,6 +1555,11 @@ static int qcow2_reopen_prepare(BDRVReopenState *state, /* We need to write out any unwritten data if we reopen read-only. */ if ((state->flags & BDRV_O_RDWR) == 0) { + ret = qcow2_reopen_bitmaps_ro(state->bs, errp); + if (ret < 0) { + goto fail; + } + ret = bdrv_flush(state->bs); if (ret < 0) { goto fail; |