From nobody Tue Feb 10 01:33:20 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676255530; cv=none; d=zohomail.com; s=zohoarc; b=TFzFSaVtlWxpMf1pU1ogV0nqUxJsvNU9bVHUBZG5m3sDK44VmAw/ySH1qhyo/0qxwrTLUqGJ3pMcdKqXoAdXpC7xkwiaj3kxe+uaY7+DS43UkhAD8MYak4AYF6lMKpEymCOfstRYDyWr3MW4S4G09qP8wcCWDtWlbreuEg2hTTs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676255530; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qOi00Pqh/ujyWTtG6wmGTly8NpXv3aJEdCMEVs3nCBo=; b=Y11ftg2KLCsTT3lBsICltUBd67E2a/AWPd3eYDicToB2wOXmrXcrhp8+pTC5rs5vkNNHvcWSK1smzgC7e0uvJ/bKj6Y9Df9EO+XrL92mtp4SJf25gm8znao4kiAqUrasfRyBNQM5O1djrBFTPJZQI5gE0U0huzX7P2kF191QAzE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1676255530114716.8566371902904; Sun, 12 Feb 2023 18:32:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pROb5-0001Z6-Kw; Sun, 12 Feb 2023 21:29:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pROb3-0001YN-BR for qemu-devel@nongnu.org; Sun, 12 Feb 2023 21:29:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pROb1-00034Z-MO for qemu-devel@nongnu.org; Sun, 12 Feb 2023 21:29:36 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-554-z7X9KB-cM6CmMpdtblyUow-1; Sun, 12 Feb 2023 21:29:33 -0500 Received: by mail-wm1-f71.google.com with SMTP id o8-20020a05600c510800b003dfdf09ffc2so5423070wms.5 for ; Sun, 12 Feb 2023 18:29:33 -0800 (PST) Received: from redhat.com ([46.136.252.173]) by smtp.gmail.com with ESMTPSA id z17-20020a5d6551000000b002c54c8e70b1sm6275033wrv.9.2023.02.12.18.29.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Feb 2023 18:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676255374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qOi00Pqh/ujyWTtG6wmGTly8NpXv3aJEdCMEVs3nCBo=; b=Aga7YYeNM8vo8byEXN9g0n8q9cCV6C8NxmB7xpkxU2RHYfI6FFfsa2wryDTOyD0zp2JXnU XlMyZrbExHD9iVVPJ7/hChqlXCn8EFKSnKeGf72ae+jiEn+ZJ1QpRR1Zrtz0KynAdMzjX+ u7CpZpUaR1Il+ff+bn35VONYDbiAIm0= X-MC-Unique: z7X9KB-cM6CmMpdtblyUow-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qOi00Pqh/ujyWTtG6wmGTly8NpXv3aJEdCMEVs3nCBo=; b=hkl5siw5P3Kqi9EH1NNiHfDp/13zqmPStwAPbgh6iv+NKcF2KdhmJOBfYjB9dMUHEF pWiE8iwUUKVKlArmDHEDyBVyfq6zp5LPz32Nd9FkdAiypZ5KupadWtZjjEswm0Q2eJFP 5ybPe6iAWLVi6NO7eMy5QO//v1BuFBJokfp1VIoJNPzLi5f9yGToykAEByCwrq6OHKLk DoLeZrOrRftEaS/AvNRu+b3lg0ePFQbQAKDmEIU03ZS/rwDf+wHsblpOGhO5rLrkvrUH cA9g4mZfD6Lp+K6FnkbOvL5C3+/km8reyfggBroIrxgjBKDYOXnQRBeEaQOXVRAIiVBE v5zA== X-Gm-Message-State: AO0yUKX27GpooRKxtTg6SinuZFQKLsIhe4eyZda4Y4wst6tLzRebnAib 49Ug+dMQa9rt0frqhKZZmRmSUH4/L4bIms2/wkGJznT/8OCpG7Wp5wdlD2Qz/4aDW6eesYEXPpD 0eEBbGMML2+9SGZaliWn0aUefD7RuSg4s74wVFq/NZTGMDJBS03VXvMFsufpbHPNXJXeHCTXq X-Received: by 2002:adf:eb88:0:b0:2c5:4bd4:b3a8 with SMTP id t8-20020adfeb88000000b002c54bd4b3a8mr7133141wrn.4.1676255372026; Sun, 12 Feb 2023 18:29:32 -0800 (PST) X-Google-Smtp-Source: AK7set93r9z3DMHPpOkkw0GymiD+Q9tAwTIKRBZwn0QmaSQgLXHYJg2jzv/gVIO1TxUcoI75MMe6/g== X-Received: by 2002:adf:eb88:0:b0:2c5:4bd4:b3a8 with SMTP id t8-20020adfeb88000000b002c54bd4b3a8mr7133127wrn.4.1676255371764; Sun, 12 Feb 2023 18:29:31 -0800 (PST) From: Xxx Xx X-Google-Original-From: Xxx Xx To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Juan Quintela , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Cornelia Huck , "Dr. David Alan Gilbert" , kvm@vger.kernel.org, "Michael S. Tsirkin" , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PULL 11/22] migration: I messed state_pending_exact/estimate Date: Mon, 13 Feb 2023 03:29:00 +0100 Message-Id: <20230213022911.68490-12-xxx.xx@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213022911.68490-1-xxx.xx@gmail.com> References: <20230213022911.68490-1-xxx.xx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=quintela@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676255531429100002 Content-Type: text/plain; charset="utf-8" From: Juan Quintela I called the helper function from the wrong top level function. This code was introduced in: commit c8df4a7aeffcb46020f610526eea621fa5b0cd47 Author: Juan Quintela Date: Mon Oct 3 02:00:03 2022 +0200 migration: Split save_live_pending() into state_pending_* We split the function into to: - state_pending_estimate: We estimate the remaining state size without stopping the machine. - state pending_exact: We calculate the exact amount of remaining state. Thanks to Avihai Horon for finding it. Fixes:c8df4a7aeffcb46020f610526eea621fa5b0cd47 When we introduced that patch, we enden calling state_pending_estimate() helper from qemu_savevm_statepending_exact() and state_pending_exact() helper from qemu_savevm_statepending_estimate() This patch fixes it. Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Juan Quintela --- migration/savevm.c | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index e9cf4999ad..ce181e21e1 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1551,31 +1551,6 @@ void qemu_savevm_state_pending_estimate(uint64_t *re= s_precopy_only, *res_compatible =3D 0; *res_postcopy_only =3D 0; =20 - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { - if (!se->ops || !se->ops->state_pending_exact) { - continue; - } - if (se->ops->is_active) { - if (!se->ops->is_active(se->opaque)) { - continue; - } - } - se->ops->state_pending_exact(se->opaque, - res_precopy_only, res_compatible, - res_postcopy_only); - } -} - -void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only, - uint64_t *res_compatible, - uint64_t *res_postcopy_only) -{ - SaveStateEntry *se; - - *res_precopy_only =3D 0; - *res_compatible =3D 0; - *res_postcopy_only =3D 0; - QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { if (!se->ops || !se->ops->state_pending_estimate) { continue; @@ -1591,6 +1566,31 @@ void qemu_savevm_state_pending_exact(uint64_t *res_p= recopy_only, } } =20 +void qemu_savevm_state_pending_exact(uint64_t *res_precopy_only, + uint64_t *res_compatible, + uint64_t *res_postcopy_only) +{ + SaveStateEntry *se; + + *res_precopy_only =3D 0; + *res_compatible =3D 0; + *res_postcopy_only =3D 0; + + QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { + if (!se->ops || !se->ops->state_pending_exact) { + continue; + } + if (se->ops->is_active) { + if (!se->ops->is_active(se->opaque)) { + continue; + } + } + se->ops->state_pending_exact(se->opaque, + res_precopy_only, res_compatible, + res_postcopy_only); + } +} + void qemu_savevm_state_cleanup(void) { SaveStateEntry *se; --=20 2.39.1