Skip to content

Commit

Permalink
KVM: pass struct kvm to kvm_set_routing_entry
Browse files Browse the repository at this point in the history
Arch-specific code will use it.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
rkrcmar authored and bonzini committed Jul 14, 2016
1 parent 4d8e772 commit c63cf53
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion arch/powerpc/kvm/mpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,8 @@ int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
return 0;
}

int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
int kvm_set_routing_entry(struct kvm *kvm,
struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue)
{
int r = -EINVAL;
Expand Down
3 changes: 2 additions & 1 deletion arch/s390/kvm/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,8 @@ static int set_adapter_int(struct kvm_kernel_irq_routing_entry *e,
return ret;
}

int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
int kvm_set_routing_entry(struct kvm *kvm,
struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue)
{
int ret;
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kvm/irq_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ static int kvm_hv_set_sint(struct kvm_kernel_irq_routing_entry *e,
return kvm_hv_synic_set_irq(kvm, e->hv_sint.vcpu, e->hv_sint.sint);
}

int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
int kvm_set_routing_entry(struct kvm *kvm,
struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue)
{
int r = -EINVAL;
Expand Down
3 changes: 2 additions & 1 deletion include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,8 @@ int kvm_set_irq_routing(struct kvm *kvm,
const struct kvm_irq_routing_entry *entries,
unsigned nr,
unsigned flags);
int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
int kvm_set_routing_entry(struct kvm *kvm,
struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue);
void kvm_free_irq_routing(struct kvm *kvm);

Expand Down
7 changes: 4 additions & 3 deletions virt/kvm/irqchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ void kvm_free_irq_routing(struct kvm *kvm)
free_irq_routing_table(rt);
}

static int setup_routing_entry(struct kvm_irq_routing_table *rt,
static int setup_routing_entry(struct kvm *kvm,
struct kvm_irq_routing_table *rt,
struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue)
{
Expand All @@ -154,7 +155,7 @@ static int setup_routing_entry(struct kvm_irq_routing_table *rt,

e->gsi = ue->gsi;
e->type = ue->type;
r = kvm_set_routing_entry(e, ue);
r = kvm_set_routing_entry(kvm, e, ue);
if (r)
goto out;
if (e->type == KVM_IRQ_ROUTING_IRQCHIP)
Expand Down Expand Up @@ -211,7 +212,7 @@ int kvm_set_irq_routing(struct kvm *kvm,
kfree(e);
goto out;
}
r = setup_routing_entry(new, e, ue);
r = setup_routing_entry(kvm, new, e, ue);
if (r) {
kfree(e);
goto out;
Expand Down

0 comments on commit c63cf53

Please sign in to comment.