From: Fiona Ebner <f.ebner@proxmox.com>
To: Thomas Ellmenreich <t.ellmenreich@proxmox.com>,
pve-devel@lists.proxmox.com
Subject: Re: [PATCH storage 1/2] add subroutine to classify volume ids
Date: Fri, 31 Jul 2026 12:13:52 +0200 [thread overview]
Message-ID: <dce1f36d-d012-4be2-9ed4-39e044843a50@proxmox.com> (raw)
In-Reply-To: <20260728122218.202963-2-t.ellmenreich@proxmox.com>
Am 28.07.26 um 2:22 PM schrieb Thomas Ellmenreich:
> +sub classify_volume_id {
As already resulted from the other discussion, the current
implementation is rather for a classify_drive() helper. Technically, an
absolute path is not a valid volume ID. Our storage layer just sometimes
does not cleanly separate them.
> + my ($volid, $noerr) = @_;
> +
> + if (!defined($volid) || $volid eq "none") {
I think we should die for undef and make sure that we always do have an
explicit value when calling this function. It's not the same for the
pve-volume-id-or-qm-path format. The result from parse_drive() will
always have a value and otherwise something went wrong and most likely
points to another issue that should be resolved.
> + return VOL_NONE;
> + } elsif ($volid eq 'cdrom') {
> + return VOL_CDROM;
> + } elsif ($volid =~ m|^/|) {
> + return VOL_ABSOLUTE;
> + } elsif (parse_volume_id($volid, 1)) {
> + return VOL_VOLUME;
> + }
> +
> + return undef if $noerr;
> + die "unable to classify volume ID '$volid'";
> +}
> +
> PVE::JSONSchema::register_format('pve-dir-override', \&verify_dir_override);
>
> sub verify_dir_override {
next prev parent reply other threads:[~2026-07-31 10:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 12:22 [RFC qemu-server/storage 0/2] refactor of volume_id classification Thomas Ellmenreich
2026-07-28 12:22 ` [PATCH storage 1/2] add subroutine to classify volume ids Thomas Ellmenreich
2026-07-31 10:13 ` Fiona Ebner [this message]
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=dce1f36d-d012-4be2-9ed4-39e044843a50@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
--cc=t.ellmenreich@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox