vm: add necessary dummy APIs

get_vm_from_vmid,is_paused_vm and is_poweroff_vm should be common APIs.
But now doesn't implement them as common for not introduce more VM related
data structure and APIs.

Tracked-On: #8805
Signed-off-by: Fei Li <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Fei Li
2025-09-23 21:06:57 +08:00
committed by acrnsi-robot
parent ac1c79641e
commit 83d56e0edb
14 changed files with 68 additions and 20 deletions

View File

@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef VM_H_
#define VM_H_
#ifndef X86_VM_H_
#define X86_VM_H_
/* Defines for VM Launch and Resume */
#define VM_RESUME 0
@@ -250,14 +250,11 @@ int32_t reset_vm(struct acrn_vm *vm, enum reset_mode mode);
int32_t create_vm(uint16_t vm_id, uint64_t pcpu_bitmap, struct acrn_vm_config *vm_config, struct acrn_vm **rtn_vm);
int32_t prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config);
void launch_vms(uint16_t pcpu_id);
bool is_poweroff_vm(const struct acrn_vm *vm);
bool is_created_vm(const struct acrn_vm *vm);
bool is_paused_vm(const struct acrn_vm *vm);
bool is_service_vm(const struct acrn_vm *vm);
bool is_postlaunched_vm(const struct acrn_vm *vm);
bool is_prelaunched_vm(const struct acrn_vm *vm);
uint16_t get_vmid_by_name(const char *name);
struct acrn_vm *get_vm_from_vmid(uint16_t vm_id);
struct acrn_vm *get_service_vm(void);
void create_service_vm_e820(struct acrn_vm *vm);
@@ -300,4 +297,4 @@ void put_vm_lock(struct acrn_vm *vm);
void *get_sworld_memory_base(void);
#endif /* !ASSEMBLER */
#endif /* VM_H_ */
#endif /* X86_VM_H_ */

View File

@@ -0,0 +1,21 @@
/*
* Copyright (C) 2023-2025 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef VM_H_
#define VM_H_
#include <asm/guest/vm.h>
struct acrn_vm *get_vm_from_vmid(__unused uint16_t vm_id);
bool is_paused_vm(__unused const struct acrn_vm *vm);
bool is_poweroff_vm(__unused const struct acrn_vm *vm);
void arch_trigger_level_intr(__unused struct acrn_vm *vm,
__unused uint32_t irq, __unused bool assert);
#endif /* VM_H_ */