]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/qemu/HDEdit.js
Add "SSD emulation" property to IDE, SATA, and SCSI drives
[pve-manager.git] / www / manager6 / qemu / HDEdit.js
index 237128e5476aff38f83cc1b634229dbd7dda7325..606ba4b87957cb119a399e07b1ee2eb190b084eb 100644 (file)
@@ -24,6 +24,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
                this.lookup('iothread').setValue(false);
            }
 
+           var virtio = value.match(/^virtio/);
+           this.lookup('ssd').setDisabled(virtio);
+           if (virtio) {
+               this.lookup('ssd').setValue(false);
+           }
+
            var scsi = value.match(/^scsi/);
            this.lookup('discard').setDisabled(!scsi);
            if (!scsi) {
@@ -85,6 +91,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
            delete me.drive.discard;
        }
 
+       if (values.ssd) {
+           me.drive.ssd = 'on';
+       } else {
+           delete me.drive.ssd;
+       }
+
        if (values.iothread) {
            me.drive.iothread = 'on';
        } else {
@@ -160,6 +172,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
        values.diskformat = drive.format || 'raw';
        values.cache = drive.cache || '__default__';
        values.discard = (drive.discard === 'on');
+       values.ssd = PVE.Parser.parseBoolean(drive.ssd);
        values.iothread = PVE.Parser.parseBoolean(drive.iothread);
 
        values.mbps_rd = drive.mbps_rd;
@@ -241,21 +254,30 @@ Ext.define('PVE.qemu.HDInputPanel', {
            });
        }
 
-       me.column2.push({
-           xtype: 'CacheTypeSelector',
-           name: 'cache',
-           value: '__default__',
-           fieldLabel: gettext('Cache')
-       });
-
-       me.advancedColumn1.push(
+       me.column2.push(
+           {
+               xtype: 'CacheTypeSelector',
+               name: 'cache',
+               value: '__default__',
+               fieldLabel: gettext('Cache')
+           },
            {
                xtype: 'proxmoxcheckbox',
                fieldLabel: gettext('Discard'),
                disabled: me.confid && !me.confid.match(/^scsi/),
                reference: 'discard',
-               labelWidth: labelWidth,
                name: 'discard'
+           }
+       );
+
+       me.advancedColumn1.push(
+           {
+               xtype: 'proxmoxcheckbox',
+               disabled: me.confid && me.confid.match(/^virtio/),
+               fieldLabel: gettext('SSD emulation'),
+               labelWidth: labelWidth,
+               name: 'ssd',
+               reference: 'ssd'
            },
            {
                xtype: 'proxmoxcheckbox',
@@ -364,6 +386,8 @@ Ext.define('PVE.qemu.HDEdit', {
 
     isAdd: true,
 
+    backgroundDelay: 5,
+
     initComponent : function() {
        var me = this;