[pve-devel] [PATCH manager 1/2] Move bus priority list to OSDefaults
Emmanuel Kasper
e.kasper at proxmox.com
Mon Oct 10 14:32:50 CEST 2016
So a field container does not need to know if Linux likes SCSI.
---
www/manager6/form/ControllerSelector.js | 8 ++++----
www/manager6/qemu/OSDefaults.js | 12 ++++++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/www/manager6/form/ControllerSelector.js b/www/manager6/form/ControllerSelector.js
index 6482fed..b5c71d9 100644
--- a/www/manager6/form/ControllerSelector.js
+++ b/www/manager6/form/ControllerSelector.js
@@ -39,10 +39,10 @@ Ext.define('PVE.form.ControllerSelector', {
}
}
- // TODO: add to OSDefaults.js?
- var sortPriority = (vmconfig.ostype && vmconfig.ostype == "l26") ?
- { scsi: 4 , virtio: 3, sata: 2, ide: 1 } :
- { ide: 4, sata: 3, scsi: 2, virtio: 1 };
+ var vmDefaults = PVE.qemu.OSDefaults[vmconfig.ostype];
+
+ var sortPriority = vmDefaults && vmDefaults.busPriority
+ ? vmDefaults.busPriority : PVE.qemu.OSDefaults.generic;
var sortedList = Ext.clone(controllerList);
sortedList.sort(function(a,b) {
diff --git a/www/manager6/qemu/OSDefaults.js b/www/manager6/qemu/OSDefaults.js
index c351226..6837f44 100644
--- a/www/manager6/qemu/OSDefaults.js
+++ b/www/manager6/qemu/OSDefaults.js
@@ -37,6 +37,12 @@ Ext.define('PVE.qemu.OSDefaults', {
me.generic = {
busType: 'ide',
networkCard: 'e1000',
+ busPriority: {
+ ide: 4,
+ sata: 3,
+ scsi: 2,
+ virtio: 1
+ },
scsihw: 'virtio-scsi-pci'
};
@@ -46,6 +52,12 @@ Ext.define('PVE.qemu.OSDefaults', {
pveOS: 'l26',
parent : 'generic',
busType: 'scsi',
+ busPriority: {
+ scsi: 4,
+ virtio: 3,
+ sata: 2,
+ ide: 1
+ },
networkCard: 'virtio'
});
--
2.1.4
More information about the pve-devel
mailing list