From: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
Subject: [PATCH qemu-server 1/3] moved verify_volume_id_or_* format registrations
Date: Mon, 3 Aug 2026 14:12:57 +0200 [thread overview]
Message-ID: <20260803121300.138287-2-t.ellmenreich@proxmox.com> (raw)
In-Reply-To: <20260803121300.138287-1-t.ellmenreich@proxmox.com>
The format registrations of verify_volume_id_or_qm_path and
verify_volume_id_or_absolute_path were moved from QemuServer to
QemuServer::Drive, which is a more fitting location.
Signed-off-by: Thomas Ellmenreich <t.ellmenreich@proxmox.com>
---
src/PVE/QemuServer.pm | 28 ----------------------------
src/PVE/QemuServer/Drive.pm | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 9aec7f9c..fdef20dc 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -895,34 +895,6 @@ sub pve_verify_cpuset {
return PVE::CpuSet->new($members)->short_string();
}
-PVE::JSONSchema::register_format('pve-volume-id-or-qm-path', \&verify_volume_id_or_qm_path);
-
-sub verify_volume_id_or_qm_path {
- my ($volid, $noerr) = @_;
-
- return $volid if $volid eq 'none' || $volid eq 'cdrom';
-
- return verify_volume_id_or_absolute_path($volid, $noerr);
-}
-
-PVE::JSONSchema::register_format(
- 'pve-volume-id-or-absolute-path',
- \&verify_volume_id_or_absolute_path,
-);
-
-sub verify_volume_id_or_absolute_path {
- my ($volid, $noerr) = @_;
-
- return $volid if $volid =~ m|^/|;
-
- $volid = eval { PVE::JSONSchema::check_format('pve-volume-id', $volid, '') };
- if ($@) {
- return if $noerr;
- die $@;
- }
- return $volid;
-}
-
my $serialdesc = {
optional => 1,
type => 'string',
diff --git a/src/PVE/QemuServer/Drive.pm b/src/PVE/QemuServer/Drive.pm
index b80b7dbb..52e4a89b 100644
--- a/src/PVE/QemuServer/Drive.pm
+++ b/src/PVE/QemuServer/Drive.pm
@@ -753,6 +753,34 @@ sub verify_bootdisk {
die "invalid boot disk '$value'\n";
}
+PVE::JSONSchema::register_format('pve-volume-id-or-qm-path', \&verify_volume_id_or_qm_path);
+
+sub verify_volume_id_or_qm_path {
+ my ($volid, $noerr) = @_;
+
+ return $volid if $volid eq 'none' || $volid eq 'cdrom';
+
+ return verify_volume_id_or_absolute_path($volid, $noerr);
+}
+
+PVE::JSONSchema::register_format(
+ 'pve-volume-id-or-absolute-path',
+ \&verify_volume_id_or_absolute_path,
+);
+
+sub verify_volume_id_or_absolute_path {
+ my ($volid, $noerr) = @_;
+
+ return $volid if $volid =~ m|^/|;
+
+ $volid = eval { PVE::JSONSchema::check_format('pve-volume-id', $volid, '') };
+ if ($@) {
+ return if $noerr;
+ die $@;
+ }
+ return $volid;
+}
+
sub drive_is_cloudinit {
my ($drive) = @_;
return $drive->{file} =~ m@[:/](?:vm-\d+-)?cloudinit(?:\.$QEMU_FORMAT_RE)?$@;
--
2.47.3
next prev parent reply other threads:[~2026-08-03 12:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 12:12 [PATCH qemu-server 0/3] refactor of volume_id classification Thomas Ellmenreich
2026-08-03 12:12 ` Thomas Ellmenreich [this message]
2026-08-04 14:09 ` [PATCH qemu-server 1/3] moved verify_volume_id_or_* format registrations 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
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=20260803121300.138287-2-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.