From: Avi Kivity Date: Fri, 17 Sep 2010 16:13:13 +0000 (-0300) Subject: KVM: Keep slot ID in memory slot structure X-Git-Tag: v2.6.35.6~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1be501980f140e5a6698999df9c7c6124c14810f;p=thirdparty%2Fkernel%2Fstable.git KVM: Keep slot ID in memory slot structure commit e36d96f7cfaa71870c407131eb4fbd38ea285c01 upstream. May be used for distinguishing between internal and user slots, or for sorting slots in size order. Signed-off-by: Avi Kivity Cc: Marcelo Tosatti Signed-off-by: Greg Kroah-Hartman --- diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 7cb116afa1cdb..f24d8fc519703 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -123,6 +123,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 f032806a212f9..2774528513134 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -566,6 +566,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;