all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH qemu-server 0/3] refactor of volume_id classification
@ 2026-08-03 12:12 Thomas Ellmenreich
  2026-08-03 12:12 ` [PATCH qemu-server 1/3] moved verify_volume_id_or_* format registrations Thomas Ellmenreich
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Thomas Ellmenreich @ 2026-08-03 12:12 UTC (permalink / raw)
  To: pve-devel; +Cc: Thomas Ellmenreich

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-05  9:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 12:12 [PATCH qemu-server 0/3] refactor of volume_id classification Thomas Ellmenreich
2026-08-03 12:12 ` [PATCH qemu-server 1/3] moved verify_volume_id_or_* format registrations Thomas Ellmenreich
2026-08-04 14:09   ` Elias Huhsovitz
2026-08-03 12:12 ` [PATCH qemu-server 2/3] add new classify_drive_file utility Thomas Ellmenreich
2026-08-04 14:23   ` Elias Huhsovitz
2026-08-03 12:12 ` [PATCH qemu-server 3/3] removed some unnecessary undef checks Thomas Ellmenreich
2026-08-05  8:24   ` Elias Huhsovitz
2026-08-05  9:55     ` Fiona Ebner
2026-08-05  8:22 ` superseded: [PATCH qemu-server 0/3] refactor of volume_id classification Thomas Ellmenreich

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.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal