result = "CH " +
Ext.String.leftPad(data.channel, 2, '0') +
" ID " + data.id + " LUN " + data.lun;
+ } else if (data.content === 'import') {
+ result = data.volid.replace(/^.*?:/, '');
} else {
result = data.volid.replace(/^.*?:(.*?\/)?/, '');
}
}
},
- mp_counts: {
+ lxc_mp_counts: {
mp: 256,
unused: 256,
},
- forEachMP: function(func, includeUnused) {
- for (let i = 0; i < PVE.Utils.mp_counts.mp; i++) {
- let cont = func('mp', i);
+ forEachLxcMP: function(func, includeUnused) {
+ for (let i = 0; i < PVE.Utils.lxc_mp_counts.mp; i++) {
+ let cont = func('mp', i, `mp${i}`);
if (!cont && cont !== undefined) {
return;
}
return;
}
- for (let i = 0; i < PVE.Utils.mp_counts.unused; i++) {
- let cont = func('unused', i);
+ for (let i = 0; i < PVE.Utils.lxc_mp_counts.unused; i++) {
+ let cont = func('unused', i, `unused${i}`);
+ if (!cont && cont !== undefined) {
+ return;
+ }
+ }
+ },
+
+ lxc_dev_count: 256,
+
+ forEachLxcDev: function(func) {
+ for (let i = 0; i < PVE.Utils.lxc_dev_count; i++) {
+ let cont = func(i, `dev${i}`);
if (!cont && cont !== undefined) {
return;
}
return undefined;
},
- nextFreeMP: function(type, config) {
- for (let i = 0; i < PVE.Utils.mp_counts[type]; i++) {
+ nextFreeLxcMP: function(type, config) {
+ for (let i = 0; i < PVE.Utils.lxc_mp_counts[type]; i++) {
let confid = `${type}${i}`;
if (!Ext.isDefined(config[confid])) {
return {