config_tools: filter all pre launched pcpu for service vm's cat data

filter all pre launched pcpu for service vm's cat data

Tracked-On: #6691
Signed-off-by: Weiyi Feng <weiyix.feng@intel.com>
This commit is contained in:
Weiyi Feng 2022-05-31 17:19:14 +08:00 committed by acrnsi-robot
parent 73e8a2fcc9
commit 0c80f44383
1 changed files with 11 additions and 6 deletions

View File

@ -334,6 +334,7 @@ export default {
*/
let pcpu_vms = {}
let serviceVM = null;
let preLaunchedVMCPUIDs = [];
window.getCurrentScenarioData().vm.map((vmConfig) => {
// if this vm is service vm, we got it and skip it
@ -353,6 +354,11 @@ export default {
// now, we got pre/post vm config with cpu affinity data here
if (vmConfig.load_order === 'PRE_LAUNCHED_VM') {
preLaunchedVMCPUIDs = preLaunchedVMCPUIDs.concat(vmConfig.cpu_affinity.pcpu)
return;
}
// if vcat is enabled in hv, we need to check current vm is enabled vcat
// noinspection JSUnresolvedVariable
if (
@ -391,12 +397,11 @@ export default {
let serviceVMCPUIndex = 0;
let schemaData = window.getSchemaData()
schemaData.HV.BasicConfigType.definitions.CPUAffinityConfiguration.properties.pcpu_id.enum.map((pcpu_id) => {
if (pcpu_vms.hasOwnProperty(pcpu_id)) {
if (pcpu_vms[pcpu_id].y.length !== 0) {
// ignore pcpu_id which has rt vm enabled
return
}
} else {
// if pcpu_id in preLaunchedVMCPUIDs, it's used by pre launched vm, we need skip it
if (preLaunchedVMCPUIDs.indexOf(pcpu_id) !== -1) {
return;
}
if (!pcpu_vms.hasOwnProperty(pcpu_id)) {
pcpu_vms[pcpu_id] = {'y': [], 'n': []}
}
pcpu_vms[pcpu_id].n.push({