[pve-devel] [PATCH manager v2 1/2] Add global regexp to match bus entry in a VM config

Emmanuel Kasper e.kasper at proxmox.com
Wed Oct 5 14:24:39 CEST 2016


---
 www/manager6/Utils.js              | 2 ++
 www/manager6/qemu/BootOrderEdit.js | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 3c15135..3bf5188 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -63,6 +63,8 @@ var HostPort_match = new RegExp("^(" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")(:
 var HostPortBrackets_match = new RegExp("^\\[(?:" + IPV6_REGEXP + "|" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")\\](:\\d+)?$");
 var IP6_dotnotation_match = new RegExp("^" + IPV6_REGEXP + "(\\.\\d+)?$");
 
+var bus_match = new RegExp("^(ide|sata|virtio|scsi)\\d+$");
+
 var DocsPages = {
     'pve-admin-guide.html':'Proxmox VE Administration Guide',
     'chapter-sysadmin.html':'Host System Administration',
diff --git a/www/manager6/qemu/BootOrderEdit.js b/www/manager6/qemu/BootOrderEdit.js
index e6a9b9c..510a671 100644
--- a/www/manager6/qemu/BootOrderEdit.js
+++ b/www/manager6/qemu/BootOrderEdit.js
@@ -9,7 +9,8 @@ Ext.define('PVE.qemu.BootOrderPanel', {
     comboboxes: [],
 
     isBootDisk: function(value) {
-	return (/^(ide|sata|scsi|virtio)\d+$/).test(value);
+	/*global bus_match */
+	return bus_match.test(value);
     },
 
     setVMConfig: function(vmconfig) {
-- 
2.1.4





More information about the pve-devel mailing list