From patchwork Sun Jul 4 16:14:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Straub X-Patchwork-Id: 12357555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9F4CC07E95 for ; Sun, 4 Jul 2021 16:16:44 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24A07613E0 for ; Sun, 4 Jul 2021 16:16:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24A07613E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=web.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m04nT-0007hg-2u for qemu-devel@archiver.kernel.org; Sun, 04 Jul 2021 12:16:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m04mB-0006ur-6G for qemu-devel@nongnu.org; Sun, 04 Jul 2021 12:15:25 -0400 Received: from mout.web.de ([212.227.17.12]:38069) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m04m9-0006fY-5P for qemu-devel@nongnu.org; Sun, 04 Jul 2021 12:15:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1625415300; bh=7/kGr7x/9hiNsY5VJlN5iXLm94LfcA3hZTbn3j0hXiY=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject; b=MoLiZrSkaToKNaeErxTYWXJo1YudJ3BpIWJ42qO+cTb6ff3bjZpd7/B7Ddy3RiRkQ 0TH71xFRUInAIThgJmj9qOD68Eldj0MmfT+Hw1yXuv6X2zXMmWD+dHQ86GkA1s4sJ0 Kz31mflBNgQ8rnwaYWZ+xC3bZITfyBVr7i9eOQPo= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from gecko.fritz.box ([88.130.61.115]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lr2dj-1lVOel1ueB-00egfo; Sun, 04 Jul 2021 18:15:00 +0200 Date: Sun, 4 Jul 2021 18:14:44 +0200 From: Lukas Straub To: qemu-devel Subject: [PATCH] colo: Don't dump colo cache if dump-guest-core=off Message-ID: <20210704181444.59396f6b@gecko.fritz.box> MIME-Version: 1.0 X-Provags-ID: V03:K1:VZD8s76S1iss0BoyXl3sKF1P2WR5ahVEzmLKBBBvaHr/qpnjolr rfRm4269wcDQQpjaxQ9hMJ3ZWc936HrsDvbRc3ETEBSmCke2gPgfoprs/dGnWH/MdbBmRWz iIScrUMD+xtwvdJFSTN/gyz14wNV40mVPFP6pYXuW462dpLegmY7T2ONWFvaQAMax+qZV3J f/GuSMyYWD25ZwdV5BuiA== X-UI-Out-Filterresults: notjunk:1;V03:K0:Qao1scRyGkk=:GpwAbccr2g75oPIqIvu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3A6YVDNehqexLJ334kwzyBdVbktSP1W4 XDynm5CvKqJ5kaxIAYwuy7zrDwkrj/0xo+wUo9MptqAdepM9CIJSNUxyQ== Received-SPF: pass client-ip=212.227.17.12; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zhang.zhanghailiang@huawei.com, "Dr. David Alan Gilbert" , "Rao, Lei" , Juan Quintela Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 --- migration/ram.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migration/ram.c b/migration/ram.c index 723af67c2e..0797d0d222 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__) */ @@ -3356,6 +3358,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); + } } }