[pve-devel] [PATCH v2 pve-manager] ui: pci passthrough: editor for pci-id overrides

Nicholas Sherlock nick at nicksherlock.com
Tue Jan 18 22:38:40 CET 2022


From: Nicholas Sherlock <n.sherlock at gmail.com>

Signed-off-by: Nicholas Sherlock <n.sherlock at gmail.com>
---
 www/manager6/Toolkit.js      |  2 ++
 www/manager6/qemu/PCIEdit.js | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/www/manager6/Toolkit.js b/www/manager6/Toolkit.js
index 1b6085a4..f69c376a 100644
--- a/www/manager6/Toolkit.js
+++ b/www/manager6/Toolkit.js
@@ -13,6 +13,8 @@ Ext.apply(Ext.form.field.VTypes, {
     IP64AddressWithSuffixList: v => PVE.Utils.verify_ip64_address_list(v, true),
     IP64AddressListText: gettext('Example') + ': 192.168.1.1,192.168.1.2',
     IP64AddressListMask: /[A-Fa-f0-9,:.; ]/,
+    PciIdText: gettext('Example') + ': 0x8086',
+    PciId: v => /^0x[0-9a-fA-F]{4}$/.test(v),
 });
 
 Ext.define('PVE.form.field.Display', {
diff --git a/www/manager6/qemu/PCIEdit.js b/www/manager6/qemu/PCIEdit.js
index f505e34f..ec22a89c 100644
--- a/www/manager6/qemu/PCIEdit.js
+++ b/www/manager6/qemu/PCIEdit.js
@@ -190,6 +190,24 @@ Ext.define('PVE.qemu.PCIInputPanel', {
 		fieldLabel: 'ROM-File',
 		name: 'romfile',
 	    },
+	    {
+		xtype: 'textfield',
+		name: 'vendor-id',
+		fieldLabel: gettext('Set vendor ID'),
+		vtype: 'PciId',
+		allowBlank: true,
+		emptyText: Proxmox.Utils.defaultText,
+		submitEmpty: false,
+	    },
+	    {
+		xtype: 'textfield',
+		name: 'device-id',
+		fieldLabel: gettext('Set device ID'),
+		vtype: 'PciId',
+		allowBlank: true,
+		emptyText: Proxmox.Utils.defaultText,
+		submitEmpty: false,
+	    },
 	];
 
 	me.advancedColumn2 = [
@@ -198,6 +216,24 @@ Ext.define('PVE.qemu.PCIInputPanel', {
 		fieldLabel: 'PCI-Express',
 		name: 'pcie',
 	    },
+	    {
+		xtype: 'textfield',
+		name: 'sub-vendor-id',
+		fieldLabel: gettext('Set sub-vendor ID'),
+		vtype: 'PciId',
+		allowBlank: true,
+		emptyText: Proxmox.Utils.defaultText,
+		submitEmpty: false,
+	    },
+	    {
+		xtype: 'textfield',
+		name: 'sub-device-id',
+		fieldLabel: gettext('Set sub-device ID'),
+		vtype: 'PciId',
+		allowBlank: true,
+		emptyText: Proxmox.Utils.defaultText,
+		submitEmpty: false,
+	    },
 	];
 
 	me.callParent();
-- 
2.34.1





More information about the pve-devel mailing list