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 2ECEA1FF0E4 for ; Tue, 28 Jul 2026 14:22:59 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A2E0F214EA; Tue, 28 Jul 2026 14:22:48 +0200 (CEST) From: Thomas Ellmenreich To: pve-devel@lists.proxmox.com Subject: [RFC qemu-server/storage 0/2] refactor of volume_id classification Date: Tue, 28 Jul 2026 14:22:16 +0200 Message-ID: <20260728122218.202963-1-t.ellmenreich@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1785241326127 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.091 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: ANFVDWTY7NYGHEUMS4HOHEGRH4ZBVZFM X-Message-ID-Hash: ANFVDWTY7NYGHEUMS4HOHEGRH4ZBVZFM X-MailFrom: t.ellmenreich@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 CC: Thomas Ellmenreich X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Refactor of volume_id classification ==================================== While developing this: [0] patch series, I refactored all the checks for volume id's as absolute paths into their own subroutine. The original series was then dropped in favour of a quicker fix: [1]. This series revives the refactor without the fix and, unlike the original series creates a new classify_volume_id subroutine, as @Fiona Ebener mentioned here: [2]. Overview -------- As previously mentioned, a new classify_volume_id subroutine has been introduced, which can then be used to determine the type of volume id. This type can be one of: > 'none', 'cdrom', 'absolute', 'volume' The subroutine and constants are exported by the pve-storage package and used in the qemu-server package. Open Questions -------------- - The classify subroutine currently throws an error if the volume id does not match any of the patterns (when 'noerr' is not selected). I'm not sure if this is the correct way to implement a classification method, given that all my uses enable the noerr option. That said, the case where an error is thrown should be very unlikely and would point to an error that should be fixed. - I have decided to only use the new function in the QemuServer.qm module, since other uses can then be added incrementally. Does this approach make sense? [0]: https://lore.proxmox.com/pve-devel/20260722095251.89606-1-t.ellmenreich@proxmox.com/T/#t [1]: https://lore.proxmox.com/pve-devel/20260724081611.11254-1-f.ebner@proxmox.com/ [2]: https://lore.proxmox.com/pve-devel/0b4272e1-3634-4fdd-b79f-6b077dd387d5@proxmox.com/ pve-storage: Thomas Ellmenreich (1): add subroutine to classify volume ids src/PVE/Storage.pm | 21 +++++++++++++++++++++ src/PVE/Storage/Plugin.pm | 25 +++++++++++++++++++++++++ 2 files changed, 46 insertions(+) qemu-manager: Thomas Ellmenreich (1): use new classify_volume_id subroutine src/PVE/QemuServer.pm | 39 ++++++++++++++++++++++++------------- src/PVE/QemuServer/Drive.pm | 6 ++++++ 2 files changed, 32 insertions(+), 13 deletions(-) Summary over all repositories: 4 files changed, 78 insertions(+), 13 deletions(-) -- Generated by murpp 0.12.0