From nobody Sun Feb 8 13:09:41 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=1654087987; cv=none; d=zohomail.com; s=zohoarc; b=hplltOI4FYken2yz91hwgnBpkddWqiTOn1Rey9vZDD9q5bAGTXn49FG/s6FSq5QYkxbbvxMKP/3sPTrSkkEJoFhVioJo23MKUJ9f+2NlcWNT4dIA7UyFClICBLokpz8W8fUYj29y5Rb8v4n45Syt6YWByZ8z5oZXxVV8PdFC/lg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654087987; 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=xwLp11JwKe7iR3KlsmFWhAuqs7G1xQXTyvzT7W8Kseg=; b=dovh0lKU2QC6i2St8+CM3K73C9N9kqTdQjvnR9OQg9zThY3U7pBXNb+rb8Hh3Jp9tj8uwG1IvKLjt6/Vgz6WgNcvzqkwb3DwhCKRGmp6iRPW/LMt/5TNxqwuPLOe7bV050JD1QkLOWZi7wBsYZ2WSfb9FAh47tG6dDSsg1OEVZU= 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 1654087987683432.48591156460543; Wed, 1 Jun 2022 05:53:07 -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-221-WBjehmEiNsa4ZqBsilTqWw-1; Wed, 01 Jun 2022 08:51:32 -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 2A98880CDAD; Wed, 1 Jun 2022 12:50:50 +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 146BE3323E; Wed, 1 Jun 2022 12:50:50 +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 3496C193221D; Wed, 1 Jun 2022 12:50:46 +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 224261947B8C for ; Wed, 1 Jun 2022 12:50:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0A096C27E8F; 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 DD622C28114; Wed, 1 Jun 2022 12:50:29 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 8F7C5245B70; 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=1654087986; 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=xwLp11JwKe7iR3KlsmFWhAuqs7G1xQXTyvzT7W8Kseg=; b=MHSxlhBioaTnPN6oyOyWlYDA4FJJAMz9iE5iH6moEWyT9EqT7Ub4GaEaVZLp2RQtesP0wg TdJBOIAZhmICr3bgA9LgTkoSVNWuDqIr2apO/AI7HOLWLhyGobt1k9L188X+IQd3VW6+D6 JHC18WbZtfbjd81aiGMvdda6IITST+U= X-MC-Unique: WBjehmEiNsa4ZqBsilTqWw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH v2 36/81] qemu: Make sure migrationPort is released even in callbacks Date: Wed, 1 Jun 2022 14:49:36 +0200 Message-Id: <3f2e99969df417ab137bd2cfd838dfd1a231ec4e.1654087150.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: , 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: 1654087988375100006 Content-Type: text/plain; charset="utf-8" Normally migrationPort is released in the Finish phase, but we need to make sure it is properly released also in case qemuMigrationDstFinish is not called at all. Currently the only callback which is called in this situation qemuMigrationDstPrepareCleanup which already releases migrationPort. This patch adds similar handling to additional callbacks which will be used in the future. Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa Reviewed-by: Pavel Hrdina --- Notes: Version 2: - no change src/qemu/qemu_migration.c | 3 +++ src/qemu/qemu_process.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index d80a250cac..53801a29ef 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -5821,6 +5821,9 @@ qemuMigrationDstComplete(virQEMUDriver *driver, =20 qemuMigrationParamsReset(driver, vm, asyncJob, jobPriv->migParams, priv->job.apiFlags); + + virPortAllocatorRelease(priv->migrationPort); + priv->migrationPort =3D 0; } =20 =20 diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b039108ff7..d3769de496 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3437,6 +3437,8 @@ qemuProcessCleanupMigrationJob(virQEMUDriver *driver, priv->job.asyncJob !=3D VIR_ASYNC_JOB_MIGRATION_OUT) return; =20 + virPortAllocatorRelease(priv->migrationPort); + priv->migrationPort =3D 0; qemuDomainObjDiscardAsyncJob(vm); } =20 --=20 2.35.1