From nobody Mon Feb 9 01:47:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1654087884; cv=none; d=zohomail.com; s=zohoarc; b=kFkVk9BJya7aHopzZsxRfD/8b/15Kt3wzGCLgyfZp/iz+e9tJ3BjbMC0my6HbE5tfoJY+PCEuLtNRefGlNMDhG4Uh9yADH+DCsj05pQXk8t0Dbyo+jQsfoa87H9WfBVIfd6b87ZYyi+WYr13kk3y7zlMm4Lo+JNniTfgPe7gph4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654087884; h=Content-Type:Content-Transfer-Encoding:Cc: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=6ZzK1eM6fNhSGjjzok8NhTVma+v1Olc+JNnMqtZ4q4g=; b=EYd6xiGLz4rTjCKAdH3wd6H2T+sLYJT9r7GxjuW662ApLkrO8HA04Yv8mzNoZza6iCaeaSYxL9qSTPeoB18DcwJaL/MfaOWqICX+CWDhknl1LX/CWdQkRzXbizBwqXo3ewi4JxUjaWLiqVdG5lKt6RHxhLVM3NvZyGqdeeggKkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1654087884975729.1492484119967; Wed, 1 Jun 2022 05:51:24 -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-294-JlF-cZZbMviv3SDVgkMYJw-1; Wed, 01 Jun 2022 08:51:17 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E8B6D10AF7EC; Wed, 1 Jun 2022 12:50:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C83B440EC006; Wed, 1 Jun 2022 12:50:39 +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 281AB1947B99; Wed, 1 Jun 2022 12:50:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5364A1937755 for ; Wed, 1 Jun 2022 12:50:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 13183112131B; Wed, 1 Jun 2022 12:50:29 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6ACB1121315; Wed, 1 Jun 2022 12:50:28 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 88F21245B6B; Wed, 1 Jun 2022 14:50:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654087884; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=6ZzK1eM6fNhSGjjzok8NhTVma+v1Olc+JNnMqtZ4q4g=; b=ZOShGPxgdJ/p9Cb7xEnlgFAafJ4+VDqNZDHums6QeDVmNKESY+Flg7sI4t4FkP1rXWi758 yadZGDkwd5TVqNy8wpLdhRoXZGFGIhLXR8yBR36Q+CAuOo0plHG+jEy/LVs/ermb5bhQke vqZpAvRMZu2rV3BbOV5YOw6DntZZpso= X-MC-Unique: JlF-cZZbMviv3SDVgkMYJw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 31/81] qemu: Introduce qemuMigrationDstFinishOffline Date: Wed, 1 Jun 2022 14:49:31 +0200 Message-Id: <9d058de1f3b0d3bef2a3194e883365dc79745f3a.1654087150.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 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: , Cc: Peter Krempa , Pavel Hrdina Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1654087885943100003 Content-Type: text/plain; charset="utf-8" Refactors qemuMigrationDstFinish by moving some parts to a dedicated function for easier introduction of postcopy resume code without duplicating common parts of the Finish phase. The goal is to have the following call graph: - qemuMigrationDstFinish - qemuMigrationDstFinishOffline - qemuMigrationDstFinishActive - qemuMigrationDstFinishFresh - qemuMigrationDstFinishResume Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Notes: Version 2: - no change src/qemu/qemu_migration.c | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 72f22f09e4..01e47e46cc 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5808,6 +5808,32 @@ qemuMigrationDstComplete(virQEMUDriver *driver, } =20 =20 +static virDomainPtr +qemuMigrationDstFinishOffline(virQEMUDriver *driver, + virConnectPtr dconn, + virDomainObj *vm, + qemuMigrationCookie *mig, + char **cookieout, + int *cookieoutlen) +{ + virDomainPtr dom =3D NULL; + + if (qemuMigrationDstPersist(driver, vm, mig, false) < 0) + return NULL; + + dom =3D virGetDomain(dconn, vm->def->name, vm->def->uuid, -1); + + if (dom && + qemuMigrationCookieFormat(mig, driver, vm, + QEMU_MIGRATION_DESTINATION, + cookieout, cookieoutlen, + QEMU_MIGRATION_COOKIE_STATS) < 0) + VIR_WARN("Unable to encode migration cookie"); + + return dom; +} + + /* * Perform Finish phase of a fresh (i.e., not recovery) migration of an ac= tive * domain. @@ -5998,16 +6024,9 @@ qemuMigrationDstFinish(virQEMUDriver *driver, goto error; =20 if (flags & VIR_MIGRATE_OFFLINE) { - if (retcode =3D=3D 0 && - qemuMigrationDstPersist(driver, vm, mig, false) =3D=3D 0) { - dom =3D virGetDomain(dconn, vm->def->name, vm->def->uuid, -1); - - if (dom && - qemuMigrationCookieFormat(mig, driver, vm, - QEMU_MIGRATION_DESTINATION, - cookieout, cookieoutlen, - QEMU_MIGRATION_COOKIE_STATS) < 0) - VIR_WARN("Unable to encode migration cookie"); + if (retcode =3D=3D 0) { + dom =3D qemuMigrationDstFinishOffline(driver, dconn, vm, mig, + cookieout, cookieoutlen); } =20 qemuMigrationJobFinish(vm); --=20 2.35.1