From 138499f88665110e273f9019237bc283e8a1d2bf Mon Sep 17 00:00:00 2001 From: Yuanyuan Zhao Date: Wed, 31 Aug 2022 16:36:45 +0800 Subject: [PATCH] config_tools: add own_pcpu widget Add "exclusively owns physical CPUs" checkbox to pre-launched VMs and post-launched VMs. RTVM will not display this checkbox. If this checkbox is set, the VM will use all the pCPUs assigned to it alone. Tracked-On: #8253 Signed-off-by: Yuanyuan Zhao Reviewed-by: Junjie Mao --- .../ConfigForm/CustomWidget/cpu_affinity.vue | 30 +++++++++++++++++++ .../schema/checks/cpu_assignment.xsd | 7 +++++ misc/config_tools/schema/config.xsd | 5 ++++ 3 files changed, 42 insertions(+) diff --git a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue index 034d3c7f4..75939d193 100644 --- a/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue +++ b/misc/config_tools/configurator/packages/configurator/src/pages/Config/ConfigForm/CustomWidget/cpu_affinity.vue @@ -3,6 +3,26 @@ {{ uiOptions.title }}
+ + + own_pcpu + + + + + + + + @@ -119,9 +139,15 @@ export default { isRTVM() { return vueUtils.getPathVal(this.rootFormData, 'vm_type') === 'RTVM' }, + is_std_vm() { + return vueUtils.getPathVal(this.rootFormData, 'vm_type') === 'STANDARD_VM' + }, pcpuid_enum() { return window.getCurrentFormSchemaData().BasicConfigType.definitions.CPUAffinityConfiguration.properties.pcpu_id }, + pcpu_owned() { + return vueUtils.getPathVal(this.rootFormData, 'own_pcpu') + }, uiOptions() { return formUtils.getUiOptions({ schema: this.schema, @@ -151,6 +177,10 @@ export default { addPCPU(index) { this.defaultVal.pcpu.splice(index + 1, 0, {pcpu_id: null, real_time_vcpu: "n"}) }, + click_own_pcpu() { + let newValue = this.pcpu_owned === 'y' ? 'n' : 'y'; + vueUtils.setPathVal(this.rootFormData, 'own_pcpu', newValue) + }, removePCPU(index) { if (this.defaultVal.pcpu.length === 1) { // prevent delete for the last one diff --git a/misc/config_tools/schema/checks/cpu_assignment.xsd b/misc/config_tools/schema/checks/cpu_assignment.xsd index b08901100..0629a9cd2 100644 --- a/misc/config_tools/schema/checks/cpu_assignment.xsd +++ b/misc/config_tools/schema/checks/cpu_assignment.xsd @@ -25,6 +25,13 @@ + + + Physical CPU {$pcpu} is assigned to a VM "[{$pcpu/ancestor::vm/name}]" exclusively owns the physical CPUs assigned to it. Look for, and probably remove, any affinity assignments to CPU {$pcpu} in these VMs {//vm[cpu_affinity//pcpu_id = $pcpu and name != $pcpu/ancestor::vm/name]/name} settings. + + + diff --git a/misc/config_tools/schema/config.xsd b/misc/config_tools/schema/config.xsd index 974af8bd9..19c7dfd51 100644 --- a/misc/config_tools/schema/config.xsd +++ b/misc/config_tools/schema/config.xsd @@ -370,6 +370,11 @@ These settings can only be changed at build time. + + + Enable a VM exclusively owns the physical CPUs assigned to it. + + Select a subset of physical CPUs that this VM can use. More than one can be selected.