vm_config: pre-launched VM must have higher severity than SOS

If pre-launched VM co-exist with SOS, it must has higher severity
than SOS.

Tracked-On: #5615
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
This commit is contained in:
Tao Yuhong 2021-02-01 07:14:35 -05:00 committed by wenlingz
parent d4aaf99d86
commit bc40e455aa

View File

@ -130,7 +130,13 @@ bool sanitize_vm_config(void)
} else if (is_safety_vm_uuid(vm_config->uuid) && (vm_config->severity != (uint8_t)SEVERITY_SAFETY_VM)) {
ret = false;
} else {
/* nothing to do here */
#if (SOS_VM_NUM == 1U)
if (vm_config->severity <= SEVERITY_SOS) {
/* If there are both SOS and Pre-launched VM, make sure pre-launched VM has higher severity than SOS */
printf("%s: pre-launched vm doesn't has higher severity than SOS \n", __func__);
ret = false;
}
#endif
}
break;
case SOS_VM: