Make the default max nr_slots a macro, it's only used when KVM reports
nothing.  Then we put all the rest macros together later soon.

Signed-off-by: Peter Xu <pet...@redhat.com>
---
 accel/kvm/kvm-all.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 991c389adc..e408dbb753 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -69,6 +69,9 @@
 #define KVM_GUESTDBG_BLOCKIRQ 0
 #endif
 
+/* Default max allowed memslots if kernel reported nothing */
+#define  KVM_MEMSLOTS_NUM_MAX_DEFAULT                       32
+
 struct KVMParkedVcpu {
     unsigned long vcpu_id;
     int kvm_fd;
@@ -2458,7 +2461,7 @@ static int kvm_init(MachineState *ms)
 
     /* If unspecified, use the default value */
     if (!s->nr_slots_max) {
-        s->nr_slots_max = 32;
+        s->nr_slots_max = KVM_MEMSLOTS_NUM_MAX_DEFAULT;
     }
 
     s->nr_as = kvm_check_extension(s, KVM_CAP_MULTI_ADDRESS_SPACE);
-- 
2.45.0


Reply via email to