[pve-devel] [PATCH manager 5/5] ui/hardware: extend machine renderer to show pinned Windows versions

Stefan Reiter s.reiter at proxmox.com
Mon Mar 8 11:01:51 CET 2021


The default is not just "i440fx", this hides the fact that the version
will be pinned to 5.1, unless one deliberately opens the editor.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index 470baa46..98352e3f 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -159,7 +159,14 @@ Ext.define('PVE.qemu.HardwareView', {
 		never_delete: true,
 		group: 6,
 		defaultValue: '',
-		renderer: PVE.Utils.render_qemu_machine,
+		renderer: function(value, metaData, record, rowIndex, colIndex, store, pending) {
+		    let ostype = me.getObjectValue('ostype', undefined, pending);
+		    if (PVE.Utils.is_windows(ostype) &&
+			(!value || value === 'pc' || value === 'q35')) {
+			return value === 'q35' ? 'pc-q35-5.1' : 'pc-i440fx-5.1';
+		    }
+		    return PVE.Utils.render_qemu_machine(value);
+		},
 	    },
 	    scsihw: {
 		header: gettext('SCSI Controller'),
@@ -203,6 +210,9 @@ Ext.define('PVE.qemu.HardwareView', {
 	    shares: {
 		visible: false,
 	    },
+	    ostype: {
+		visible: false,
+	    },
 	};
 
 	PVE.Utils.forEachBus(undefined, function(type, id) {
-- 
2.20.1






More information about the pve-devel mailing list