[pve-devel] [PATCH manager 2/2] fix #1113 use a LSI controller for legacy OSes

Emmanuel Kasper e.kasper at proxmox.com
Tue Sep 20 15:17:40 CEST 2016


instead of setting virtio-scsi for all newly created VMs, pass the
OS Optimal SCSI Controller to pveQemuCreateWizard which will
add it as an hidden paramater just before POSTing the wizard data
to the API.
---
 www/manager6/qemu/CreateWizard.js | 5 +++++
 www/manager6/qemu/OSDefaults.js   | 9 ++++++++-
 www/manager6/qemu/OSTypeEdit.js   | 9 +++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/CreateWizard.js b/www/manager6/qemu/CreateWizard.js
index b72a0d0..be9bada 100644
--- a/www/manager6/qemu/CreateWizard.js
+++ b/www/manager6/qemu/CreateWizard.js
@@ -3,6 +3,7 @@
 Ext.define('PVE.qemu.CreateWizard', {
     extend: 'PVE.window.Wizard',
     alias: 'widget.pveQemuCreateWizard',
+    qemuScsiController: undefined,
 
     initComponent: function() {
 	var me = this;
@@ -154,6 +155,10 @@ Ext.define('PVE.qemu.CreateWizard', {
 			var nodename = kv.nodename;
 			delete kv.nodename;
 
+			if (me.qemuScsiController) {
+			    kv.scsihw = me.qemuScsiController;
+			}
+
 			PVE.Utils.API2Request({
 			    url: '/nodes/' + nodename + '/qemu',
 			    waitMsgTarget: me,
diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js
index dc13eeb..c351226 100644
--- a/www/manager6/qemu/OSDefaults.js
+++ b/www/manager6/qemu/OSDefaults.js
@@ -53,7 +53,14 @@ Ext.define('PVE.qemu.OSDefaults', {
 	addOS({
 	    pveOS: 'w2k',
 	    parent : 'generic',
-	    networkCard: 'rtl8139'
+	    networkCard: 'rtl8139',
+	    scsihw: 'lsi'
+	});
+
+	addOS({
+	    pveOS: 'wxp',
+	    parent : 'generic',
+	    scsihw: 'lsi'
 	});
 
     }
diff --git a/www/manager6/qemu/OSTypeEdit.js b/www/manager6/qemu/OSTypeEdit.js
index cc8cf37..4c53242 100644
--- a/www/manager6/qemu/OSTypeEdit.js
+++ b/www/manager6/qemu/OSTypeEdit.js
@@ -24,6 +24,7 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
 
 			me.setWidget('pveBusSelector', targetValues.busType);
 			me.setWidget('pveNetworkCardSelector', targetValues.networkCard);
+			me.setWizardHiddenValue('qemuScsiController', targetValues.scsihw);
 		    }
 	    }
 	},
@@ -36,6 +37,14 @@ Ext.define('PVE.qemu.OSTypeInputPanel', {
 	    } else {
 		throw 'non unique widget :' + widget + ' in Wizard';
 	    }
+	},
+	setWizardHiddenValue: function(property, newValue) {
+	    var wizards = Ext.ComponentQuery.query('pveQemuCreateWizard ');
+	    if (wizards.length === 1) {
+		wizards[0][property] = newValue;
+	    } else {
+		throw 'non unique wizard, unable to set ' + property;
+	    }
 	}
     },
 
-- 
2.1.4





More information about the pve-devel mailing list