[pve-devel] [PATCH] add discard option to qemu drive

Alexandre Derumier aderumier at odiso.com
Thu Aug 14 13:52:53 CEST 2014


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager/qemu/HDEdit.js |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/www/manager/qemu/HDEdit.js b/www/manager/qemu/HDEdit.js
index 3b728b5..0faa3c5 100644
--- a/www/manager/qemu/HDEdit.js
+++ b/www/manager/qemu/HDEdit.js
@@ -33,6 +33,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	    delete me.drive.backup;
 	}
 
+	if (values.discard) {
+	    me.drive.discard = 'on';
+	} else {
+	    delete me.drive.discard;
+	}
+
 	if (values.cache) {
 	    me.drive.cache = values.cache;
 	} else {
@@ -81,6 +87,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	values.nobackup = (drive.backup === 'no');
 	values.diskformat = drive.format || 'raw';
 	values.cache = drive.cache || '';
+	values.discard = (drive.discard === 'on');
 
 	me.setValues(values);
     },
@@ -213,6 +220,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
 	    name: 'nobackup'
 	});
 
+	me.column2.push({
+	    xtype: 'pvecheckbox',
+	    fieldLabel: gettext('Discard'),
+	    name: 'discard'
+	});
+
 	me.callParent();
     }
 });
-- 
1.7.10.4




More information about the pve-devel mailing list