From cf746e3c4e2f0dfa8a58dbd1b6ca514f669cc56f Mon Sep 17 00:00:00 2001
From: Zhang Xiantao <xiantao.zhang@intel.com>
Date: Tue, 11 Dec 2007 20:45:48 +0800
Subject: [PATCH] kvm: Moving memslot_id to x86.h

Since it is not called in kvm_main.c, and it also will block
kvm structure split, so moved it out.
Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com>
---
 drivers/kvm/kvm.h |    5 -----
 drivers/kvm/x86.h |    5 +++++
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 668a830..17715b9 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -417,11 +417,6 @@ static inline void kvm_guest_exit(void)
 	current->flags &= ~PF_VCPU;
 }
 
-static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
-{
-	return slot - kvm->memslots;
-}
-
 static inline gpa_t gfn_to_gpa(gfn_t gfn)
 {
 	return (gpa_t)gfn << PAGE_SHIFT;
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 0fc7020..d711c91 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -493,4 +493,9 @@ static inline int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
 	       || vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
 }
 
+static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot)
+{
+	return slot - kvm->memslots;
+}
+
 #endif
-- 
1.5.1.2

