1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 Date: Mon, 14 Sep 2020 19:32:21 +0200
4 Subject: [PATCH] Revert "qemu-img convert: Don't pre-zero images"
6 This reverts commit edafc70c0c8510862f2f213a3acf7067113bcd08.
8 As it correlates with causing issues on LVM allocation
9 https://bugzilla.proxmox.com/show_bug.cgi?id=3002
11 qemu-img.c | 9 +++++++++
12 1 file changed, 9 insertions(+)
14 diff --git a/qemu-img.c b/qemu-img.c
15 index 9635e9c001..c7884d248a 100644
18 @@ -2079,6 +2079,15 @@ static int convert_do_copy(ImgConvertState *s)
19 s->has_zero_init = bdrv_has_zero_init(blk_bs(s->target));
22 + if (!s->has_zero_init && !s->target_has_backing &&
23 + bdrv_can_write_zeroes_with_unmap(blk_bs(s->target)))
25 + ret = blk_make_zero(s->target, BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK);
27 + s->has_zero_init = true;
31 /* Allocate buffer for copied data. For compressed images, only one cluster
32 * can be copied at a time. */