hyperv: make hyperv_vp_index inline
Also make the inverse function, hyperv_find_vcpu, static as it's not used outside hyperv.c This paves the way to making hyperv.c built optionally. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> Message-Id: <20180921082041.29380-3-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5116122af7
commit
51f0ac6381
|
@ -27,14 +27,11 @@ struct HvSintRoute {
|
||||||
unsigned refcount;
|
unsigned refcount;
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t hyperv_vp_index(X86CPU *cpu)
|
static X86CPU *hyperv_find_vcpu(uint32_t vp_index)
|
||||||
{
|
{
|
||||||
return CPU(cpu)->cpu_index;
|
X86CPU *cpu = X86_CPU(qemu_get_cpu(vp_index));
|
||||||
}
|
assert(hyperv_vp_index(cpu) == vp_index);
|
||||||
|
return cpu;
|
||||||
X86CPU *hyperv_find_vcpu(uint32_t vp_index)
|
|
||||||
{
|
|
||||||
return X86_CPU(qemu_get_cpu(vp_index));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
|
int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)
|
||||||
|
|
|
@ -30,7 +30,9 @@ void hyperv_sint_route_unref(HvSintRoute *sint_route);
|
||||||
|
|
||||||
int hyperv_sint_route_set_sint(HvSintRoute *sint_route);
|
int hyperv_sint_route_set_sint(HvSintRoute *sint_route);
|
||||||
|
|
||||||
uint32_t hyperv_vp_index(X86CPU *cpu);
|
static inline uint32_t hyperv_vp_index(X86CPU *cpu)
|
||||||
X86CPU *hyperv_find_vcpu(uint32_t vp_index);
|
{
|
||||||
|
return CPU(cpu)->cpu_index;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue