acrn-hypervisor/hypervisor/arch/x86/configs/vm_config.c
Ziheng Li eb8bcb06b3 Update copyright year range in code headers
Modified the copyright year range in code, and corrected "int32_tel"
into "Intel" in two "hypervisor/include/debug/profiling.h" and
"hypervisor/include/debug/profiling_internal.h".

Tracked-On: #7559
Signed-off-by: Ziheng Li <ziheng.li@intel.com>
2022-07-15 11:48:35 +08:00

39 lines
718 B
C

/*
* Copyright (C) 2018-2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <asm/vm_config.h>
#include <util.h>
#include <rtl.h>
/*
* @pre vm_id < CONFIG_MAX_VM_NUM
* @post return != NULL
*/
struct acrn_vm_config *get_vm_config(uint16_t vm_id)
{
return &vm_configs[vm_id];
}
/*
* @pre vm_id < CONFIG_MAX_VM_NUM
*/
uint8_t get_vm_severity(uint16_t vm_id)
{
return vm_configs[vm_id].severity;
}
/**
* return true if the input vm-name is configured in VM
*
* @pre vmid < CONFIG_MAX_VM_NUM
*/
bool vm_has_matched_name(uint16_t vmid, const char *name)
{
struct acrn_vm_config *vm_config = get_vm_config(vmid);
return (strncmp(vm_config->name, name, MAX_VM_NAME_LEN) == 0);
}