[pve-devel] [PATCH qemu] save_snapshot_cleanup: make alignment to 1024 explicit

Fabian Ebner f.ebner at proxmox.com
Wed Mar 11 10:33:34 CET 2020


Follow-up for the already implemented change and removes the outdated
patch message. Like this we don't need to rely on BDRV_SECTOR_SIZE being 512.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

@Thomas regarding the off-list discussion about the blk_truncate call:
I hadn't updated the qemu submodule yet, the 'false' is not too much.
Sorry for the confusion.

 debian/patches/pve/0017-PVE-internal-snapshot-async.patch | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/debian/patches/pve/0017-PVE-internal-snapshot-async.patch b/debian/patches/pve/0017-PVE-internal-snapshot-async.patch
index 15918dc..2b1f5de 100644
--- a/debian/patches/pve/0017-PVE-internal-snapshot-async.patch
+++ b/debian/patches/pve/0017-PVE-internal-snapshot-async.patch
@@ -3,8 +3,6 @@ From: Dietmar Maurer <dietmar at proxmox.com>
 Date: Tue, 10 Mar 2020 13:49:27 +0100
 Subject: [PATCH 17/32] PVE: internal snapshot async
 
-Truncate at 1024 boundary (Fabian Ebner will send a patch for stable)
-
 Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
 Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
 ---
@@ -428,9 +426,9 @@ index 0000000000..54ceeae26c
 +    if (snap_state.target) {
 +        /* try to truncate, but ignore errors (will fail on block devices).
 +         * note1: bdrv_read() need whole blocks, so we need to round up
-+         * note2: PVE requires 1024 (BDRV_SECTOR_SIZE*2) alignment
++         * note2: PVE requires 1024 byte alignment
 +         */
-+        size_t size = QEMU_ALIGN_UP(snap_state.bs_pos, BDRV_SECTOR_SIZE*2);
++        size_t size = QEMU_ALIGN_UP(snap_state.bs_pos, MAX(BDRV_SECTOR_SIZE, 1024));
 +        blk_truncate(snap_state.target, size, false, PREALLOC_MODE_OFF, NULL);
 +        blk_op_unblock_all(snap_state.target, snap_state.blocker);
 +        error_free(snap_state.blocker);
-- 
2.20.1





More information about the pve-devel mailing list