mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
KVM: Define KVM_MEMSLOTS_NUM_MAX_DEFAULT
Make the default max nr_slots a macro, it's only used when KVM reports nothing. Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Link: https://lore.kernel.org/r/20240917163835.194664-3-peterx@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
5504a81261
commit
b34a908c8f
1 changed files with 3 additions and 1 deletions
|
@ -71,6 +71,8 @@
|
||||||
|
|
||||||
/* Default num of memslots to be allocated when VM starts */
|
/* Default num of memslots to be allocated when VM starts */
|
||||||
#define KVM_MEMSLOTS_NR_ALLOC_DEFAULT 16
|
#define KVM_MEMSLOTS_NR_ALLOC_DEFAULT 16
|
||||||
|
/* Default max allowed memslots if kernel reported nothing */
|
||||||
|
#define KVM_MEMSLOTS_NR_MAX_DEFAULT 32
|
||||||
|
|
||||||
struct KVMParkedVcpu {
|
struct KVMParkedVcpu {
|
||||||
unsigned long vcpu_id;
|
unsigned long vcpu_id;
|
||||||
|
@ -2613,7 +2615,7 @@ static int kvm_init(MachineState *ms)
|
||||||
|
|
||||||
/* If unspecified, use the default value */
|
/* If unspecified, use the default value */
|
||||||
if (!s->nr_slots) {
|
if (!s->nr_slots) {
|
||||||
s->nr_slots = 32;
|
s->nr_slots_max = KVM_MEMSLOTS_NR_MAX_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->nr_as = kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE);
|
s->nr_as = kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue