]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/extra/0001-Revert-qemu-img-convert-Don-t-pre-zero-images.patch
bump version to 5.2.0-11
[pve-qemu.git] / debian / patches / extra / 0001-Revert-qemu-img-convert-Don-t-pre-zero-images.patch
CommitLineData
7895b0d5
TL
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3Date: Mon, 14 Sep 2020 19:32:21 +0200
4Subject: [PATCH] Revert "qemu-img convert: Don't pre-zero images"
5
6This reverts commit edafc70c0c8510862f2f213a3acf7067113bcd08.
7
8As it correlates with causing issues on LVM allocation
9https://bugzilla.proxmox.com/show_bug.cgi?id=3002
10---
11 qemu-img.c | 9 +++++++++
12 1 file changed, 9 insertions(+)
13
14diff --git a/qemu-img.c b/qemu-img.c
817b7667 15index 8bdea40b58..f9050bfaad 100644
7895b0d5
TL
16--- a/qemu-img.c
17+++ b/qemu-img.c
817b7667 18@@ -2104,6 +2104,15 @@ static int convert_do_copy(ImgConvertState *s)
7895b0d5
TL
19 s->has_zero_init = bdrv_has_zero_init(blk_bs(s->target));
20 }
21
22+ if (!s->has_zero_init && !s->target_has_backing &&
23+ bdrv_can_write_zeroes_with_unmap(blk_bs(s->target)))
24+ {
25+ ret = blk_make_zero(s->target, BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK);
26+ if (ret == 0) {
27+ s->has_zero_init = true;
28+ }
29+ }
30+
31 /* Allocate buffer for copied data. For compressed images, only one cluster
32 * can be copied at a time. */
33 if (s->compressed) {