From nobody Sat Feb 7 09:46:46 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 207.211.31.120 is neither permitted nor denied by domain of redhat.com) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 207.211.31.120 is neither permitted nor denied by domain of redhat.com) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1597746433; cv=none; d=zohomail.com; s=zohoarc; b=nLe9F4XOdexX9Rh0h4y+G/c3R8W4upzHlOSmaiTV/r9ENIWlj6HV81jd+RjGn7XmoWg3IXj6KJdSbr352G440Ouk3vGawLYrgETS29R4uruhdioFmAArvEn5sQQ7t5Mf89hljpO5z6Y2udAV3MAWG5oTHpP+HOh4xiO81+ruE/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597746433; h=Content-Type:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=C8w8nHqe1l6hktXsnoiCOnjPB49UJzf5hSdyFXPanQo=; b=DW4f5/guuNuUwoac9HiSULU4WK6diN4sLsL52Ttm8PBs4subl3x9egafOjPwtsfUy7lJ7Gbgix9iAIH3J4LgeUdLAVAAAdh47Sn6n9MvK5Je+/mMAnCUDjDaB+SMp40OqgH/Cv2wMNt+XgNEIwtsVd/bdSmQ4wzzdkBneADk9ss= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 207.211.31.120 is neither permitted nor denied by domain of redhat.com) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 15977464330371019.6691281296958; Tue, 18 Aug 2020 03:27:13 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-211-ir8gHwYQOB-FwXKUhpCQuA-1; Tue, 18 Aug 2020 06:27:10 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D76DF1DDF0; Tue, 18 Aug 2020 10:27:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B28DB2617B; Tue, 18 Aug 2020 10:27:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 636FB181A06B; Tue, 18 Aug 2020 10:27:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07IAQjIr006901 for ; Tue, 18 Aug 2020 06:26:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C67B2157F23; Tue, 18 Aug 2020 10:26:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 97DD02166BD9 for ; Tue, 18 Aug 2020 10:26:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A270101AA4A for ; Tue, 18 Aug 2020 10:26:43 +0000 (UTC) Received: from relay3.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-144-btysXPIBPeyewr30xxCXdQ-1; Tue, 18 Aug 2020 06:26:40 -0400 Received: from [10.28.15.159] (helo=vz7.sw.ru) by relay3.sw.ru with esmtp (Exim 4.94) (envelope-from ) id 1k7yp1-000DI1-Mq for libvir-list@redhat.com; Tue, 18 Aug 2020 13:26:27 +0300 X-MC-Unique: ir8gHwYQOB-FwXKUhpCQuA-1 X-MC-Unique: btysXPIBPeyewr30xxCXdQ-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: fix qemuMigrationSrcCleanup to use qemuMigrationJobFinish Date: Tue, 18 Aug 2020 13:26:35 +0300 Message-Id: <1597746396-983813-2-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1597746396-983813-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1597746396-983813-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 2.002 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" qemuMigrationSrcCleanup uses qemuDomainObjDiscardAsyncJob currently. But discard does not reduce jobs_queued counter so it leaks. Also discard does = not notify other threads that job condition is available. Discard does reset ne= sted job but nested job is not possible in this conditions. Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Jiri Denemark --- src/qemu/qemu_migration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 142faa2..301475a 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2026,7 +2026,6 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm, switch ((qemuMigrationJobPhase) priv->job.phase) { case QEMU_MIGRATION_PHASE_BEGIN3: /* just forget we were about to migrate */ - qemuDomainObjDiscardAsyncJob(driver, vm); break; =20 case QEMU_MIGRATION_PHASE_PERFORM3_DONE: @@ -2036,7 +2035,6 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm, qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, jobPriv->migParams, priv->job.apiFlags); /* clear the job and let higher levels decide what to do */ - qemuDomainObjDiscardAsyncJob(driver, vm); break; =20 case QEMU_MIGRATION_PHASE_PERFORM3: @@ -2053,8 +2051,9 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm, case QEMU_MIGRATION_PHASE_NONE: case QEMU_MIGRATION_PHASE_LAST: /* unreachable */ - ; + return; } + qemuMigrationJobFinish(driver, vm); } =20 =20 --=20 1.8.3.1