From nobody Tue Apr 30 01:12:20 2024 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 Reviewed-by: Michal Privoznik --- 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 From nobody Tue Apr 30 01:12:20 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 207.211.31.81 is neither permitted nor denied by domain of redhat.com) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 207.211.31.81 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=1597746428; cv=none; d=zohomail.com; s=zohoarc; b=SnXcgRjIWwDHiFovRODuPPjYoM2mwBrc4mTv40O0qVgkU2SILgECn4w9oMUlStEL2zaCMjxKAndBl1gSTVavbBBTFoEoz7TJyRMkcQf4eLAeys+8PWDE3HAGHu4E0wAVz3X0YsivDeyNdnVW24DquyqxMeBYq8l1H1MJvah57R8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597746428; 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=qVYX7NT/JXbmptX9lT5ld+s94pq5jmxpbfpuFZ9Gk9M=; b=ns2eT2Xe8d2wq3ujptN3l8lVNxZdKbBmPVld493qqY6H9ILFgUFVFjsnvNb1gNrPaqaVhR6gUTt6Ly5ic8af07U1uJf6vrIOjVUzXu11/XJDY2LK89upeCPVBrdWlXRnBlO/eQ0KTMqDpCifzdUW1BcuWE/9OJapDu+ItHDHIPc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 159774642873788.15456419917928; Tue, 18 Aug 2020 03:27:08 -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-231-X5w-fiXIM_C-bAt7NgYWAQ-1; Tue, 18 Aug 2020 06:27:05 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B94CE75E; Tue, 18 Aug 2020 10:27:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F908756C3; Tue, 18 Aug 2020 10:27:00 +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 0DF6D60365; Tue, 18 Aug 2020 10:27:00 +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 07IAQj9b006902 for ; Tue, 18 Aug 2020 06:26:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9C5B02166BDD; Tue, 18 Aug 2020 10:26:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96ECB2166BCC for ; Tue, 18 Aug 2020 10:26:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 D5C3E805C3D for ; Tue, 18 Aug 2020 10:26:42 +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-210-cSoH-E4DOP29G8Kk-ubw-w-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-OA for libvir-list@redhat.com; Tue, 18 Aug 2020 13:26:27 +0300 X-MC-Unique: X5w-fiXIM_C-bAt7NgYWAQ-1 X-MC-Unique: cSoH-E4DOP29G8Kk-ubw-w-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 2/2] qemu: don't needlessly unset close callback during perform phase Date: Tue, 18 Aug 2020 13:26:36 +0300 Message-Id: <1597746396-983813-3-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.79 on 10.5.11.12 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" During API call connection is referenced and close callback is called when connection is disposed. Thus during API call close callback cannot be trigg= ered and we don't need to unset callback on API call duration. This code was added in [1] and commit does not explain this part of the patch. [1] 1fdc53c3: qemu: Avoid dangling migration-out job when client dies Signed-off-by: Nikolay Shirokovskiy Reviewed-by: Michal Privoznik --- src/qemu/qemu_migration.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 301475a..7615dab 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -4743,7 +4743,6 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, */ static int qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver, - virConnectPtr conn, virDomainObjPtr vm, const char *persist_xml, const char *uri, @@ -4772,8 +4771,6 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver, } =20 qemuMigrationJobStartPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3); - virCloseCallbacksUnset(driver->closeCallbacks, vm, - qemuMigrationSrcCleanup); =20 ret =3D qemuMigrationSrcPerformNative(driver, vm, persist_xml, uri, co= okiein, cookieinlen, cookieout, cookieoutlen, @@ -4787,10 +4784,6 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver, =20 qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_PERFORM3_DON= E); =20 - if (virCloseCallbacksSet(driver->closeCallbacks, vm, conn, - qemuMigrationSrcCleanup) < 0) - goto endjob; - endjob: if (ret < 0) { qemuMigrationParamsReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, @@ -4862,7 +4855,7 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver, } =20 if (v3proto) { - return qemuMigrationSrcPerformPhase(driver, conn, vm, persist_= xml, uri, + return qemuMigrationSrcPerformPhase(driver, vm, persist_xml, u= ri, graphicsuri, nmigrate_disks, migrate_di= sks, migParams, --=20 1.8.3.1