From 51f0ac63812abf41d3a9284a272c6275d7318705 Mon Sep 17 00:00:00 2001 From: Roman Kagan Date: Fri, 21 Sep 2018 11:20:38 +0300 Subject: 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 Message-Id: <20180921082041.29380-3-rkagan@virtuozzo.com> Signed-off-by: Paolo Bonzini --- target/i386/hyperv.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'target/i386/hyperv.c') diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index fc537e7..6881664 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -27,14 +27,11 @@ struct HvSintRoute { unsigned refcount; }; -uint32_t hyperv_vp_index(X86CPU *cpu) +static X86CPU *hyperv_find_vcpu(uint32_t vp_index) { - return CPU(cpu)->cpu_index; -} - -X86CPU *hyperv_find_vcpu(uint32_t vp_index) -{ - return X86_CPU(qemu_get_cpu(vp_index)); + X86CPU *cpu = X86_CPU(qemu_get_cpu(vp_index)); + assert(hyperv_vp_index(cpu) == vp_index); + return cpu; } int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) -- cgit v1.1