From nobody Mon Nov 25 02:50:19 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=1718648235; cv=none; d=zohomail.com; s=zohoarc; b=jsKI3uur/8lbVpqxFX8Lc0gIa6NlGbD50/WpN1B6x3qp5vww2lTa0kZ+1+P1As6XpqNBIaUxa/xsHznnlRO6H0jkceSJVDjpppZyG+stkqnTl0jyYt00YGFdQF+s3FUqniMDHPyB6/xsAOE66EHSsRmAx6Y3BGpIe7q1P7AOvRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718648235; 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=nEHrtQENt0LFtN0vcvE5nOEIasmLrG79F51JvU/6ieg=; b=STkXuXm7arLTGA8WYSI+xhnaX+tJ8RAQllf5Mbc+gq2CERQeMEb/PTGxPd8hISz25kCvz++WbDzkqsPtMKOsw43uje23UasDyj3cnqJyaxCLk7ZZ6+Tqz6+sO22dqtIhMn+F/Be2sHy1WgIwyPQgTLlUQSganeYIMfydt4DcviY= 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 1718648235944484.85509081269413; Mon, 17 Jun 2024 11:17:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJGtg-0000Ha-JJ; Mon, 17 Jun 2024 14:16:05 -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 1sJGta-0000Dw-RG for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:16:00 -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 1sJGtX-0006Ir-La for qemu-devel@nongnu.org; Mon, 17 Jun 2024 14:15:58 -0400 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-320-WKtl73LcNF6pTtNzhaRqaw-1; Mon, 17 Jun 2024 14:15:50 -0400 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6b07a472e83so3991916d6.1 for ; Mon, 17 Jun 2024 11:15:50 -0700 (PDT) Received: from x1n.redhat.com (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id af79cd13be357-798abc07501sm449643685a.89.2024.06.17.11.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jun 2024 11:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718648154; 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=nEHrtQENt0LFtN0vcvE5nOEIasmLrG79F51JvU/6ieg=; b=bmkuCIRWL2qTVG+zPosi944rk4GWkuW0SuIOp7mQhqDJW127a2qw6C3SIL7Xp3OODW7cRX dfgrWHXd4enEJUnESTdzQ5QAsD1UyK/jxeCCY52/RmavKu3S/apnlL04A4tliDnHntv9uj WYq40jT+QddolKNwGgQwXvdw0ZQ4Faw= X-MC-Unique: WKtl73LcNF6pTtNzhaRqaw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718648149; x=1719252949; 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=nEHrtQENt0LFtN0vcvE5nOEIasmLrG79F51JvU/6ieg=; b=s4GMdVi+wEiEjcyx+IFg5JBkmylryZkN7JAKmrhxROj28ZlksoXstCHukNE6AdzUs5 aZXdXzLGFHRJNwVFZ0Vn7FrgEsFAL445wWAXES+i+/4nKG3Xcnd8dM5IeR8FlP4qkGYV 3I3sUzkKO6vvlTFUPbWEMEUrnyQYQo5KmLjiBwSQjcZgkn6CrFujB6PJfBi0E8FGVsbq xkGlPXD5XPCpM8cn+zsYAu8hoNzAPnPAn6vq5FrPVET0nnoP7uXL6jcxESH53M7c/mTF a44q9PgW/ZAfAjk9SUnWNTkL+ftgTIfMdY1F004ZP+Xc5vNbrzhDE+0jnTenxcfcEURM PZTA== X-Gm-Message-State: AOJu0YzyV6FywRrNa6q576Bw0cyZ9P7bFF4shKeGFqh4duw3Yxi8L+1U E/qOt8JDvrQB1LNZj7Y6UU4/IQFf/8uHzVrm2vINpfGIn74LbZgvSRFJq7oaQlaFgozjeG+R2+i 5TX1UjcKjEb+MIRR5GOVMCRbGciTs7oDII/jHgH2zyw4w70iMfeV3hzUbYeNwuMVC0Cs+AbaNNq +5iz20R6jwNCVNM9DVCMQEwJMHOBhnVvop7A== X-Received: by 2002:a05:620a:4893:b0:797:74ba:8b8 with SMTP id af79cd13be357-798d23e0698mr1366899485a.2.1718648148811; Mon, 17 Jun 2024 11:15:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFasbENddxnm/6ekdse/p/TgRpfH51FOrKDEuAZV6APu5bsFDqKlxS7FDarb4wTo0k8DjXoQ== X-Received: by 2002:a05:620a:4893:b0:797:74ba:8b8 with SMTP id af79cd13be357-798d23e0698mr1366894685a.2.1718648147973; Mon, 17 Jun 2024 11:15:47 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Cc: Thomas Huth , Markus Armbruster , Laurent Vivier , Fabiano Rosas , Eric Blake , Prasad Pandit , peterx@redhat.com, Jiri Denemark , Bandan Das Subject: [PATCH v2 06/10] migration/docs: Update postcopy recover session for SETUP phase Date: Mon, 17 Jun 2024 14:15:30 -0400 Message-ID: <20240617181534.1425179-7-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240617181534.1425179-1-peterx@redhat.com> References: <20240617181534.1425179-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: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.148, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: 1718648241095100002 Content-Type: text/plain; charset="utf-8" Firstly, the "Paused" state was added in the wrong place before. The state machine section was describing PostcopyState, rather than MigrationStatus. Drop the Paused state descriptions. Then in the postcopy recover session, add more information on the state machine for MigrationStatus in the lines. Add the new RECOVER_SETUP phase. Signed-off-by: Peter Xu Reviewed-by: Fabiano Rosas --- docs/devel/migration/postcopy.rst | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/devel/migration/postcopy.rst b/docs/devel/migration/postc= opy.rst index 6c51e96d79..a15594e11f 100644 --- a/docs/devel/migration/postcopy.rst +++ b/docs/devel/migration/postcopy.rst @@ -99,17 +99,6 @@ ADVISE->DISCARD->LISTEN->RUNNING->END (although it can't do the cleanup it would do as it finishes a normal migration). =20 - - Paused - - Postcopy can run into a paused state (normally on both sides when - happens), where all threads will be temporarily halted mostly due to - network errors. When reaching paused state, migration will make sure - the qemu binary on both sides maintain the data without corrupting - the VM. To continue the migration, the admin needs to fix the - migration channel using the QMP command 'migrate-recover' on the - destination node, then resume the migration using QMP command 'migrate' - again on source node, with resume=3Dtrue flag set. - - End =20 The listen thread can now quit, and perform the cleanup of migration @@ -221,7 +210,8 @@ paused postcopy migration. =20 The recovery phase normally contains a few steps: =20 - - When network issue occurs, both QEMU will go into PAUSED state + - When network issue occurs, both QEMU will go into **POSTCOPY_PAUSED** + migration state. =20 - When the network is recovered (or a new network is provided), the admin can setup the new channel for migration using QMP command @@ -229,9 +219,20 @@ The recovery phase normally contains a few steps: =20 - On source host, the admin can continue the interrupted postcopy migration using QMP command 'migrate' with resume=3Dtrue flag set. - - - After the connection is re-established, QEMU will continue the postcopy - migration on both sides. + Source QEMU will go into **POSTCOPY_RECOVER_SETUP** state trying to + re-establish the channels. + + - When both sides of QEMU successfully reconnects using a new or fixed up + channel, they will go into **POSTCOPY_RECOVER** state, some handshake + procedure will be needed to properly synchronize the VM states between + the two QEMUs to continue the postcopy migration. For example, there + can be pages sent right during the window when the network is + interrupted, then the handshake will guarantee pages lost in-flight + will be resent again. + + - After a proper handshake synchronization, QEMU will continue the + postcopy migration on both sides and go back to **POSTCOPY_ACTIVE** + state. Postcopy migration will continue. =20 During a paused postcopy migration, the VM can logically still continue running, and it will not be impacted from any page access to pages that --=20 2.45.0