]> git.proxmox.com Git - pve-qemu.git/commitdiff
work around #3002: revert "qemu-img convert: Don't pre-zero images"
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 14 Sep 2020 17:37:45 +0000 (19:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 14 Sep 2020 17:37:45 +0000 (19:37 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
debian/patches/extra/0002-Revert-qemu-img-convert-Don-t-pre-zero-images.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/extra/0002-Revert-qemu-img-convert-Don-t-pre-zero-images.patch b/debian/patches/extra/0002-Revert-qemu-img-convert-Don-t-pre-zero-images.patch
new file mode 100644 (file)
index 0000000..604feb3
--- /dev/null
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Thomas Lamprecht <t.lamprecht@proxmox.com>
+Date: Mon, 14 Sep 2020 19:32:21 +0200
+Subject: [PATCH] Revert "qemu-img convert: Don't pre-zero images"
+
+This reverts commit edafc70c0c8510862f2f213a3acf7067113bcd08.
+
+As it correlates with causing issues on LVM allocation
+https://bugzilla.proxmox.com/show_bug.cgi?id=3002
+---
+ qemu-img.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/qemu-img.c b/qemu-img.c
+index 9635e9c001..c7884d248a 100644
+--- a/qemu-img.c
++++ b/qemu-img.c
+@@ -2079,6 +2079,15 @@ static int convert_do_copy(ImgConvertState *s)
+         s->has_zero_init = bdrv_has_zero_init(blk_bs(s->target));
+     }
++    if (!s->has_zero_init && !s->target_has_backing &&
++        bdrv_can_write_zeroes_with_unmap(blk_bs(s->target)))
++    {
++        ret = blk_make_zero(s->target, BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK);
++        if (ret == 0) {
++            s->has_zero_init = true;
++        }
++    }
++
+     /* Allocate buffer for copied data. For compressed images, only one cluster
+      * can be copied at a time. */
+     if (s->compressed) {
index 0a9c5c95848118899dbe01ad7477e7b789a82ab8..d15b4598430ce27e1f929213c79be80d855728e2 100644 (file)
@@ -1,4 +1,5 @@
 extra/0001-block-block-copy-always-align-copied-region-to-clust.patch
+extra/0002-Revert-qemu-img-convert-Don-t-pre-zero-images.patch
 pve/0001-PVE-Config-block-file-change-locking-default-to-off.patch
 pve/0002-PVE-Config-Adjust-network-script-path-to-etc-kvm.patch
 pve/0003-PVE-Config-set-the-CPU-model-to-kvm64-32-instead-of-.patch