From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 942EE1FF0ED for ; Fri, 31 Jul 2026 12:21:53 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 680EF21472; Fri, 31 Jul 2026 12:21:53 +0200 (CEST) Message-ID: Date: Fri, 31 Jul 2026 12:21:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH storage 1/2] add subroutine to classify volume ids From: Fiona Ebner To: Thomas Ellmenreich , pve-devel@lists.proxmox.com References: <20260728122218.202963-1-t.ellmenreich@proxmox.com> <20260728122218.202963-2-t.ellmenreich@proxmox.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785493300474 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.153 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust 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: 3MW4PJREODWHNLKUDAM3AVROJH75NJHB X-Message-ID-Hash: 3MW4PJREODWHNLKUDAM3AVROJH75NJHB X-MailFrom: f.ebner@proxmox.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: Am 31.07.26 um 12:13 PM schrieb Fiona Ebner: > Am 28.07.26 um 2:22 PM schrieb Thomas Ellmenreich: >> +sub classify_volume_id { > > As already resulted from the other discussion, the current > implementation is rather for a classify_drive() helper. Technically, an Or rather classify_drive_file() since it does not look at the whole drive. > absolute path is not a valid volume ID. Our storage layer just sometimes > does not cleanly separate them. > >> + my ($volid, $noerr) = @_; >> + >> + if (!defined($volid) || $volid eq "none") { > > I think we should die for undef and make sure that we always do have an > explicit value when calling this function. It's not the same for the > pve-volume-id-or-qm-path format. The result from parse_drive() will > always have a value and otherwise something went wrong and most likely > points to another issue that should be resolved. > >> + return VOL_NONE; >> + } elsif ($volid eq 'cdrom') { >> + return VOL_CDROM; >> + } elsif ($volid =~ m|^/|) { >> + return VOL_ABSOLUTE; >> + } elsif (parse_volume_id($volid, 1)) { >> + return VOL_VOLUME; >> + } >> + >> + return undef if $noerr; >> + die "unable to classify volume ID '$volid'"; >> +} >> + >> PVE::JSONSchema::register_format('pve-dir-override', \&verify_dir_override); >> >> sub verify_dir_override { > > > > >