From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 7AB2A1FF16B for ; Tue, 29 Jul 2025 13:23:49 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0F54CF958; Tue, 29 Jul 2025 13:25:08 +0200 (CEST) From: Wolfgang Bumiller To: pve-devel@lists.proxmox.com Date: Tue, 29 Jul 2025 13:15:46 +0200 Message-ID: <20250729111557.136012-34-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250729111557.136012-1-w.bumiller@proxmox.com> References: <20250729111557.136012-1-w.bumiller@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753787751056 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.075 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [qemuserver.pm, qemumigrate.pm, qemu.pm] Subject: [pve-devel] [PATCH qemu-server 04/10] expect 'vm-vol' vtype wherever 'images' was expected 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" Signed-off-by: Wolfgang Bumiller --- src/PVE/API2/Qemu.pm | 16 +++++++++------- src/PVE/QemuMigrate.pm | 3 ++- src/PVE/QemuServer.pm | 6 ++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/PVE/API2/Qemu.pm b/src/PVE/API2/Qemu.pm index 76883a5b..deb2eae8 100644 --- a/src/PVE/API2/Qemu.pm +++ b/src/PVE/API2/Qemu.pm @@ -191,8 +191,9 @@ my $check_storage_access = sub { PVE::Storage::check_volume_access($rpcenv, $authuser, $storecfg, $vmid, $volid); if ($storeid) { my ($vtype) = PVE::Storage::parse_volname($storecfg, $volid); - raise_param_exc({ $ds => "content type needs to be 'images' or 'iso'" }) - if $vtype ne 'images' && $vtype ne 'iso'; + raise_param_exc( + { $ds => "content type needs to be 'vm-vol', 'images' or 'iso'" }) + if $vtype ne 'vm-vol' && $vtype ne 'images' && $vtype ne 'iso'; } } @@ -206,10 +207,10 @@ my $check_storage_access = sub { raise_param_exc( { - $ds => - "$src_image has wrong type '$vtype' - needs to be 'images' or 'import'", + $ds => "$src_image has wrong type '$vtype'" + . " - needs to be 'vm-vol', 'images' or 'import'", }, - ) if $vtype ne 'images' && $vtype ne 'import'; + ) if $vtype ne 'vm-vol' && $vtype ne 'images' && $vtype ne 'import'; if (PVE::QemuServer::Helpers::needs_extraction($vtype, $fmt)) { my $extraction_scfg = @@ -658,8 +659,9 @@ my sub create_disks : prototype($$$$$$$$$$$) { if ($storeid) { my ($vtype, $volume_format) = (checked_parse_volname($storecfg, $volid))[0, 6]; - die "cannot use volume $volid - content type needs to be 'images' or 'iso'" - if $vtype ne 'images' && $vtype ne 'iso'; + die "cannot use volume $volid" + . " - content type needs to be 'vm-vol', 'images' or 'iso'" + if $vtype ne 'vm-vol' && $vtype ne 'images' && $vtype ne 'iso'; # TODO PVE 9 - consider disallowing setting an explicit format for managed volumes. if ($disk->{format} && $disk->{format} ne $volume_format) { diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm index 9585e292..bdb1fce3 100644 --- a/src/PVE/QemuMigrate.pm +++ b/src/PVE/QemuMigrate.pm @@ -168,8 +168,9 @@ sub target_storage_check_available { $storecfg, $targetsid, $self->{node}, ); my ($vtype) = PVE::Storage::parse_volname($storecfg, $volid); + my $ctype = $vtype eq 'vm-vol' ? 'images' : $vtype; die "$volid: content type '$vtype' is not available on storage '$targetsid'\n" - if !$target_scfg->{content}->{$vtype}; + if !$target_scfg->{content}->{$ctype}; } } diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm index d004dd55..05a3be91 100644 --- a/src/PVE/QemuServer.pm +++ b/src/PVE/QemuServer.pm @@ -8241,8 +8241,10 @@ sub check_volume_storage_type { my $scfg = PVE::Storage::storage_config($storecfg, $storeid); my ($vtype) = PVE::Storage::parse_volname($storecfg, $vol); - die "storage '$storeid' does not support content-type '$vtype'\n" - if !$scfg->{content}->{$vtype}; + my $ctype = $vtype eq 'vm-vol' ? 'images' : $vtype; + + die "storage '$storeid' does not support content-type '$ctype'\n" + if !$scfg->{content}->{$ctype}; return 1; } -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel