[pve-devel] [PATCH storage/qemu-server v2 0/5] avoid absolute qcow2 references
Fabian Grünbichler
f.gruenbichler at proxmox.com
Tue Jul 29 13:53:15 CEST 2025
we don't want qcow2 files to reference their backing chains via
absolute paths, as that makes renaming the base dir or VG of the storage
impossible. in most places, qemu already allows simply passing a
filename as backing-file reference, which will be interpreted as a
reference relative to the backed image.
I haven't found any further code paths that trigger absolute references,
but I might have missed some. the full backing chain should show
relative backing-file members when queried via
qemu-img info --output json --format qcow2 --backing-chain /path/to/main/image.qcow2
such, as:
"full-backing-filename": "/var/lib/extsnap/images/210/snap-test2-vm-210-disk-0.qcow2",
"backing-filename": "snap-test2-vm-210-disk-0.qcow2",
note that full-backing-filename will always contain the resolved,
absolute path and that is okay. we could warn about both members
containing full paths in `volume_snapshot_info`.
for existing "broken" images, an "unsafe" rebase with
qemu-img rebase -u -f qcow2 -F qcow2 -b <relative backing file path> <absolute backed filed path>
should just rewrite the qcow2 header to replace the backing file
reference - this should of course not be run while the image is being
written by other process or QEMU.
v2: incorporated Fiona's feedback, thanks!
pve-storage:
Fabian Grünbichler (4):
plugin: fix typo in rebase log message
lvm plugin: fix typo in rebase log message
plugin: use relative path for qcow2 rebase command
lvm plugin: use relative path for qcow2 rebase command
src/PVE/Storage/LVMPlugin.pm | 6 +++---
src/PVE/Storage/Plugin.pm | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
qemu-server:
Fabian Grünbichler (1):
blockdev-stream/-commit: make backing file relative
src/PVE/QemuServer/Blockdev.pm | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
--
2.39.5
More information about the pve-devel
mailing list