Convert header of public functions that access kvm_run, so they can use CPUState version instead. Signed-off-by: Glauber Costa <glommer@xxxxxxxxxx> --- qemu-kvm-x86.c | 4 ++-- qemu-kvm.c | 8 ++++---- qemu-kvm.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c index 10bd530..c5455d7 100644 --- a/qemu-kvm-x86.c +++ b/qemu-kvm-x86.c @@ -1379,7 +1379,7 @@ void kvm_arch_post_kvm_run(void *opaque, CPUState *env) { cpu_single_env = env; - env->eflags = kvm_get_interrupt_flag(env->kvm_cpu_state.vcpu_ctx) + env->eflags = kvm_get_interrupt_flag(env) ? env->eflags | IF_MASK : env->eflags & ~IF_MASK; cpu_set_apic_tpr(env, kvm_get_cr8(env)); @@ -1400,7 +1400,7 @@ int kvm_arch_try_push_interrupts(void *opaque) CPUState *env = cpu_single_env; int r, irq; - if (kvm_is_ready_for_interrupt_injection(env->kvm_cpu_state.vcpu_ctx) && + if (kvm_is_ready_for_interrupt_injection(env) && (env->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) { env->interrupt_request &= ~CPU_INTERRUPT_HARD; diff --git a/qemu-kvm.c b/qemu-kvm.c index a7eda2d..bd1c0b5 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -924,14 +924,14 @@ int pre_kvm_run(kvm_context_t kvm, CPUState *env) return 0; } -int kvm_get_interrupt_flag(kvm_vcpu_context_t vcpu) +int kvm_get_interrupt_flag(CPUState *env) { - return vcpu->run->if_flag; + return env->kvm_run->if_flag; } -int kvm_is_ready_for_interrupt_injection(kvm_vcpu_context_t vcpu) +int kvm_is_ready_for_interrupt_injection(CPUState *env) { - return vcpu->run->ready_for_interrupt_injection; + return env->kvm_run->ready_for_interrupt_injection; } int kvm_run(kvm_vcpu_context_t vcpu, void *env) diff --git a/qemu-kvm.h b/qemu-kvm.h index 1f23fe4..28940dd 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -216,7 +216,7 @@ int kvm_run(kvm_vcpu_context_t vcpu, void *env); * \param vcpu Which virtual CPU should get dumped * \return interrupt flag value (0 or 1) */ -int kvm_get_interrupt_flag(kvm_vcpu_context_t vcpu); +int kvm_get_interrupt_flag(CPUState *env); /*! * \brief Check if a vcpu is ready for interrupt injection @@ -227,7 +227,7 @@ int kvm_get_interrupt_flag(kvm_vcpu_context_t vcpu); * \param vcpu Which virtual CPU should get dumped * \return boolean indicating interrupt injection readiness */ -int kvm_is_ready_for_interrupt_injection(kvm_vcpu_context_t vcpu); +int kvm_is_ready_for_interrupt_injection(CPUState *env); /*! * \brief Read VCPU registers -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html