diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-20 15:13:43 +0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 12:35:41 -0300 |
commit | 980da6ce573b7c40886406674ff8f022a975e65e (patch) | |
tree | b8751c6b766e937ea137d84a48d248b63c2ac02d /virt/kvm/kvm_main.c | |
parent | 50eb2a3cd0f50d912b26d0b79b7f443344608390 (diff) | |
download | linux-3.10-980da6ce573b7c40886406674ff8f022a975e65e.tar.gz linux-3.10-980da6ce573b7c40886406674ff8f022a975e65e.tar.bz2 linux-3.10-980da6ce573b7c40886406674ff8f022a975e65e.zip |
KVM: Simplify coalesced mmio initialization
- add destructor function
- move related allocation into constructor
- add stubs for !CONFIG_KVM_MMIO
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index c10d117c431..bc23b8e0609 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -51,9 +51,7 @@ #include <asm/pgtable.h> #include <asm-generic/bitops/le.h> -#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET #include "coalesced_mmio.h" -#endif #define CREATE_TRACE_POINTS #include <trace/events/kvm.h> @@ -468,10 +466,7 @@ static void kvm_destroy_vm(struct kvm *kvm) kvm_free_irq_routing(kvm); kvm_io_bus_destroy(&kvm->pio_bus); kvm_io_bus_destroy(&kvm->mmio_bus); -#ifdef KVM_COALESCED_MMIO_PAGE_OFFSET - if (kvm->coalesced_mmio_ring != NULL) - free_page((unsigned long)kvm->coalesced_mmio_ring); -#endif + kvm_coalesced_mmio_free(kvm); #if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) mmu_notifier_unregister(&kvm->mmu_notifier, kvm->mm); #else |