[pve-devel] [PATCH manager 2/2] gui: add nvme as a bus type for creating disks

Oguz Bektas o.bektas at proxmox.com
Wed May 13 17:36:34 CEST 2020


add nvme to the bus list and relevant spots in gui

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 www/manager6/Utils.js                   |   3 ++-
 www/manager6/form/BusTypeSelector.js    |   2 ++
 www/manager6/form/ControllerSelector.js |   4 ++--
 www/manager6/qemu/.Snapshot.js.swp      | Bin 0 -> 12288 bytes
 www/manager6/qemu/CloudInit.js          |   4 ++--
 www/mobile/QemuSummary.js               |   2 +-
 6 files changed, 9 insertions(+), 6 deletions(-)
 create mode 100644 www/manager6/qemu/.Snapshot.js.swp

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index 0cce81d4..47b6e5c1 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -26,7 +26,7 @@ Ext.define('PVE.Utils', { utilities: {
 
     toolkit: undefined, // (extjs|touch), set inside Toolkit.js
 
-    bus_match: /^(ide|sata|virtio|scsi)\d+$/,
+    bus_match: /^(ide|sata|virtio|scsi|nvme)\d+$/,
 
     log_severity_hash: {
 	0: "panic",
@@ -1286,6 +1286,7 @@ Ext.define('PVE.Utils', { utilities: {
 	ide: 4,
 	sata: 6,
 	scsi: 31,
+	nvme: 8,
 	virtio: 16,
     },
 
diff --git a/www/manager6/form/BusTypeSelector.js b/www/manager6/form/BusTypeSelector.js
index 04643e77..c65eba79 100644
--- a/www/manager6/form/BusTypeSelector.js
+++ b/www/manager6/form/BusTypeSelector.js
@@ -15,6 +15,8 @@ Ext.define('PVE.form.BusTypeSelector', {
 
 	me.comboItems.push(['scsi', 'SCSI']);
 
+	me.comboItems.push(['nvme', 'NVME']);
+
 	me.callParent();
     }
 });
diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index 89ecdf4a..0cea5fce 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -37,7 +37,7 @@ Ext.define('PVE.form.ControllerSelector', {
 
 	me.vmconfig = Ext.apply({}, vmconfig);
 
-	var clist = ['ide', 'virtio', 'scsi', 'sata'];
+	var clist = ['ide', 'virtio', 'scsi', 'sata', 'nvme'];
 	var bussel = me.down('field[name=controller]');
 	var deviceid = me.down('field[name=deviceid]');
 
@@ -47,7 +47,7 @@ Ext.define('PVE.form.ControllerSelector', {
 		deviceid.setValue(2);
 		return;
 	    }
-	    clist = ['ide', 'scsi', 'sata'];
+	    clist = ['ide', 'scsi', 'sata', 'nvme'];
 	} else  {
 	    // in most cases we want to add a disk to the same controller
 	    // we previously used
diff --git a/www/manager6/qemu/.Snapshot.js.swp b/www/manager6/qemu/.Snapshot.js.swp
new file mode 100644
index 0000000000000000000000000000000000000000..bcfd26a5a863605108667b951d6d8f3c9b3afa10
GIT binary patch
literal 12288
zcmeI%%?g4*5Ww-VdldBoR_EM4Abf-9&?)M^kyt at xsR<qGQG1doxAY>^rIYYqaK~YH
zhw*olUG^4}sqH#_Nk`pGpYd=-4t{*e^Iy@|8~tlNU%Q%uYP^Y5aQ3=8z1O~XQc04i
z?0uw;-Y!<Ny$-_lA#%21ew2s+0)GosWjN^fOqou*Wj7o1zbjGz0R#|0009ILKmY**
z$|Dd3mfX^ID_P6dmsp-JqEiGAKmY**5I_I{1Q0*~0R#{z3h0%{y(aQZA9Meo|Np=9
b;%0IL5I_I{1Q0*~0R#|0009ILD5by)nd%`+

literal 0
HcmV?d00001

diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index cbb4af9d..ca00698d 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -135,7 +135,7 @@ Ext.define('PVE.qemu.CloudInit', {
 	    var id = record.data.key;
 	    var value = record.data.value;
 	    var ciregex = new RegExp("vm-" + me.pveSelNode.data.vmid + "-cloudinit");
-		if (id.match(/^(ide|scsi|sata)\d+$/) && ciregex.test(value)) {
+		if (id.match(/^(ide|scsi|sata|nvme)\d+$/) && ciregex.test(value)) {
 		    found = id;
 		    me.ciDriveId = found;
 		    me.ciDrive = value;
@@ -316,7 +316,7 @@ Ext.define('PVE.qemu.CloudInit', {
 	}
 	/*jslint confusion: false*/
 
-	PVE.Utils.forEachBus(['ide', 'scsi', 'sata'], function(type, id) {
+	PVE.Utils.forEachBus(['ide', 'scsi', 'sata', 'nvme'], function(type, id) {
 	    me.rows[type+id] = {
 		visible: false
 	    };
diff --git a/www/mobile/QemuSummary.js b/www/mobile/QemuSummary.js
index 6cbaba1b..9b306a45 100644
--- a/www/mobile/QemuSummary.js
+++ b/www/mobile/QemuSummary.js
@@ -12,7 +12,7 @@ Ext.define('PVE.QemuSummary', {
 
     config_keys: [
 	'name', 'memory', 'sockets', 'cores', 'ostype', 'bootdisk', /^net\d+/,
-	/^ide\d+/, /^virtio\d+/, /^sata\d+/, /^scsi\d+/, /^unused\d+/
+	/^ide\d+/, /^virtio\d+/, /^sata\d+/, /^scsi\d+/, /^nvme\d+/, /^unused\d+/
     ],
 
     initialize: function() {
-- 
2.20.1




More information about the pve-devel mailing list