[pve-devel] [PATCH pve-storage 08/10] qcow2: add external snapshot support

DERUMIER, Alexandre alexandre.derumier at groupe-cyllene.com
Tue Jul 8 12:04:26 CEST 2025


> +my sub alloc_backed_image {
> +    my ($class, $storeid, $scfg, $volname, $backing_snap) = @_;
> +
> +    my $path = $class->path($scfg, $volname, $storeid);
> +    my $backing_path = $class->path($scfg, $volname, $storeid,
> $backing_snap);

>>should we use a relative path here like we do when doing a linked
>>clone? else
>>it basically means that it is no longer possible to move the storage
>>mountpoint,
>>unless I am mistaken?

ah, it doesn't playing fine with snapshots directory, because current
is renamed && moved to snapshot directory, so it's breaking the
relative path.


1) create snap1
qm snapshot 10000 snap1

 /home/store/images/10000/vm-10000-disk-0.qcow2
     ------>./snapshot/snap-snap1-vm-10000-disk-0.qcow2


2) create a snap2:

 a)rename current to snap2

  mv /home/store/images/10000/vm-10000-disk-0.qcow2
/home/store/images/10000/snapshots/snap-snap2-vm-10000-disk-0.qcow2

b) create the new current with snap2 backing

 /usr/bin/qemu-img create -F qcow2 -b ./snapshots/snap-snap2-vm-10000-
disk-0.qcow2 -f qcow2 /home/store/images/10000/vm-10000-disk-0.qcow2

qemu-img: /home/store/images/10000/vm-10000-disk-0.qcow2: Could not
open backing file: Could not open
'/home/store/images/10000/./snapshots/./snapshots/snap-snap1-vm-10000-
disk-0.qcow2': No such file or directory
Could not open backing image.


same with:
qemu-img info ./snapshots/snap-snap2-vm-10000-disk-0.qcow2 --backing-
chain
qemu-img: Could not open './snapshots/./snapshots/snap-snap1-vm-10000-
disk-0.qcow2': Could not open './snapshots/./snapshots/snap-snap1-vm-
10000-disk-0.qcow2': No such file or directory








More information about the pve-devel mailing list