]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/OSDefaults.js
ui: qemu: change logic to use ViewModel instead of listener function
[pve-manager.git] / www / manager6 / qemu / OSDefaults.js
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
20 Ext.define('PVE.qemu.OSDefaults', {
21 singleton: true, // will also force creation when loaded
22
23 constructor: function() {
24 let me = this;
25
26 let addOS = function(settings) {
27 if (Object.prototype.hasOwnProperty.call(settings, 'parent')) {
28 var child = Ext.clone(me[settings.parent]);
29 me[settings.pveOS] = Ext.apply(child, settings);
30 } else {
31 throw "Could not find your genitor";
32 }
33 };
34
35 // default values
36 me.generic = {
37 busType: 'ide',
38 networkCard: 'e1000',
39 busPriority: {
40 ide: 4,
41 sata: 3,
42 scsi: 2,
43 virtio: 1,
44 },
45 scsihw: 'virtio-scsi-single',
46 cputype: 'x86-64-v2-AES',
47 };
48
49 // virtio-net is in kernel since 2.6.25
50 // virtio-scsi since 3.2 but backported in RHEL with 2.6 kernel
51 addOS({
52 pveOS: 'l26',
53 parent: 'generic',
54 busType: 'scsi',
55 busPriority: {
56 scsi: 4,
57 virtio: 3,
58 sata: 2,
59 ide: 1,
60 },
61 networkCard: 'virtio',
62 });
63
64 // recommandation from http://wiki.qemu.org/Windows2000
65 addOS({
66 pveOS: 'w2k',
67 parent: 'generic',
68 networkCard: 'rtl8139',
69 scsihw: '',
70 });
71 // https://pve.proxmox.com/wiki/Windows_XP_Guest_Notes
72 addOS({
73 pveOS: 'wxp',
74 parent: 'w2k',
75 });
76
77 me.getDefaults = function(ostype) {
78 if (PVE.qemu.OSDefaults[ostype]) {
79 return PVE.qemu.OSDefaults[ostype];
80 } else {
81 return PVE.qemu.OSDefaults.generic;
82 }
83 };
84 },
85 });