From: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Subject: [PATCH qemu-server v2 0/3] refactor of volume_id classification
Date: Wed, 5 Aug 2026 10:21:19 +0200 [thread overview]
Message-ID: <20260805082122.43184-1-t.ellmenreich@proxmox.com> (raw)
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' and in the case of
> classification failure: 'unknown'
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 (thanks @Elias)
--------------------------------
- Instead of mixing double quotes (") and single quotes (') the
'classify_drive_file' function now only uses single quotes.
- Since returning undef for 'classify_drive_file' could lead to
unnessesary undef checking when comparing to expected values to avoid
warnings, the subroutine now returns 'unknown' in the case of a failed
classification.
Changes since RFC (thanks @Max, @Fiona)
---------------------------------------
- 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):
move verify_volume_id_or_* format registrations into Drive submodule
add new classify_drive_file utility
removed some unnecessary undef checks.
src/PVE/QemuServer.pm | 63 +++++++++++--------------------------
src/PVE/QemuServer/Drive.pm | 53 +++++++++++++++++++++++++++++++
2 files changed, 72 insertions(+), 44 deletions(-)
Summary over all repositories:
2 files changed, 72 insertions(+), 44 deletions(-)
--
Generated by murpp 0.12.0
next reply other threads:[~2026-08-05 8:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 8:21 Thomas Ellmenreich [this message]
2026-08-05 8:21 ` [PATCH qemu-server v2 1/3] move verify_volume_id_or_* format registrations into Drive submodule Thomas Ellmenreich
2026-08-05 8:21 ` [PATCH qemu-server v2 2/3] add new classify_drive_file utility Thomas Ellmenreich
2026-08-05 8:21 ` [PATCH qemu-server v2 3/3] removed some unnecessary undef checks Thomas Ellmenreich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805082122.43184-1-t.ellmenreich@proxmox.com \
--to=t.ellmenreich@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.