summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlauber Costa <glommer@redhat.com>2009-10-09 15:03:09 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2009-10-13 14:01:05 -0300
commit805c4686abe97f717f392f2bc9b7483c8e141ea3 (patch)
tree8a1cafbe93bb965cc44e32edc43e49dedb8a7a19 /qemu-kvm-x86.c
parentinclude stdlib.h in qemu-kvm.h (diff)
downloadqemu-kvm-805c4686abe97f717f392f2bc9b7483c8e141ea3.tar.gz
qemu-kvm-805c4686abe97f717f392f2bc9b7483c8e141ea3.tar.bz2
qemu-kvm-805c4686abe97f717f392f2bc9b7483c8e141ea3.zip
use a more upstream friendly version of irqchip-in-kernel test
Upstream now has tests for irqchip_in_kernel. It differs from our signature, as it does not take any parameter. For consistency, convert our usage. Also, use a field in KVMState to store it, so we can have the exact same function as qemu upstream does. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'qemu-kvm-x86.c')
-rw-r--r--qemu-kvm-x86.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index acb1b919a..a44ae67ed 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -284,7 +284,7 @@ int kvm_destroy_memory_alias(kvm_context_t kvm, uint64_t phys_start)
int kvm_get_lapic(kvm_vcpu_context_t vcpu, struct kvm_lapic_state *s)
{
int r;
- if (!kvm_irqchip_in_kernel(vcpu->kvm))
+ if (!kvm_irqchip_in_kernel())
return 0;
r = ioctl(vcpu->fd, KVM_GET_LAPIC, s);
if (r == -1) {
@@ -297,7 +297,7 @@ int kvm_get_lapic(kvm_vcpu_context_t vcpu, struct kvm_lapic_state *s)
int kvm_set_lapic(kvm_vcpu_context_t vcpu, struct kvm_lapic_state *s)
{
int r;
- if (!kvm_irqchip_in_kernel(vcpu->kvm))
+ if (!kvm_irqchip_in_kernel())
return 0;
r = ioctl(vcpu->fd, KVM_SET_LAPIC, s);
if (r == -1) {
@@ -1376,7 +1376,7 @@ int kvm_arch_halt(void *opaque, kvm_vcpu_context_t vcpu)
void kvm_arch_pre_kvm_run(void *opaque, CPUState *env)
{
- if (!kvm_irqchip_in_kernel(kvm_context))
+ if (!kvm_irqchip_in_kernel())
kvm_set_cr8(env->kvm_cpu_state.vcpu_ctx, cpu_get_apic_tpr(env));
}
@@ -1440,7 +1440,7 @@ void kvm_arch_cpu_reset(CPUState *env)
{
kvm_arch_load_regs(env);
if (!cpu_is_bsp(env)) {
- if (kvm_irqchip_in_kernel(kvm_context)) {
+ if (kvm_irqchip_in_kernel()) {
#ifdef KVM_CAP_MP_STATE
kvm_reset_mpstate(env->kvm_cpu_state.vcpu_ctx);
#endif