From nobody Wed May 15 18:39:42 2024 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=1671143148; cv=none; d=zohomail.com; s=zohoarc; b=UGIfBe1ppaiFPX91DywboaPoiE+ucurht4Btr1a0gAroc82gsecehOXLYc4U6dZkPb4rQukKeeBTARVI0uRqd8SxnlYvm6nAe8KPvqzhXlOtlR/8inYpXcPN0L6wYf5OKnVXjD2CeCKUo8XWWjzCv+SXlUMJQF7JsyjPPyXqb9E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671143148; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=wzLJlESUcTWTu0JvlgQRTkOijKxU1qaInOkRe2IPPMA=; b=Fv7aXub6aMYkTKpfiDGc+DN8cH1V8Blegt54T439EKLKVodqn3/XQ/AX31xn+C7emHv1JlClY8r/gtsTZ0WcEzQWqWgqgbquXjEX+idf2yCcVzSk4FGfjixV5nNfa02yIRDQI8y+QNqQC/u7N7RXp8HE0A2hsgMnh/keAmnXF9w= 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 1671143148187524.0613551547336; Thu, 15 Dec 2022 14:25:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5wex-0007RH-Cu; Thu, 15 Dec 2022 17:24:59 -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 1p5wev-0007Qj-DM for qemu-devel@nongnu.org; Thu, 15 Dec 2022 17:24:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5wet-0001wh-JV for qemu-devel@nongnu.org; Thu, 15 Dec 2022 17:24:57 -0500 Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-671-jHuzCpnlM3GXSbBNUU_YMQ-1; Thu, 15 Dec 2022 17:24:53 -0500 Received: by mail-qv1-f70.google.com with SMTP id w2-20020a0562140b2200b004d66d74f93cso330207qvj.15 for ; Thu, 15 Dec 2022 14:24:53 -0800 (PST) Received: from x1n.redhat.com (bras-base-aurron9127w-grc-45-70-31-26-132.dsl.bell.ca. [70.31.26.132]) by smtp.gmail.com with ESMTPSA id 195-20020a370ccc000000b006fec1c0754csm118081qkm.87.2022.12.15.14.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 14:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671143094; 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; bh=wzLJlESUcTWTu0JvlgQRTkOijKxU1qaInOkRe2IPPMA=; b=Fzegc+GpQfpZFlqnYMQDNbteeqa44RBo3lcXkK7qUyAhtbmDlRzeYVSFRXGpeQBSKXY79+ zCjPjHwPtx31t9nuL80Cj7qNHm16GTqtOPiEBQT7XSKpeYsyQkllrLYk0gwX1IGcWhnRSv ON7m0HK+kO53yPYpvUx7oAhan5ViyiY= X-MC-Unique: jHuzCpnlM3GXSbBNUU_YMQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wzLJlESUcTWTu0JvlgQRTkOijKxU1qaInOkRe2IPPMA=; b=ueT6czZPPWmD0VXLG7Ah7rKKJEWnbqsjDiK9TMGJOCWreNbB2Q0/XXGHjMpFOIWiuJ g+wtuLz36O9VOLBh21ynC6kid9XDRHyCeyDF/c1kyE3J1eJ/6cMPrzr1T5QbIZnMPPgI oJJuSfHN20nQWrXAfkJjGpcuqTtMW6NFbRIEzkuOzVE1hpXUkyJU+HGm0a7CSzM6Y0cr QF2HLlB0KaoTrF4Vrp+b8Qc7KE2heAz6QCgR8ZBeBUAkMLsFnCk+Fx0xUPKVTKL13pdL VO6l/bFd4w0S0cJ8sASrqQSAXKYVrfACwvcrWWZHuvsj13N6tocxsCLkgOZctQAe9Snf fGnA== X-Gm-Message-State: ANoB5pkdOEphX5aq2HDSzcCZdkPMLnGC40SMLS4qLUYQRozjnOnkN7aN RVP6GLGf3b9UIQHfFQ0VBXnd9tKHjHtSyWWRML4xUnRrag6KErXDv6ZrY/gVY2VAgdnlJnp6giM 6ZuhGZNEDOWYWhd5xJE0uu53cLFkMieOL+wFG8DldwWLz7OB/+/RZ8R4E39nSickD X-Received: by 2002:ac8:6743:0:b0:3a8:313f:ec66 with SMTP id n3-20020ac86743000000b003a8313fec66mr7646509qtp.58.1671143091542; Thu, 15 Dec 2022 14:24:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7uDGVib1JtvXjAByoJgcXV6Vr3L86qAV5nmspU5UFvLpdBX4vy0O7kYPd3BPiSYje8ccb7Xg== X-Received: by 2002:ac8:6743:0:b0:3a8:313f:ec66 with SMTP id n3-20020ac86743000000b003a8313fec66mr7646489qtp.58.1671143091297; Thu, 15 Dec 2022 14:24:51 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Juan Quintela , Leonardo Bras Soares Passos , "Dr . David Alan Gilbert" , peterx@redhat.com Subject: [PATCH] migration: Show downtime during postcopy phase Date: Thu, 15 Dec 2022 17:24:48 -0500 Message-Id: <20221215222448.1893656-1-peterx@redhat.com> X-Mailer: git-send-email 2.37.3 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.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: 1671143149053100001 Content-Type: text/plain; charset="utf-8" The downtime should be displayed during postcopy phase because the switchover phase is done. OTOH it's weird to show "expected downtime" which can confuse what does that mean if the switchover has already happened anyway. This is a slight ABI change on QMP, but I assume it shouldn't affect anyone. Signed-off-by: Peter Xu Reviewed-by: Leonardo Bras --- migration/migration.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 64f74534e2..993782598f 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1077,20 +1077,30 @@ bool migration_is_running(int state) } } =20 +static bool migrate_show_downtime(MigrationState *s) +{ + return (s->state =3D=3D MIGRATION_STATUS_COMPLETED) || migration_in_po= stcopy(); +} + static void populate_time_info(MigrationInfo *info, MigrationState *s) { info->has_status =3D true; info->has_setup_time =3D true; info->setup_time =3D s->setup_time; + if (s->state =3D=3D MIGRATION_STATUS_COMPLETED) { info->has_total_time =3D true; info->total_time =3D s->total_time; - info->has_downtime =3D true; - info->downtime =3D s->downtime; } else { info->has_total_time =3D true; info->total_time =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - s->start_time; + } + + if (migrate_show_downtime(s)) { + info->has_downtime =3D true; + info->downtime =3D s->downtime; + } else { info->has_expected_downtime =3D true; info->expected_downtime =3D s->expected_downtime; } --=20 2.37.3