From nobody Sun Feb 8 15:08:16 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=1652196249; cv=none; d=zohomail.com; s=zohoarc; b=flWoMaC4Ehjnqj0lChg4fDPixom+PzJ9FQd8Qn5kGJTTri5S4pV2A5bi+tJlZDQlqYROYL4aR5ihe/Q4Iea3HIntETh2024G7jatyIlvMxKnjZ33DEsGKPiw77uWQCJbqdbNRPLzggURqG9Uc+tCYCHH+F2IDXUY/wXF0BwliTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652196249; 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=aUmDu8JYwSx3PKnUP31BL/c1U8jvud2A0d2MNZkbh/8=; b=PQWVL6/AaiJdAL/Jkbpupc8f71NJKRRZMam9Q+E7wKv1UDTRQGlilDPIbIhQg/vHBk9Vq0KUgV6Zxvqco2DQmZA9LzD8+XL35lE31W7KKVvadmj0UXlgg4kyAdI32WHB9KQnRV5CJVFVHJpc6wF/zbFj19k5XTDesvbjwy7r50Q= 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 1652196249004757.7035641897833; Tue, 10 May 2022 08:24:09 -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-617-7N-ufys9PXK9olj84_9JaQ-1; Tue, 10 May 2022 11:22:52 -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 01E60A18F0D; Tue, 10 May 2022 15:22:05 +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 DF87340CFD45; Tue, 10 May 2022 15:22:04 +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 787EC194E00B; Tue, 10 May 2022 15:21:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9D4D41947076 for ; Tue, 10 May 2022 15:21:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 867EB40D282B; Tue, 10 May 2022 15:21:49 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 630D540D2822 for ; Tue, 10 May 2022 15:21:49 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id B9052244623; 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=1652196248; 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=aUmDu8JYwSx3PKnUP31BL/c1U8jvud2A0d2MNZkbh/8=; b=KN6GnVkrWpJ3p5wUwUY7nZJ7EJ+iCZl/B/LVD/4EUVEaNukhRpILZWWAqwKOKyHn1QJTfz vso5v66CP+oUCE+mnWN31HzRslkP5O5Biei7xu6cSDmNZp4/QGMxO1WtVPrY3EhA3cVyW6 6Q6AWFuCjHnXYqpNCiKIWL0N9q4wOvA= X-MC-Unique: 7N-ufys9PXK9olj84_9JaQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 55/80] qmeu: Refactor qemuMigrationSrcPerformPhase Date: Tue, 10 May 2022 17:21:16 +0200 Message-Id: <11f4c64b727f7afeef0845048eb555f523d248aa.1652196064.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 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: 1652196251090100003 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 --- 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 99b1d4b88b..dd18a4ad63 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5819,29 +5819,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