From nobody Sun Sep 28 17:41:24 2025 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=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1758228019; cv=none; d=zohomail.com; s=zohoarc; b=bdFu3hPnUz+PPVct0cQuaI3DMnDfdbW3VaJ3MPz8CiGCv/jOt2dMUQ+c+LMFY8QUFFffKYhbjV2rQSPQdor4XtzZ8nWj3oyAeX5NtB6Wbh0HD0waztcAihquvrQrbDMNgLjGH/aXZRO7qD8yzGZn8PtbEjDu3xYp6arpTICL6ZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758228019; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DHtSrXZcVQINioTONBn/GrEMHeTFb5InPbuhxx5EyD0=; b=A8K3Dt9eC6WTUmLLTfbi3kkhmBf14PzgaM2VG6z+J3AYMPosB1ziY/K4BU88hwY2VQlJ3ckIjPlbFgR8+AEeGGQww+OkNqqL34V6wDQShi/1NDzxxXF7fjofnPGNnd4LyTeUGqDTaKQuQVzJOGyby+wj5Bx/cc8iHOU4bpTGc7U= 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=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1758228019862131.09220682495982; Thu, 18 Sep 2025 13:40:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uzLQ3-00066V-T6; Thu, 18 Sep 2025 16:39:56 -0400 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 1uzLPw-00065J-3w for qemu-devel@nongnu.org; Thu, 18 Sep 2025 16:39:48 -0400 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 1uzLPu-0005qA-E6 for qemu-devel@nongnu.org; Thu, 18 Sep 2025 16:39:47 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-ZBMYZw4WOVyUI_hWyN_DyQ-1; Thu, 18 Sep 2025 16:39:43 -0400 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-81678866c0cso244489785a.2 for ; Thu, 18 Sep 2025 13:39:43 -0700 (PDT) Received: from x1.com (bras-base-aurron9134w-grc-11-174-89-135-121.dsl.bell.ca. [174.89.135.121]) by smtp.gmail.com with ESMTPSA id af79cd13be357-836278b8082sm226276285a.22.2025.09.18.13.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Sep 2025 13:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758227985; 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=DHtSrXZcVQINioTONBn/GrEMHeTFb5InPbuhxx5EyD0=; b=A/V3C9VjsFHc0lfYZT0yIuXD/u8XZhr+8sEZNE7dswPLvpzmpOoILw4terD3ityUe9NESV zJIAIqmAOM2IEeiqJEZOp0moQPWCDcGn9c4foagX1jv4iUIkO24LyYzysjzcve0Leloliq SpbYbxL3v8g3KPA/TPuBqEAkiyvQTGI= X-MC-Unique: ZBMYZw4WOVyUI_hWyN_DyQ-1 X-Mimecast-MFC-AGG-ID: ZBMYZw4WOVyUI_hWyN_DyQ_1758227983 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758227983; x=1758832783; 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=DHtSrXZcVQINioTONBn/GrEMHeTFb5InPbuhxx5EyD0=; b=mk3EYHFScSq5WUkXDJ8goSrH9oUkkLBtFAySgiRuhjY35Cgu4O3/Q1H9cBq5ICf3Mh m46kfHPpLr8MC043CrTnysDhdJQGC7SHpCnUv0xwtF/A2H0rg2OOlTIcXHY5pvjeyj/W iNP8GbQtbHcdjbWFB4+frdbn37V09eHL2IFqpR/2FLWzXk1bx9aWW/HKOBZs5gUryIX7 Iui1nCTyxkKEJ8zstjcwi2UOoZ7qghFSNPKZbh3VVAN7z9/QGaDG03Psrii5l+5MKcgI VswXWpFhABFLn6yFdzKI9DT81T6zK6/skCpzP5gXzG2jLTOoXLSz9EUwDQhw5XFar1Is r/OQ== X-Gm-Message-State: AOJu0YwPZFkTZQVnTNXGxkL+aMNUS7vl8Z/uhtxlqgSt5Ah1+FAN6VEf gxiZFzLY2c5qmiXBu5s5NFaiY7ANMAabZIzYPDUk1iRKXoDCxePRHq6zwx+vkxzOWLzW/rOep5g kNoNG6PT7E9FxSq5WTRnmkYfDraZVXItiMDZ5HajYzeL23dDyV3FTu7itkYemDVb440dxcs+TUs uDhrqChNHBGJbfY+qFb7ECrJhY2kVEhVqoM1vpQQ== X-Gm-Gg: ASbGnctVkAktRFp+z71hx79FXY4RoaxYPQHgl95GXXOrGkyXjfMOKRA9KK95lpMuTR2 z7PHHpX+eyW3ucNyn8OXvSOeR57mSIlm0EzVVDJ7Mf0JM8rCKqyE/+PVC1tEwF0dEpLep5JdVp2 7biIL3tkDbZ+Lh4k0N5GhSYESWxg7aPFFeN8OpCQV2i/oU+gitnRg3yh7iWtf1eagw5J8xZxZsK H97VWwLsF3uJkkFPRlN2ZT7KRvAivika0yEcfBxWeqtFCmO2WCow8kCFIoJgWaIXGHNvSm2DX2z 0v+rznrTtUTrayoX1+r3bZzOpBl/lqZOi0ZDz7VdrCdAYwe/4NGAdsVQV/IBrDL4ikKadwrMdby 4d3alqmhDBVo00dh3jKw= X-Received: by 2002:a05:620a:390b:b0:82a:4593:3089 with SMTP id af79cd13be357-83ba53d2b4dmr133611685a.33.1758227982733; Thu, 18 Sep 2025 13:39:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZkY33+47Pfwtb3zRly3iWPKq3iMa99MxmzW49cnwXPNuVGSlbzITLPZbEfWjZMbGURXA8Zg== X-Received: by 2002:a05:620a:390b:b0:82a:4593:3089 with SMTP id af79cd13be357-83ba53d2b4dmr133607485a.33.1758227982027; Thu, 18 Sep 2025 13:39:42 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: peterx@redhat.com, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Fabiano Rosas , Juraj Marcin Subject: [PATCH v3 2/2] migration: Make migration_has_failed() work even for CANCELLING Date: Thu, 18 Sep 2025 16:39:37 -0400 Message-ID: <20250918203937.200833-3-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250918203937.200833-1-peterx@redhat.com> References: <20250918203937.200833-1-peterx@redhat.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=peterx@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.005, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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: 1758228020816116600 Content-Type: text/plain; charset="utf-8" No issue I hit, the change is only from code observation when I am looking at a TLS premature termination issue. We set CANCELLED very late, it means migration_has_failed() may not work correctly if it's invoked before updating CANCELLING to CANCELLED. Allow that state will make migration_has_failed() working as expected even if it's invoked slightly earlier. One current user is the multifd code for the TLS graceful termination, where it's before updating to CANCELLED. Reviewed-by: Juraj Marcin Reviewed-by: Fabiano Rosas Signed-off-by: Peter Xu --- migration/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migration/migration.c b/migration/migration.c index 10c216d25d..f6f6a6e202 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1702,7 +1702,8 @@ int migration_call_notifiers(MigrationState *s, Migra= tionEventType type, =20 bool migration_has_failed(MigrationState *s) { - return (s->state =3D=3D MIGRATION_STATUS_CANCELLED || + return (s->state =3D=3D MIGRATION_STATUS_CANCELLING || + s->state =3D=3D MIGRATION_STATUS_CANCELLED || s->state =3D=3D MIGRATION_STATUS_FAILED); } =20 --=20 2.50.1