hv: return pre-defined vcpu_num from HV to upper layer

There is plan that define each VM configuration statically in HV and let
DM just do VM creating and destroying. So DM need get vcpu_num
information when VM creating.

This patch return the vcpu_num via the API param. And also initial the
VMs' cpu_num for existing scenarios.

Tracked-On: #3663
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Signed-off-by: Yu Wang <yu1.wang@intel.com>
Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shuo A Liu
2019-05-21 15:58:23 +08:00
committed by ACRN System Integration
parent 59e39c5fbb
commit ca2540fe8c
8 changed files with 17 additions and 1 deletions

View File

@@ -175,10 +175,11 @@ int32_t hcall_create_vm(struct acrn_vm *vm, uint64_t param)
} else {
/* return a relative vm_id from SOS view */
cv.vmid = vmid_2_rel_vmid(vm->vm_id, vm_id);
cv.vcpu_num = vm_config->vcpu_num;
ret = 0;
}
if (copy_to_gpa(vm, &cv.vmid, param, sizeof(cv.vmid)) != 0) {
if (copy_to_gpa(vm, &cv, param, sizeof(cv)) != 0) {
pr_err("%s: Unable copy param to vm\n", __func__);
ret = -1;
}