refine definition for foreach_vcpu

foreach_vcpu will go through all vcpu_array and only call the following
code when vcpu != NULL

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Jason Chen CJ 2018-07-02 16:38:21 +08:00 committed by lijinxia
parent 311787032a
commit 22833787ce
1 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,9 @@
#define foreach_vcpu(idx, vm, vcpu) \
for (idx = 0U, vcpu = vm->hw.vcpu_array[idx]; \
(idx < vm->hw.num_vcpus) && (vcpu != NULL); \
idx++, vcpu = vm->hw.vcpu_array[idx])
idx < vm->hw.num_vcpus; \
idx++, vcpu = vm->hw.vcpu_array[idx]) \
if (vcpu)
/* the index is matched with emulated msrs array*/
#define IDX_TSC_DEADLINE 0U