From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id AFEB31FF0F0 for ; Mon, 03 Aug 2026 14:13:30 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 687522152D; Mon, 03 Aug 2026 14:13:18 +0200 (CEST) From: Thomas Ellmenreich To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 0/3] refactor of volume_id classification Date: Mon, 3 Aug 2026 14:12:56 +0200 Message-ID: <20260803121300.138287-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: 1785759182597 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.078 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: EWKP4UT5AZFZRMUFPQAS2W7JXRT22CX4 X-Message-ID-Hash: EWKP4UT5AZFZRMUFPQAS2W7JXRT22CX4 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 disk files 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_drive_file subroutine, as @Fiona Ebener mentioned here: [2]. Overview -------- As previously mentioned, a new classify_drive_file subroutine has been introduced, which can then be used to determine the type of disk file. This type can be one of: > 'none', 'cdrom', 'absolute', 'volume' Other Small changes ------------------- In the light of this small refactoring, 2 other small changes crept in. (1) First, one to move the definitions and registration of 2 drive related subroutines to the QemuServer::Drive submodule. Then (2), the removal of a couple of undef checks for volids which are no longer necessary. These changes have been placed in their own patches to be easily reverted. Changes since v1 ---------------- - moved the classification subroutine out of PVE::Storage and into PVE::QemuServer::Drive - Rewrite of the subroutine with the following changes: - does not throw errors anymore, only returns undef if classification fails - renamed to 'classify_drive_file' - before, undef led to it being classified as 'none' which now also just returns undef - moved the registration of 'verify_volume_id_or_(absolute_path/qm_path)' from QemuServer to QemuServer::Drive - reintroduced the removal of some unnecessary undef checks as a separate patch [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/ qemu-manager: Thomas Ellmenreich (3): moved verify_volume_id_or_* format registrations add new classify_drive_file utility removed some unnecessary undef checks. src/PVE/QemuServer.pm | 63 +++++++++++-------------------------- src/PVE/QemuServer/Drive.pm | 51 ++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 44 deletions(-) Summary over all repositories: 2 files changed, 70 insertions(+), 44 deletions(-) -- Generated by murpp 0.12.0