HV: show correct vm name per config

The patch will show correct VM name per its configuration. As we do not
validate vm id when call get_vm_from_vmid() any more, we only show VM's
states which their VM type are defined;

If VM name is not configured in config file, then the name is specified
with vm id, i.e. "ACRN VM_(vm id)"

Tracked-On: #2291

Signed-off-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2019-01-21 12:29:49 +08:00
committed by Eddie Dong
parent e6117e0d5b
commit f3014a3c89
2 changed files with 17 additions and 16 deletions

View File

@@ -141,6 +141,10 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
hva2hpa(ept_mem_ops->get_sworld_memory_base(ept_mem_ops->info)),
TRUSTY_EPT_REBASE_GPA, TRUSTY_RAM_SIZE, EPT_WB | EPT_RWX);
}
if (vm_config->name[0] == '\0') {
/* if VM name is not configured, specify with VM ID */
snprintf(vm_config->name, 16, "ACRN VM_%d", vm_id);
}
(void)memcpy_s(&vm->GUID[0], sizeof(vm->GUID),
&vm_config->GUID[0], sizeof(vm_config->GUID));
@@ -411,7 +415,7 @@ void prepare_vm(uint16_t vm_id, struct acrn_vm_config *vm_config)
/* start vm BSP automatically */
start_vm(vm);
pr_acrnlog("Start VM%x", vm->vm_id);
pr_acrnlog("Start VM id: %x name: %s", vm_id, vm_config->name);
}
}