[pve-devel] [RFC qemu-server 1/2] QEMU: add comment helper

Matthias Heiserer m.heiserer at proxmox.com
Mon Feb 14 15:01:39 CET 2022


Makes creation of comment fields centralized and simple

Signed-off-by: Matthias Heiserer <m.heiserer at proxmox.com>
---
 PVE/QemuServer/Helpers.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/PVE/QemuServer/Helpers.pm b/PVE/QemuServer/Helpers.pm
index c10d842..b753b1c 100644
--- a/PVE/QemuServer/Helpers.pm
+++ b/PVE/QemuServer/Helpers.pm
@@ -12,6 +12,7 @@ use base 'Exporter';
 our @EXPORT_OK = qw(
 min_version
 config_aware_timeout
+make_comment_fmt
 );
 
 my $nodename = PVE::INotify::nodename();
@@ -161,4 +162,14 @@ sub config_aware_timeout {
     return $timeout;
 }
 
+sub make_comment_fmt {
+    # GUI assumes this to be URIComponent encoded
+     return {
+	type => 'string',
+	description => 'user-supplied comment',
+	format_description => 'URIcomponent-encoded string',
+	optional => 1,
+    }
+}
+
 1;
-- 
2.30.2






More information about the pve-devel mailing list