Commit c08ec3fd authored by Alexandre Derumier's avatar Alexandre Derumier Committed by Dietmar Maurer

add discard option to qemu drive

Signed-off-by: 's avatarAlexandre Derumier <aderumier@odiso.com>
parent bc2d4d93
...@@ -33,6 +33,12 @@ Ext.define('PVE.qemu.HDInputPanel', { ...@@ -33,6 +33,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
delete me.drive.backup; delete me.drive.backup;
} }
if (values.discard) {
me.drive.discard = 'on';
} else {
delete me.drive.discard;
}
if (values.cache) { if (values.cache) {
me.drive.cache = values.cache; me.drive.cache = values.cache;
} else { } else {
...@@ -81,6 +87,7 @@ Ext.define('PVE.qemu.HDInputPanel', { ...@@ -81,6 +87,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
values.nobackup = (drive.backup === 'no'); values.nobackup = (drive.backup === 'no');
values.diskformat = drive.format || 'raw'; values.diskformat = drive.format || 'raw';
values.cache = drive.cache || ''; values.cache = drive.cache || '';
values.discard = (drive.discard === 'on');
me.setValues(values); me.setValues(values);
}, },
...@@ -213,6 +220,12 @@ Ext.define('PVE.qemu.HDInputPanel', { ...@@ -213,6 +220,12 @@ Ext.define('PVE.qemu.HDInputPanel', {
name: 'nobackup' name: 'nobackup'
}); });
me.column2.push({
xtype: 'pvecheckbox',
fieldLabel: gettext('Discard'),
name: 'discard'
});
me.callParent(); me.callParent();
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment