all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Subject: [RFC qemu-server/storage 0/2] refactor of volume_id classification
Date: Tue, 28 Jul 2026 14:22:16 +0200	[thread overview]
Message-ID: <20260728122218.202963-1-t.ellmenreich@proxmox.com> (raw)

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




             reply	other threads:[~2026-07-28 12:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 12:22 Thomas Ellmenreich [this message]
2026-07-28 12:22 ` [PATCH storage 1/2] add subroutine to classify volume ids Thomas Ellmenreich
2026-07-31 10:13   ` Fiona Ebner
2026-07-31 10:21     ` Fiona Ebner
2026-07-28 12:22 ` [PATCH qemu-server 2/2] use new classify_volume_id subroutine Thomas Ellmenreich
2026-07-31 10:13   ` Fiona Ebner
2026-07-28 13:30 ` [RFC qemu-server/storage 0/2] refactor of volume_id classification Max R. Carrara
2026-07-28 14:29   ` Thomas Ellmenreich
2026-07-29  8:27     ` Max R. Carrara
2026-07-31  9:56     ` Fiona Ebner

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