From 444b82369b9f4f487538f2cb23647862c48aca1c Mon Sep 17 00:00:00 2001 From: Andrey Shinkevich Date: Thu, 28 Feb 2019 12:26:59 +0300 Subject: [PATCH] qcow2: discard bitmap when removed Bitmap data may take a lot of disk space, so it's better to discard it always. Signed-off-by: Andrey Shinkevich Message-id: 1551346019-293202-1-git-send-email-andrey.shinkevich@virtuozzo.com Reviewed-by: Vladimir Sementsov-Ogievskiy [mreitz: Use the commit message proposed by Vladimir] Signed-off-by: Max Reitz --- block/qcow2-bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index e53a1609d7..8a75366c92 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -202,7 +202,7 @@ static void clear_bitmap_table(BlockDriverState *bs, uint64_t *bitmap_table, continue; } - qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_OTHER); + qcow2_free_clusters(bs, addr, s->cluster_size, QCOW2_DISCARD_ALWAYS); bitmap_table[i] = 0; } }