mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-05 05:32:05 +00:00
HV: vm_load: refine vm_sw_loader API
Change if condition to switch in vm_sw_loader() so that the sw loader could be compiled conditionally. Tracked-On: #6323 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
03fa036642
commit
aaa568ed9a
@ -485,20 +485,20 @@ static int32_t vm_rawimage_loader(struct acrn_vm *vm)
|
|||||||
*/
|
*/
|
||||||
int32_t vm_sw_loader(struct acrn_vm *vm)
|
int32_t vm_sw_loader(struct acrn_vm *vm)
|
||||||
{
|
{
|
||||||
int32_t ret = 0;
|
int32_t ret = -EINVAL;
|
||||||
/* get primary vcpu */
|
/* get primary vcpu */
|
||||||
struct acrn_vcpu *vcpu = vcpu_from_vid(vm, BSP_CPU_ID);
|
struct acrn_vcpu *vcpu = vcpu_from_vid(vm, BSP_CPU_ID);
|
||||||
|
|
||||||
if (vm->sw.kernel_type == KERNEL_BZIMAGE) {
|
switch (vm->sw.kernel_type) {
|
||||||
|
case KERNEL_BZIMAGE:
|
||||||
ret = vm_bzimage_loader(vm);
|
ret = vm_bzimage_loader(vm);
|
||||||
|
break;
|
||||||
} else if (vm->sw.kernel_type == KERNEL_RAWIMAGE){
|
case KERNEL_RAWIMAGE:
|
||||||
|
|
||||||
ret = vm_rawimage_loader(vm);
|
ret = vm_rawimage_loader(vm);
|
||||||
|
break;
|
||||||
} else {
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user