[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=0.10 |
Date: |
Tue, 23 Jan 2018 15:01:44 +0100 |
From: Max Reitz <address@hidden>
Persistent dirty bitmaps require a properly functioning
autoclear_features field, or we cannot track when an unsupporting
program might overwrite them. Therefore, we cannot support them for
compat=0.10 images.
Signed-off-by: Max Reitz <address@hidden>
Message-id: address@hidden
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
---
block/qcow2-bitmap.c | 10 ++++++++++
block/qcow2.c | 14 +++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index f45e46cfbd..efa10c6663 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1449,6 +1449,16 @@ bool qcow2_can_store_new_dirty_bitmap(BlockDriverState
*bs,
bool found;
Qcow2BitmapList *bm_list;
+ if (s->qcow_version < 3) {
+ /* Without autoclear_features, we would always have to assume
+ * that a program without persistent dirty bitmap support has
+ * accessed this qcow2 file when opening it, and would thus
+ * have to drop all dirty bitmaps (defeating their purpose).
+ */
+ error_setg(errp, "Cannot store dirty bitmaps in qcow2 v2 files");
+ goto fail;
+ }
+
if (check_constraints_on_bitmap(bs, name, granularity, errp) != 0) {
goto fail;
}
diff --git a/block/qcow2.c b/block/qcow2.c
index 4348b2c0c5..1f80961e1b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -302,9 +302,17 @@ static int qcow2_read_extensions(BlockDriverState *bs,
uint64_t start_offset,
}
if (!(s->autoclear_features & QCOW2_AUTOCLEAR_BITMAPS)) {
- warn_report("a program lacking bitmap support "
- "modified this file, so all bitmaps are now "
- "considered inconsistent");
+ if (s->qcow_version < 3) {
+ /* Let's be a bit more specific */
+ warn_report("This qcow2 v2 image contains bitmaps, but "
+ "they may have been modified by a program "
+ "without persistent bitmap support; so now "
+ "they must all be considered inconsistent");
+ } else {
+ warn_report("a program lacking bitmap support "
+ "modified this file, so all bitmaps are now "
+ "considered inconsistent");
+ }
error_printf("Some clusters may be leaked, "
"run 'qemu-img check -r' on the image "
"file to fix.");
--
2.13.6
- [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id, (continued)
- [Qemu-devel] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 07/29] tests/ahci: Switch tray and medium commands to @id, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 16/29] iotests: Drop format-specific in _filter_img_info, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 10/29] qemu-iotests: Fix locking issue in 102, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 13/29] block/qcow: Add blkdebug events, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 11/29] block/vmdk: Fix , instead of ; at end of line, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 14/29] block/vmdk: Add blkdebug events, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 15/29] iotests: Fix _img_info for backslashes, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 09/29] blockdev: Mark BD-{remove, insert}-medium stable, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 20/29] iotests: Fix 051 for compat=0.10, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=0.10,
Kevin Wolf <=
- [Qemu-devel] [PULL 19/29] iotests: Fix 020 for vmdk, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 21/29] iotests: Fix 059's reference output, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 24/29] iotests: Make 184 image-less, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 18/29] iotests: Skip 103 for refcount_bits=1, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 17/29] iotests: Forbid 020 for non-file protocols, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 26/29] iotests: Filter compat-dependent info in 198, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 23/29] iotests: Make 089 compatible with compat=0.10, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 22/29] iotests: Fix 067 for compat=0.10, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 29/29] iotests: Disable some tests for compat=0.10, Kevin Wolf, 2018/01/23
- [Qemu-devel] [PULL 27/29] iotests: Make 059 pass on machines with little RAM, Kevin Wolf, 2018/01/23