From nobody Sun Feb 8 20:58:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652196658; cv=none; d=zohomail.com; s=zohoarc; b=ZtPex4X3qYzOk7FBd9+JLzc19ojOWYExklDvpftj40R994oAHyyw325lcIsm79AUPJy1j4Kl23Bf14y46JJrpwVt1xLrpt7Y4/EEvLMt3gOIrKUMDuMCH08WpqEvbvJ/Td6Dazt9W9UDSA07nEE3nbL8fMvygwqr9ZFHy00DdbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196658; h=Content-Type:Content-Transfer-Encoding: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=zfoGqV6fu21xeTKHQMEhtM0jX88MF8b8EAksGTvwsHI=; b=XhAthZI6UurDQQMU5CsHVVhdlo6cq4n8RUVYuxfvEJ2zt8VO5ob5eU/vHVYYQsCSyHGwP2w2GcDPWHaq+egXiQYjTwtULTB1VGuEYeEp1D2usFVi2YUUSFzz3FRn9I5+N91jTVcIu1NS0sNO9xZVy2jV3wmOOuFT/KwELKkwYCE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652196658870817.0094335438644; Tue, 10 May 2022 08:30:58 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-411-MargH2GqPHmUgiggTHCFzQ-1; Tue, 10 May 2022 11:30:55 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 554E7810BD8; Tue, 10 May 2022 15:30:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40FBD40E7F0C; Tue, 10 May 2022 15:30:52 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 922261947067; Tue, 10 May 2022 15:30:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 623951947055 for ; Tue, 10 May 2022 15:28:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 54358C27E85; Tue, 10 May 2022 15:28:02 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 34D3EC27E83 for ; Tue, 10 May 2022 15:28:02 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id B5420244620; Tue, 10 May 2022 17:21:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652196657; h=from:from:sender:sender: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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zfoGqV6fu21xeTKHQMEhtM0jX88MF8b8EAksGTvwsHI=; b=O76L6HhVO2uMRVCOMPVu0bhetj3rpi0O2b8EayLTui+WDUyn45unPq0jFJcVZCpFNGgVhd D3qHE65GImZzadymWUOQlu7f8XFwoiRz3ZUoOMMbYM6fNmz0N4LHl8pxRksjhXGCcGHiM2 OdBCgi4ArA2BuIVQVOr7c86+KHK5NKQ= X-MC-Unique: MargH2GqPHmUgiggTHCFzQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 52/80] virsh: Add --postcopy-resume option for migrate command Date: Tue, 10 May 2022 17:21:13 +0200 Message-Id: <187317531abdbc971640016ed5aafd3c25d8df41.1652196064.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652196659363100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- docs/manpages/virsh.rst | 9 +++++++-- tools/virsh-domain.c | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e73e590754..e36d64c164 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -3246,7 +3246,8 @@ migrate migrate [--live] [--offline] [--direct] [--p2p [--tunnelled]] [--persistent] [--undefinesource] [--suspend] [--copy-storage-all] [--copy-storage-inc] [--change-protection] [--unsafe] [--verbose] - [--rdma-pin-all] [--abort-on-error] [--postcopy] [--postcopy-after-p= recopy] + [--rdma-pin-all] [--abort-on-error] [--postcopy] + [--postcopy-after-precopy] [--postcopy-resume] domain desturi [migrateuri] [graphicsuri] [listen-address] [dname] [--timeout seconds [--timeout-suspend | --timeout-postcopy]] [--xml file] [--migrate-disks disk-list] [--disks-port port] @@ -3302,7 +3303,11 @@ Once migration is running, the user may switch to po= st-copy using the automatically switch to post-copy after the first pass of pre-copy is fini= shed. The maximum bandwidth consumed during the post-copy phase may be limited u= sing *--postcopy-bandwidth*. The maximum bandwidth consumed during the pre-copy= phase -may be limited using *--bandwidth*. +may be limited using *--bandwidth*. In case connection between the hosts b= reaks +while migration is in post-copy mode, the domain cannot be resumed on eith= er +source or destination host and the ``migrate`` command will report an error +leaving the domain active on both hosts. To recover from such situation re= peat +the original ``migrate`` command with an additional *--postcopy-resume* fl= ag. =20 *--auto-converge* forces convergence during live migration. The initial guest CPU throttling rate can be set with *auto-converge-initial*. If the diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index ba492e807e..b0d5b15dff 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -10807,6 +10807,10 @@ static const vshCmdOptDef opts_migrate[] =3D { .type =3D VSH_OT_BOOL, .help =3D N_("automatically switch to post-copy migration after one p= ass of pre-copy") }, + {.name =3D "postcopy-resume", + .type =3D VSH_OT_BOOL, + .help =3D N_("resume failed post-copy migration") + }, {.name =3D "migrateuri", .type =3D VSH_OT_STRING, .completer =3D virshCompleteEmpty, @@ -11210,6 +11214,9 @@ doMigrate(void *opaque) if (vshCommandOptBool(cmd, "postcopy")) flags |=3D VIR_MIGRATE_POSTCOPY; =20 + if (vshCommandOptBool(cmd, "postcopy-resume")) + flags |=3D VIR_MIGRATE_POSTCOPY_RESUME; + if (vshCommandOptBool(cmd, "tls")) flags |=3D VIR_MIGRATE_TLS; =20 @@ -11314,6 +11321,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd) VSH_EXCLUSIVE_OPTIONS("live", "offline"); VSH_EXCLUSIVE_OPTIONS("timeout-suspend", "timeout-postcopy"); VSH_REQUIRE_OPTION("postcopy-after-precopy", "postcopy"); + VSH_REQUIRE_OPTION("postcopy-resume", "postcopy"); VSH_REQUIRE_OPTION("timeout-postcopy", "postcopy"); VSH_REQUIRE_OPTION("persistent-xml", "persistent"); VSH_REQUIRE_OPTION("tls-destination", "tls"); --=20 2.35.1