all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] ui: qemu: add wwid text field
Date: Fri, 15 Dec 2023 14:55:42 +0100	[thread overview]
Message-ID: <20231215135542.393066-1-m.sandoval@proxmox.com> (raw)

This is useful to test multipath devices which need a wwid.

We use 'e.g.' rather than 'Example', otherwise the 18 characters of the
example do not fit in the field.

Suggested-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
 www/manager6/qemu/HDEdit.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index b78647ec..bc60a21c 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -91,6 +91,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	PVE.Utils.propertyStringSet(me.drive, values.readOnly, 'ro', 'on');
 	PVE.Utils.propertyStringSet(me.drive, values.cache, 'cache');
 	PVE.Utils.propertyStringSet(me.drive, values.aio, 'aio');
+	PVE.Utils.propertyStringSet(me.drive, values.wwn, 'wwn', values.wwn);
 
 	['mbps_rd', 'mbps_wr', 'iops_rd', 'iops_wr'].forEach(name => {
 	    let burst_name = `${name}_max`;
@@ -151,6 +152,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	values.iothread = PVE.Parser.parseBoolean(drive.iothread);
 	values.readOnly = PVE.Parser.parseBoolean(drive.ro);
 	values.aio = drive.aio || '__default__';
+	values.wwn = drive.wwn;
 
 	values.mbps_rd = drive.mbps_rd;
 	values.mbps_wr = drive.mbps_wr;
@@ -285,6 +287,22 @@ Ext.define('PVE.qemu.HDInputPanel', {
 		    disabled: '{!isVirtIO && !isSCSI}',
 		},
 	    },
+	    {
+		xtype: 'proxmoxtextfield',
+		name: 'wwn',
+		fieldLabel: 'WWID',
+		emptyText: gettext('e.g.') + ': 0x5566777799999999',
+		value: '',
+		skipEmptyText: true,
+		deleteEmpty: true,
+		submitEmptyText: false,
+		validator: function(v) {
+		    if (!v || (/^0x[0-9a-fA-F]{16}$/).test(v)) {
+			return true;
+		    }
+		    return gettext('Invalid Value');
+		},
+	    },
 	);
 
 	advancedColumn2.push(
-- 
2.39.2





                 reply	other threads:[~2023-12-15 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231215135542.393066-1-m.sandoval@proxmox.com \
    --to=m.sandoval@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