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 606AF1FF183 for ; Wed, 30 Jul 2025 10:40:06 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4B27E3699B; Wed, 30 Jul 2025 10:41:30 +0200 (CEST) Date: Wed, 30 Jul 2025 10:40:53 +0200 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20250729111557.136012-1-w.bumiller@proxmox.com> <20250729111557.136012-34-w.bumiller@proxmox.com> In-Reply-To: <20250729111557.136012-34-w.bumiller@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1753864824.62ggi5ugzf.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753864845601 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.046 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [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" On July 29, 2025 1:15 pm, Wolfgang Bumiller wrote: > 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}; should this use the helper in pve-storage? > } > } > > 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}; this as well? > > return 1; > } > -- > 2.47.2 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel