[PATCH 18/19] qemu-kvm: Fold kvm_init_coalesced_mmio into kvm_create_context

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

 



From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>

Aligns the initialization to upstream.

Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
---
 qemu-kvm-x86.c |    5 -----
 qemu-kvm.c     |   20 ++++++--------------
 qemu-kvm.h     |    9 ---------
 3 files changed, 6 insertions(+), 28 deletions(-)

diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
index df4f0b4..ece5a8e 100644
--- a/qemu-kvm-x86.c
+++ b/qemu-kvm-x86.c
@@ -152,11 +152,6 @@ int kvm_arch_create(kvm_context_t kvm)
         return r;
     }
 
-    r = kvm_init_coalesced_mmio(kvm);
-    if (r < 0) {
-        return r;
-    }
-
     uname(&utsname);
     lm_capable_kernel = strcmp(utsname.machine, "x86_64") == 0;
 
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 55de971..3001392 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -495,20 +495,6 @@ int kvm_inject_nmi(CPUState *env)
 #endif
 }
 
-int kvm_init_coalesced_mmio(kvm_context_t kvm)
-{
-    int r = 0;
-    kvm_state->coalesced_mmio = 0;
-#ifdef KVM_CAP_COALESCED_MMIO
-    r = kvm_ioctl(kvm_state, KVM_CHECK_EXTENSION, KVM_CAP_COALESCED_MMIO);
-    if (r > 0) {
-        kvm_state->coalesced_mmio = r;
-        return 0;
-    }
-#endif
-    return r;
-}
-
 #ifdef KVM_CAP_DEVICE_ASSIGNMENT
 int kvm_assign_pci_device(kvm_context_t kvm,
                           struct kvm_assigned_pci_dev *assigned_dev)
@@ -1419,6 +1405,12 @@ static int kvm_create_context(void)
         return r;
     }
 
+    kvm_state->coalesced_mmio = 0;
+#ifdef KVM_CAP_COALESCED_MMIO
+    kvm_state->coalesced_mmio =
+        kvm_check_extension(kvm_state, KVM_CAP_COALESCED_MMIO);
+#endif
+
     kvm_state->vcpu_events = 0;
 #ifdef KVM_CAP_VCPU_EVENTS
     kvm_state->vcpu_events = kvm_check_extension(kvm_state, KVM_CAP_VCPU_EVENTS);
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 752aebd..1644582 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -200,15 +200,6 @@ int kvm_inject_nmi(CPUState *env);
 
 #endif
 
-/*!
- * \brief Initialize coalesced MMIO
- *
- * Check for coalesced MMIO capability and store in context
- *
- * \param kvm Pointer to the current kvm_context
- */
-int kvm_init_coalesced_mmio(kvm_context_t kvm);
-
 #ifdef KVM_CAP_PIT
 
 #if defined(__i386__) || defined(__x86_64__)
-- 
1.7.1

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