From dc7402d9ffd9c1eb08d4ef50514b9ea92e17d437 Mon Sep 17 00:00:00 2001 From: Michal Fox Date: Fri, 2 Oct 2026 16:30:32 +0200 Subject: [PATCH] fix #6441: btrfs: fix cloning templates with non-raw disk images Cloning a template with a disk image that is neither raw nor a subvolume, for example a qcow2 image, failed on a BTRFS storage with: clone failed: Undefined subroutine &PVE::Storage::DirPlugin::clone_image called For such images, the BTRFS plugin forwards the call to the DirPlugin. But the DirPlugin does not implement clone_image itself, it inherits it from the base plugin, and calling it as a plain function does not go through the inheritance. Call the implementation of the base plugin directly instead, like it is already done for create_base. Fixes: af50c2e ("add BTRFS storage plugin") Signed-off-by: Michal Fox --- src/PVE/Storage/BTRFSPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/Storage/BTRFSPlugin.pm b/src/PVE/Storage/BTRFSPlugin.pm index fb47aa0..99aa811 100644 --- a/src/PVE/Storage/BTRFSPlugin.pm +++ b/src/PVE/Storage/BTRFSPlugin.pm @@ -291,7 +291,7 @@ sub clone_image { # If we're not working with a 'raw' file, which is the only thing that's "different" for btrfs, # or a subvolume, we forward to the DirPlugin if ($format ne 'raw' && $format ne 'subvol') { - return PVE::Storage::DirPlugin::clone_image(@_); + return PVE::Storage::Plugin::clone_image(@_); } my $imagedir = $class->get_subdir($scfg, 'images');