Commit 0fe6353e authored by Timo Grodzinski's avatar Timo Grodzinski Committed by Dietmar Maurer

Adds configuration of disk io op/s and byte/s limits

Signed-off-by: 's avatarTimo Grodzinski <t.grodzinski@profihost.ag>
parent c9e4cdc9
......@@ -81,7 +81,7 @@ Ext.define('PVE.Parser', { statics: {
if (!p || p.match(/^\s*$/)) {
return; // continue
}
var match_res = p.match(/^([a-z]+)=(\S+)$/);
var match_res = p.match(/^([a-z_]+)=(\S+)$/);
if (!match_res) {
if (!p.match(/\=/)) {
res.file = p;
......
......@@ -39,6 +39,27 @@ Ext.define('PVE.qemu.HDInputPanel', {
delete me.drive.backup;
}
if (values.bps_rd) {
me.drive.bps_rd = values.bps_rd;
} else {
delete me.drive.bps_rd;
}
if (values.bps_wr) {
me.drive.bps_wr = values.bps_wr;
} else {
delete me.drive.bps_wr;
}
if (values.iops_rd) {
me.drive.iops_rd = values.iops_rd;
} else {
delete me.drive.iops_rd;
}
if (values.iops_wr) {
me.drive.iops_wr = values.iops_wr;
} else {
delete me.drive.iops_wr;
}
var params = {};
params[confid] = PVE.Parser.printQemuDrive(me.drive);
......@@ -81,6 +102,10 @@ Ext.define('PVE.qemu.HDInputPanel', {
values.nobackup = (drive.backup === 'no');
values.diskformat = drive.format || 'raw';
values.cache = drive.cache || '';
values.bps_rd = drive.bps_rd || 0;
values.bps_wr = drive.bps_wr || 0;
values.iops_rd = drive.iops_rd || 0;
values.iops_wr = drive.iops_wr || 0;
me.setValues(values);
},
......@@ -211,6 +236,40 @@ Ext.define('PVE.qemu.HDInputPanel', {
});
}
me.bps_rd = Ext.widget('numberfield', {
name: 'bps_rd',
minValue: 0,
value: '0',
fieldLabel: gettext('Read IO (byte/s)'),
allowBlank: false
});
me.column2.push(me.bps_rd);
me.bps_wr = Ext.widget('numberfield', {
name: 'bps_wr',
minValue: 0,
value: '0',
fieldLabel: gettext('Write IO (byte/s)'),
allowBlank: false
});
me.column2.push(me.bps_wr);
me.iops_rd = Ext.widget('numberfield', {
name: 'iops_rd',
minValue: 0,
value: '0',
fieldLabel: gettext('Read IO (ops/s)'),
allowBlank: false
});
me.column2.push(me.iops_rd);
me.iops_wr = Ext.widget('numberfield', {
name: 'iops_wr',
minValue: 0,
value: '0',
fieldLabel: gettext('Write IO (ops/s)'),
allowBlank: false
});
me.column2.push(me.iops_wr);
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