From nobody Mon Feb 9 05:01:15 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=1654087905; cv=none; d=zohomail.com; s=zohoarc; b=UOpoVcxlTAMKKnyNRtTM/GCaeugbhO63pXy+YBGksjF4ljoCOTHM2r+HEEcCzxo0iy+kvPe0CkntcTJzPH+ESM5UFClCD6J/Vbmny47sCl3ApnUcLQLokIIL4aZxArwR2oXhdx8bSyQo8LiP84GmQI0aGUEZ8RQhZxgIf+qFHic= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654087905; 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=vw7EsXcxyoiQJlzvT+MHZ6nLHX5ubmssWo2siL0p4qA=; b=FODMmFHVCgM4VO/3rNP9zsgkFMwrAHWz1WvOGEK2/WaxAx5bc8cMAYYb4v7Msga7ho+9ucnEmgJ6lYOVg6b8QaOhRdTlvodlX0ZGy2ODdWX5rwb4enVBSGCWSskY01HctvB656FMKgnrRfOYlTIGzcFdcmdrzuNSdLfYBymL1ZE= 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 1654087905451740.5987866568071; Wed, 1 Jun 2022 05:51:45 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-Yt-wTQqEN9mDXkMhzf3zNw-1; Wed, 01 Jun 2022 08:51:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4E97C3816859; Wed, 1 Jun 2022 12:50:47 +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 3834182886; Wed, 1 Jun 2022 12:50:47 +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 755391947BA9; Wed, 1 Jun 2022 12:50:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 70CDE1947BA1 for ; Wed, 1 Jun 2022 12:50:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5743B2024CC6; Wed, 1 Jun 2022 12:50:30 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 31FFD2024CC5; Wed, 1 Jun 2022 12:50:30 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id A65D6245B81; 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=1654087904; 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=vw7EsXcxyoiQJlzvT+MHZ6nLHX5ubmssWo2siL0p4qA=; b=RZ4Bn2zI+h3uru6lHuYKAkdvfILaj5c9GXQu24iOoKiUqXsgEcNkjL9ryewLg+JxHgWwnq YUJsnTwCbvyjqc1uSgOPK27/gha4/Mgx5jTpqUPTC/Zw8cdyDnoAGiYsltoi3/bBl8yrVO j0i/cfqG5SwD3Bt4TEj52x9msj3yCFs= X-MC-Unique: Yt-wTQqEN9mDXkMhzf3zNw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 53/81] qemu: Refactor qemuMigrationSrcPerformPhase Date: Wed, 1 Jun 2022 14:49:53 +0200 Message-Id: <157122743c9e3242b40346e8dca84f6c0743c435.1654087150.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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.79 on 10.11.54.5 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: 1654087906024100003 Content-Type: text/plain; charset="utf-8" To make the code flow a bit more sensible. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Notes: Version 2: - fixed "qmeu" typo in the commit message src/qemu/qemu_migration.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 45f2788a34..3ed1cf3498 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5780,29 +5780,27 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver, } =20 if (qemuMigrationJobStartPhase(vm, QEMU_MIGRATION_PHASE_PERFORM3) < 0) - goto endjob; + goto cleanup; =20 virCloseCallbacksUnset(driver->closeCallbacks, vm, qemuMigrationSrcCleanup); =20 - ret =3D qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, co= okiein, cookieinlen, - cookieout, cookieoutlen, - flags, resource, NULL, graphicsuri, - nmigrate_disks, migrate_disks, mig= Params, nbdURI); - - if (ret < 0) { - qemuMigrationSrcRestoreDomainState(driver, vm); - goto endjob; - } - - ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM= 3_DONE)); + if (qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, cookie= in, cookieinlen, + cookieout, cookieoutlen, + flags, resource, NULL, graphicsuri, + nmigrate_disks, migrate_disks, migPa= rams, nbdURI) < 0) + goto cleanup; =20 if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, qemuMigrationSrcCleanup) < 0) - goto endjob; + goto cleanup; =20 - endjob: + ignore_value(qemuMigrationJobSetPhase(vm, QEMU_MIGRATION_PHASE_PERFORM= 3_DONE)); + ret =3D 0; + + cleanup: if (ret < 0 && !virDomainObjIsFailedPostcopy(vm)) { + qemuMigrationSrcRestoreDomainState(driver, vm); qemuMigrationParamsReset(driver, vm, VIR_ASYNC_JOB_MIGRATION_OUT, jobPriv->migParams, priv->job.apiFlags); qemuMigrationJobFinish(vm); --=20 2.35.1