[PATCH 10/16] qemu-kvm: Fold kvm_set_irq_level into kvm_set_irq

Jan Kiszka
2011-05-13T12:14:15Z

qemu-kvm.c | 19 ++++++-------------
qemu-kvm.h | 2 --
2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 98bb765..4aa6b0f 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -278,7 +278,7 @@ int kvm_create_irqchip(kvm_context_t kvm)

#ifdef KVM_CAP_IRQCHIP

-int kvm_set_irq_level(kvm_context_t kvm, int irq, int level, int *status)
+int kvm_set_irq(int irq, int level, int *status)
{
struct kvm_irq_level event;
int r;
@@ -288,15 +288,17 @@ int kvm_set_irq_level(kvm_context_t kvm, int irq, int level, int *status)
}
event.level = level;
event.irq = irq;
- r = kvm_vm_ioctl(kvm_state, kvm->irqchip_inject_ioctl, &event);
+ r = kvm_vm_ioctl(kvm_state, kvm_state->kvm_context.irqchip_inject_ioctl,
+ &event);
if (r < 0) {
- perror("kvm_set_irq_level");
+ perror("kvm_set_irq");
}

if (status) {
#ifdef KVM_CAP_IRQ_INJECT_STATUS
*status =
- (kvm->irqchip_inject_ioctl == KVM_IRQ_LINE) ? 1 : event.status;
+ (kvm_state->kvm_context.irqchip_inject_ioctl == KVM_IRQ_LINE) ?
+ 1 : event.status;
#else
*status = 1;
#endif
@@ -1438,15 +1440,6 @@ static int kvm_create_context(void)
return 0;
}

-#ifdef KVM_CAP_IRQCHIP
-
-int kvm_set_irq(int irq, int level, int *status)
-{
- return kvm_set_irq_level(kvm_context, irq, level, status);
-}
-
-#endif
-
static void kvm_mutex_unlock(void)
{
assert(!cpu_single_env);
diff --git a/qemu-kvm.h b/qemu-kvm.h
index b101c03..dd11e32 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -93,8 +93,6 @@ int kvm_is_ready_for_interrupt_injection(CPUState *env);
int kvm_inject_irq(CPUState *env, unsigned irq);
#endif

-int kvm_set_irq_level(kvm_context_t kvm, int irq, int level, int *status);
-
#ifdef KVM_CAP_IRQCHIP
/*!
* \brief Dump in kernel IRQCHIP contents
--
1.7.1