aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-06-06 11:31:12 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-06-08 10:33:38 +0200
commit75dbebddb6a0f15bdfdae66d63de4905c793ccdb (patch)
treeef8a1af4b406d28daada22f5ca5f2f54f6151602 /hw/core
parent3973615e7fbaeef1deeaa067577e373781ced70a (diff)
downloadqemu-75dbebddb6a0f15bdfdae66d63de4905c793ccdb.zip
qemu-75dbebddb6a0f15bdfdae66d63de4905c793ccdb.tar.gz
qemu-75dbebddb6a0f15bdfdae66d63de4905c793ccdb.tar.bz2
machine: default -M mem-merge to off is QEMU_MADV_MERGEABLE is not available
Otherwise, starting any guest on a non-Linux guests results in qemu-system-arm: Couldn't set property 'merge' on 'memory-backend-ram': Invalid argument Cc: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/machine.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 77a356f..a0ee43c 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -17,6 +17,7 @@
#include "hw/loader.h"
#include "qapi/error.h"
#include "qapi/qapi-visit-machine.h"
+#include "qemu/madvise.h"
#include "qom/object_interfaces.h"
#include "sysemu/cpus.h"
#include "sysemu/sysemu.h"
@@ -1129,7 +1130,7 @@ static void machine_initfn(Object *obj)
container_get(obj, "/peripheral-anon");
ms->dump_guest_core = true;
- ms->mem_merge = true;
+ ms->mem_merge = (QEMU_MADV_MERGEABLE != QEMU_MADV_INVALID);
ms->enable_graphics = true;
ms->kernel_cmdline = g_strdup("");
ms->ram_size = mc->default_ram_size;