[PATCH v3 04/10] qemu-kvm: Use upstream kvm_irqchip_create

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Drop kvm_create_irqchip in favor of the equivalent upstream version.
This also allows to drop the kvm_irqchip global variable.

Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
---
 kvm-all.c  |   15 ---------------
 qemu-kvm.c |   29 -----------------------------
 qemu-kvm.h |    3 ---
 vl.c       |    1 -
 4 files changed, 0 insertions(+), 48 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 526bb77..7fed5c9 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -838,7 +838,6 @@ static void kvm_init_irq_routing(KVMState *s)
 
 static int kvm_irqchip_create(KVMState *s)
 {
-#ifdef UNUSED_UPSTREAM_KVM
     QemuOptsList *list = qemu_find_opts("machine");
     int ret;
 
@@ -862,7 +861,6 @@ static int kvm_irqchip_create(KVMState *s)
     kvm_kernel_irqchip = true;
 
     kvm_init_irq_routing(s);
-#endif
 
     return 0;
 }
@@ -876,7 +874,6 @@ int kvm_init(void)
     const KVMCapabilityInfo *missing_cap;
     int ret;
     int i;
-    QemuOptsList *list;
 
     s = g_malloc0(sizeof(KVMState));
 
@@ -963,13 +960,6 @@ int kvm_init(void)
     s->pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);
 #endif
 
-    list = qemu_find_opts("machine");
-    if (!QTAILQ_EMPTY(&list->head) &&
-        !qemu_opt_get_bool(QTAILQ_FIRST(&list->head),
-                           "kernel_irqchip", false)) {
-        kvm_irqchip = 0;
-    }
-
     ret = kvm_arch_init(s);
     if (ret < 0) {
         goto err;
@@ -985,11 +975,6 @@ int kvm_init(void)
 
     s->many_ioeventfds = kvm_check_many_ioeventfds();
 
-    ret = kvm_create_irqchip(s);
-    if (ret < 0) {
-        return ret;
-    }
-
     cpu_interrupt_handler = kvm_handle_interrupt;
 
     return 0;
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 6cfe6fe..6c475dd 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -41,35 +41,6 @@ static inline void clear_gsi(KVMState *s, unsigned int gsi)
     }
 }
 
-int kvm_create_irqchip(KVMState *s)
-{
-#ifdef KVM_CAP_IRQCHIP
-    int r;
-
-    if (!kvm_irqchip || !kvm_check_extension(s, KVM_CAP_IRQCHIP)) {
-        return 0;
-    }
-
-    r = kvm_vm_ioctl(s, KVM_CREATE_IRQCHIP);
-    if (r < 0) {
-        fprintf(stderr, "Create kernel PIC irqchip failed\n");
-        return r;
-    }
-
-    s->irqchip_inject_ioctl = KVM_IRQ_LINE;
-#if defined(KVM_CAP_IRQ_INJECT_STATUS) && defined(KVM_IRQ_LINE_STATUS)
-    if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) {
-        s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS;
-    }
-#endif
-    kvm_kernel_irqchip = true;
-
-    kvm_init_irq_routing(s);
-#endif
-
-    return 0;
-}
-
 #ifdef KVM_CAP_IRQCHIP
 
 int kvm_set_irq(int irq, int level, int *status)
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 6235800..cd5e3cc 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -32,8 +32,6 @@
 
 #include "kvm.h"
 
-int kvm_create_irqchip(KVMState *s);
-
 /*!
  * \brief Dump in kernel IRQCHIP contents
  *
@@ -243,7 +241,6 @@ int kvm_arch_set_ioport_access(unsigned long start, unsigned long size,
 
 int kvm_create_pit(KVMState *s);
 
-extern int kvm_irqchip;
 extern int kvm_pit_reinject;
 extern unsigned int kvm_shadow_memory;
 
diff --git a/vl.c b/vl.c
index 124cff1..ef765a7 100644
--- a/vl.c
+++ b/vl.c
@@ -2246,7 +2246,6 @@ static void free_and_trace(gpointer mem)
 }
 
 #ifdef CONFIG_KVM_OPTIONS
-int kvm_irqchip = 1;
 int kvm_pit_reinject = 1;
 #endif
 
-- 
1.7.3.4

--
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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux