Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 356792
b: refs/heads/master
c: 1e702d9
h: refs/heads/master
v: v3
  • Loading branch information
Alex Williamson authored and Marcelo Tosatti committed Dec 14, 2012
1 parent 0222c38 commit 7fe92ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6104f472a5ea287fbdcf4644e74867dfd905a018
refs/heads/master: 1e702d9af5d633cf0eca76f6340b3c50fbb5a4e5
4 changes: 2 additions & 2 deletions trunk/include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ struct kvm_memory_slot {
struct kvm_arch_memory_slot arch;
unsigned long userspace_addr;
u32 flags;
int id;
short id;
bool user_alloc;
};

Expand Down Expand Up @@ -330,7 +330,7 @@ struct kvm_memslots {
u64 generation;
struct kvm_memory_slot memslots[KVM_MEM_SLOTS_NUM];
/* The mapping table from slot id to the index in memslots[]. */
int id_to_index[KVM_MEM_SLOTS_NUM];
short id_to_index[KVM_MEM_SLOTS_NUM];
};

struct kvm {
Expand Down
2 changes: 2 additions & 0 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ static struct kvm *kvm_create_vm(unsigned long type)
INIT_HLIST_HEAD(&kvm->irq_ack_notifier_list);
#endif

BUILD_BUG_ON(KVM_MEM_SLOTS_NUM > SHRT_MAX);

r = -ENOMEM;
kvm->memslots = kzalloc(sizeof(struct kvm_memslots), GFP_KERNEL);
if (!kvm->memslots)
Expand Down

0 comments on commit 7fe92ea

Please sign in to comment.