]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/qemu/OSDefaults.js
api: add proxmox-firewall to versions pkg list
[pve-manager.git] / www / manager6 / qemu / OSDefaults.js
index 89d9c153a388bcda072d7b6326a1f64eb31a3809..58bc76ffbfc74df7eb95f6ae1169e065d25cacc5 100644 (file)
@@ -21,15 +21,14 @@ Ext.define('PVE.qemu.OSDefaults', {
     singleton: true, // will also force creation when loaded
 
     constructor: function() {
-       var me = this;
+       let me = this;
 
-       var addOS = function(settings) {
-               if (me.hasOwnProperty(settings.parent)) {
+       let addOS = function(settings) {
+               if (Object.prototype.hasOwnProperty.call(settings, 'parent')) {
                    var child = Ext.clone(me[settings.parent]);
                    me[settings.pveOS] = Ext.apply(child, settings);
-
                } else {
-                   throw("Could not find your genitor");
+                   throw "Could not find your genitor";
                }
            };
 
@@ -41,37 +40,46 @@ Ext.define('PVE.qemu.OSDefaults', {
                    ide: 4,
                    sata: 3,
                    scsi: 2,
-                   virtio: 1
+                   virtio: 1,
            },
-           scsihw: 'virtio-scsi-pci'
+           scsihw: 'virtio-scsi-single',
+           cputype: 'x86-64-v2-AES',
        };
 
        // virtio-net is in kernel since 2.6.25
        // virtio-scsi since 3.2 but backported in RHEL with 2.6 kernel
        addOS({
            pveOS: 'l26',
-           parent : 'generic',
+           parent: 'generic',
            busType: 'scsi',
            busPriority: {
                    scsi: 4,
                    virtio: 3,
                    sata: 2,
-                   ide: 1
+                   ide: 1,
            },
-           networkCard: 'virtio'
+           networkCard: 'virtio',
        });
 
        // recommandation from http://wiki.qemu.org/Windows2000
        addOS({
            pveOS: 'w2k',
-           parent : 'generic',
+           parent: 'generic',
            networkCard: 'rtl8139',
-           scsihw: 'lsi'
+           scsihw: '',
        });
        // https://pve.proxmox.com/wiki/Windows_XP_Guest_Notes
        addOS({
            pveOS: 'wxp',
-           parent : 'w2k'
+           parent: 'w2k',
        });
-    }
+
+       me.getDefaults = function(ostype) {
+           if (PVE.qemu.OSDefaults[ostype]) {
+               return PVE.qemu.OSDefaults[ostype];
+           } else {
+               return PVE.qemu.OSDefaults.generic;
+           }
+       };
+    },
 });