summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-06-21 10:56:36 +0300
committerAvi Kivity <avi@redhat.com>2010-08-01 10:47:07 +0300
commite36d96f7cfaa71870c407131eb4fbd38ea285c01 (patch)
treea557bb41250b555f6181552246742d3a46fadcfd
parent0719837c0832a7b305e42327caa7d330462360ea (diff)
downloadop-kernel-dev-e36d96f7cfaa71870c407131eb4fbd38ea285c01.zip
op-kernel-dev-e36d96f7cfaa71870c407131eb4fbd38ea285c01.tar.gz
KVM: Keep slot ID in memory slot structure
May be used for distinguishing between internal and user slots, or for sorting slots in size order. Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--include/linux/kvm_host.h1
-rw-r--r--virt/kvm/kvm_main.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index e820eb5..e796326 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -124,6 +124,7 @@ struct kvm_memory_slot {
} *lpage_info[KVM_NR_PAGE_SIZES - 1];
unsigned long userspace_addr;
int user_alloc;
+ int id;
};
static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 5bd2f34..74f7319 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -570,6 +570,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
new = old = *memslot;
+ new.id = mem->slot;
new.base_gfn = base_gfn;
new.npages = npages;
new.flags = mem->flags;
OpenPOWER on IntegriCloud