From: Lukas Straub Date: Sun, 4 Jul 2021 16:14:44 +0000 (+0200) Subject: colo: Don't dump colo cache if dump-guest-core=off X-Git-Tag: v6.2.0-rc0~14^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5fdf920964b65678798960d8b3a55453c2e9094;p=thirdparty%2Fqemu.git colo: Don't dump colo cache if dump-guest-core=off One might set dump-guest-core=off to make coredumps smaller and still allow to debug many qemu bugs. Extend this option to the colo cache. Signed-off-by: Lukas Straub Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- diff --git a/migration/ram.c b/migration/ram.c index f5d39db4e4a..847af461f23 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -56,6 +56,8 @@ #include "multifd.h" #include "sysemu/runstate.h" +#include "hw/boards.h" /* for machine_dump_guest_core() */ + #if defined(__linux__) #include "qemu/userfaultfd.h" #endif /* defined(__linux__) */ @@ -3542,6 +3544,10 @@ int colo_init_ram_cache(void) } return -errno; } + if (!machine_dump_guest_core(current_machine)) { + qemu_madvise(block->colo_cache, block->used_length, + QEMU_MADV_DONTDUMP); + } } }