From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id D0DB81FF0A8 for ; Sat, 03 Oct 2026 14:15:25 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 70FBA216A3; Sat, 03 Oct 2026 14:15:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dualfroz.com; s=dkim; t=1791029715; h=from:subject:date:message-id:to:mime-version: content-transfer-encoding; bh=LIuDsIqgiI4jHBa829HCn6OCxq52tBVb+b7TVAVEy50=; b=D0JE6mCvdPkVgW+NSOS85aofQnC7bY4Ms/uFV9+Gq01cPFF0k2gJWQ4SdaX68C9GtN38Go Fy6o6zN9UWw6RDUWtuTx8ZkHUedvqTw0YksNQsvBo33Q3SpVXsJi0u+28by79bZm4KEaLw skySZPENZjBbex+hPS1Xfz4yLFslXJuRDDSa94CrHvofiyMeTXjvr/2Dlqf6fDsL04TN2K 8ryW7H3vFbMr0Lu1FO0yL9ujaDv6aaj24NbvvCq3hxiXWZ/WW6Ro8OyY+F3NnR/FC84enY GM3WEJcMs/iNCUac2+hfcU9EVXJXERzyr+aS//aEMaEKGe/Fy74v3PxnL6+0Kg== From: Michal Fox To: pve-devel@lists.proxmox.com Subject: [PATCH storage] fix #6441: btrfs: fix cloning templates with non-raw disk images Date: Sat, 3 Oct 2026 12:15:13 +0000 Message-ID: <20261003121513.7-1-me@dualfroz.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.303 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: D2CXTTKBDN56X7WQBURNESF6EAAB74J5 X-Message-ID-Hash: D2CXTTKBDN56X7WQBURNESF6EAAB74J5 X-MailFrom: me@dualfroz.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- Tested by calling clone_image of the BTRFS plugin for a qcow2 base image on a test storage: before, it failed with the error from the bug report, now it creates the linked clone. The raw and subvol code paths are not touched. 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'); -- 2.43.0