From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id C51081FF187 for ; Mon, 11 Aug 2025 15:50:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6617A370C3; Mon, 11 Aug 2025 15:52:00 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Mon, 11 Aug 2025 15:51:33 +0200 Message-ID: <20250811135154.253817-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1754920288770 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH qemu-server] print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Require that snapshot-as-volume-chain qcow2 images are always used in combination with '-blockdev', rather than '-drive'. With '-drive', the 'discard-no-unref' option is not set and the fragmentation can lead to the same issue that for '-blockdev', was solved by commit a3a9a2ab ("fix #6543: use qcow2 'discard-no-unref' option when using snapshot-as-volume-chain"). While it would be possible to set the flag for '-drive' too, the snapshot-as-volume-chain feature already only works with machine type >= 10.0, see commit 6b2b45fd ("snapshot create/delete: die early for snapshot-as-volume-chain for pre-10.0 machine version") and it's only tested for those. Avoid accidents and other unknown issues by being strict and prohibiting usage without '-blockdev'. Reported-by: Friedrich Weber Signed-off-by: Fiona Ebner --- src/PVE/QemuServer.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index e30b27cb..cfc54568 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -1335,6 +1335,13 @@ sub print_drive_commandline_full { my ($path, $format) = PVE::QemuServer::Drive::get_path_and_format($storecfg, $drive, $live_restore_name); + if ($scfg && $scfg->{'snapshot-as-volume-chain'} && $format && $format eq 'qcow2') { + # the print_drive_commandline_full() function is only used if machine version is < 10.0 + die "storage for '$drive->{file}' is configured for snapshots as a volume chain - this" + . " requires QEMU machine version >= 10.0. See" + . " https://pve.proxmox.com/wiki/QEMU_Machine_Version_Upgrade\n"; + } + my $is_rbd = $path =~ m/^rbd:/; my $opts = ''; -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel