mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 04:33:55 +00:00
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>
39 lines
718 B
C
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);
|
|
}
|