Move bus priority list to OSDefaults

So a field container does not need to know if Linux likes SCSI.
This commit is contained in:
Emmanuel Kasper 2016-10-10 14:32:50 +02:00 committed by Dietmar Maurer
parent 78a5e21e4c
commit e2d725633e
2 changed files with 16 additions and 4 deletions

View File

@ -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) {

View File

@ -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'
});