From nobody Tue Jan 21 04:21:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1736530916127770.3584233701132; Fri, 10 Jan 2025 09:41:56 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1A8B5165C; Fri, 10 Jan 2025 12:41:55 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1BFB8164A; Fri, 10 Jan 2025 12:41:37 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 508DF1641; Fri, 10 Jan 2025 12:41:34 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id D2A06163F for ; Fri, 10 Jan 2025 12:41:33 -0500 (EST) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-443-WWSA3ZM0Mzu3LEEol29jmA-1; Fri, 10 Jan 2025 12:41:31 -0500 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D202F1955DCF for ; Fri, 10 Jan 2025 17:41:30 +0000 (UTC) Received: from orkuz (unknown [10.45.225.180]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 56EAF19560AD for ; Fri, 10 Jan 2025 17:41:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736530893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JuD91tcywFCBIMlULHhXBRVtWDefHpTGwv5xeN6WUP4=; b=PNIaq7MS1XSp98rkABBQohBcJaMW48Mh8dtgw2cxsuGf7rFkZpULoXlp2rY0wiUILFewBK UgFSNUMKoEZNoh4Mn996o2QeozDjA331DIFS3xPJYCkeyQlmyu0SQlFwi9FcXuyXzyoWrs PDRgoSyM3BOv/eRdRvwQXlVMh9XTggw= X-MC-Unique: WWSA3ZM0Mzu3LEEol29jmA-1 X-Mimecast-MFC-AGG-ID: WWSA3ZM0Mzu3LEEol29jmA From: Jiri Denemark To: devel@lists.libvirt.org Subject: [PATCH] qemu_migration: Do not consider post-copy active in postcopy-recover Date: Fri, 10 Jan 2025 18:41:27 +0100 Message-ID: <0fca7e80c8a965a387a49faccdd85028367b6e65.1736530887.git.jdenemar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 0Rz_JtsvG4MCzcVaCwCVQ5BiCNpIaIsbRKo1OFVnHOU_1736530890 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: ZJSJF3KWCV7JNOSMIFYXJXCWTN5N7634 X-Message-ID-Hash: ZJSJF3KWCV7JNOSMIFYXJXCWTN5N7634 X-MailFrom: jdenemar@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1736530917790116600 Content-Type: text/plain; charset="utf-8" The postcopy-recover migration state in QEMU means a connection for the migration stream was established. Depending on the schedulers on both hosts a relative timing of the corresponding MIGRATION event on the source host and the destination host may differ. Specifically it's possible that the source sees postcopy-recover while the destination is still in postcopy-paused. Currently the Perform phase on the source host ends when we get postcopy-recover event and the Finish phase on the destination host is called. If this is fast enough we can still see postcopy-paused state when the Finish phase starts waiting for migration to complete. This is interpreted as a failure and reported back to the caller. Even though the recovery may actually start just a few moments later. To avoid this race we now don't consider post-copy migration active in postcopy-recover state and keep waiting for postcopy-active event (in the success path). Thus the Finish phase is entered only after the migration switches to postcopy-active. In this state QEMU guarantees the destination already switched at least to postcopy-recover and we won't be confused be seeing an old postcopy-failed state. https://issues.redhat.com/browse/RHEL-73085 Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 50e350b0c4..1582a738a3 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1872,11 +1872,11 @@ qemuMigrationUpdateJobType(virDomainJobData *jobDat= a) =20 switch ((qemuMonitorMigrationStatus) priv->stats.mig.status) { case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY: - case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER: jobData->status =3D VIR_DOMAIN_JOB_STATUS_POSTCOPY; break; =20 case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP: + case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER: jobData->status =3D VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER; break; =20 --=20 2.47.1