mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-10-09 11:03:41 +00:00
hv:cleanup vcpu_id compare with phys_cpu_num
Currently we compare vcpu_id with phys_cpu_num, vcpu_id is not related with phys_cpu_num, this patch cleanup them. Tracked-On: #861 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Li, Fei1 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
Xie, Nanlin
parent
3eb45b9bf6
commit
4afb6666b9
@@ -640,10 +640,7 @@ static int shell_vcpu_dumpreg(int argc, char **argv)
|
||||
}
|
||||
vm_id = (uint16_t)status;
|
||||
vcpu_id = (uint16_t)atoi(argv[2]);
|
||||
if (vcpu_id >= phys_cpu_num) {
|
||||
status = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
vm = get_vm_from_vmid(vm_id);
|
||||
if (vm == NULL) {
|
||||
shell_puts("No vm found in the input <vm_id, vcpu_id>\r\n");
|
||||
@@ -651,8 +648,8 @@ static int shell_vcpu_dumpreg(int argc, char **argv)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (vcpu_id >= CONFIG_MAX_VCPUS_PER_VM) {
|
||||
shell_puts("No vcpu found in the input <vm_id, vcpu_id>\r\n");
|
||||
if (vcpu_id >= vm->hw.created_vcpus) {
|
||||
shell_puts("vcpu id is out of range\r\n");
|
||||
status = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user