[pve-devel] [PATCH manager 07/11] disable discard for non-scsi disks

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Aug 29 12:08:30 CEST 2017


Adapted from: Dominik Csapak <d.csapak at proxmox.com> version

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

new, adapted from a version from Dominik.

 www/manager6/qemu/HDEdit.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index fdeb4a2a..e7535f50 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -23,6 +23,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	    if (!allowIOthread) {
 		this.lookup('iothread').setValue(false);
 	    }
+
+	    var allowDiscard = value.match(/^scsi/);
+	    this.lookup('discard').setDisabled(!allowDiscard);
+	    if (!allowDiscard) {
+		this.lookup('discard').setValue(false);
+	    }
 	},
 
 	control: {
@@ -274,6 +280,8 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	{
 	    xtype: 'pvecheckbox',
 	    fieldLabel: gettext('Discard'),
+	    disabled: me.confid && !me.confid.match(/^scsi/),
+	    reference: 'discard',
 	    name: 'discard'
 	},
 	{
-- 
2.11.0





More information about the pve-devel mailing list