]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/qemu/OSDefaults.js
ui: add permissions management for "localnetwork" zone
[pve-manager.git] / www / manager6 / qemu / OSDefaults.js
CommitLineData
b70e9ef5
EK
1/*
2 * This class holds performance *recommended* settings for the PVE Qemu wizards
3 * the *mandatory* settings are set in the PVE::QemuServer
4 * config_to_command sub
5 * We store this here until we get the data from the API server
6*/
7
8// this is how you would add an hypothetic FreeBSD > 10 entry
9//
10//virtio-blk is stable but virtIO net still
11// problematic as of 10.3
12// see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=165059
13// addOS({
14// parent: 'generic', // inherits defaults
15// pveOS: 'freebsd10', // must match a radiofield in OSTypeEdit.js
16// busType: 'virtio' // must match a pveBusController value
17// // networkCard muss match a pveNetworkCardSelector
18
19
20Ext.define('PVE.qemu.OSDefaults', {
21 singleton: true, // will also force creation when loaded
22
23 constructor: function() {
4f739927 24 let me = this;
b70e9ef5 25
4f739927 26 let addOS = function(settings) {
f09f1c27 27 if (Object.prototype.hasOwnProperty.call(settings, 'parent')) {
b70e9ef5
EK
28 var child = Ext.clone(me[settings.parent]);
29 me[settings.pveOS] = Ext.apply(child, settings);
b70e9ef5 30 } else {
53e3ea84 31 throw "Could not find your genitor";
b70e9ef5
EK
32 }
33 };
34
35 // default values
36 me.generic = {
37 busType: 'ide',
eca87c69 38 networkCard: 'e1000',
e2d72563
EK
39 busPriority: {
40 ide: 4,
41 sata: 3,
42 scsi: 2,
f6710aac 43 virtio: 1,
e2d72563 44 },
87e22230 45 scsihw: 'virtio-scsi-single',
b70e9ef5
EK
46 };
47
9daa22a6
EK
48 // virtio-net is in kernel since 2.6.25
49 // virtio-scsi since 3.2 but backported in RHEL with 2.6 kernel
b70e9ef5
EK
50 addOS({
51 pveOS: 'l26',
8058410f 52 parent: 'generic',
9daa22a6 53 busType: 'scsi',
e2d72563
EK
54 busPriority: {
55 scsi: 4,
56 virtio: 3,
57 sata: 2,
f6710aac 58 ide: 1,
e2d72563 59 },
f6710aac 60 networkCard: 'virtio',
b70e9ef5
EK
61 });
62
63 // recommandation from http://wiki.qemu.org/Windows2000
64 addOS({
65 pveOS: 'w2k',
8058410f 66 parent: 'generic',
2c0e2890 67 networkCard: 'rtl8139',
f6710aac 68 scsihw: '',
2c0e2890 69 });
78a5e21e 70 // https://pve.proxmox.com/wiki/Windows_XP_Guest_Notes
2c0e2890
EK
71 addOS({
72 pveOS: 'wxp',
8058410f 73 parent: 'w2k',
b70e9ef5 74 });
0f421616
TL
75
76 me.getDefaults = function(ostype) {
77 if (PVE.qemu.OSDefaults[ostype]) {
78 return PVE.qemu.OSDefaults[ostype];
79 } else {
80 return PVE.qemu.OSDefaults.generic;
81 }
82 };
f6710aac 83 },
b70e9ef5 84});