From nobody Tue Apr 23 05:32:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1567617838; cv=none; d=zoho.com; s=zohoarc; b=RN17qADZc2XLG2pACbUyKuBD/Hdyl7xL4nzFLb10HJqXGi+vJ5PlREy5f6ksC92FDxfxnMzhDj+OGAcnhCGqMX0UmK7lOfgeChi16ME+/49tAKIfynoZNB4/kddo5dWz31X4TgWOikWz/mUIMD1B/HNBE6yb/CmIj99/RqtaSjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567617838; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=35c2NpF0Kw/+7OZf7hD/qGyfoOzh28CnXYWGiBMNHb0=; b=Y0RFkWwTH3ZfCBfq67nL5XVAxrqjkqgU1g2ZBVGoKIoZO7guvO0jHLjpOp2a3K5Sqb+vNOuFHtOwIjjLnMQ8o6rY9vQsGL3NiGQQWL1f1y5RezgqDqfg1MWyMQ/PxFfeI9ntlsJaSlwPesT6PuPJVRU2yVV/2r/YhUxTZz7pxfQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1567617838112825.5992571986923; Wed, 4 Sep 2019 10:23:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A2D718C427C; Wed, 4 Sep 2019 17:23:56 +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 E0A01100197A; Wed, 4 Sep 2019 17:23:55 +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 B14502551C; Wed, 4 Sep 2019 17:23:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x84HNsZO000469 for ; Wed, 4 Sep 2019 13:23:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 08F6519D7A; Wed, 4 Sep 2019 17:23:54 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-116-100.phx2.redhat.com [10.3.116.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CBFB2194B2 for ; Wed, 4 Sep 2019 17:23:51 +0000 (UTC) From: Jonathon Jongsma To: libvir-list@redhat.com Date: Wed, 4 Sep 2019 12:23:30 -0500 Message-Id: <20190904172330.610-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: update threading info about domain object refs 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Wed, 04 Sep 2019 17:23:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Since commit fd9ef3b31e, virDomainFindByUUIDRef() no longer exists and all virDomainObjListFindBy*() functions now increment the reference count. Signed-off-by: Jonathon Jongsma Reviewed-by: Daniel Henrique Barboza Reviewed-by: Pavel Hrdina --- src/qemu/THREADS.txt | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt index d17f3f4e0c..aa428fda6a 100644 --- a/src/qemu/THREADS.txt +++ b/src/qemu/THREADS.txt @@ -25,27 +25,17 @@ There are a number of locks on various objects =20 * virDomainObjPtr =20 - Will be locked after calling any of the virDomainObjListFindBy{ID,Name= ,UUID} - methods. However, preferred method is qemuDomObjFromDomain() that uses - virDomainFindByUUIDRef() which also increases the reference counter and - finds the domain in the domain list without blocking all other lookups. - When the domain is locked and the reference increased, the preferred w= ay of - decrementing the reference counter and unlocking the domain is using t= he + Will be locked and the reference counter will be increased after calli= ng + any of the virDomainObjListFindBy{ID,Name,UUID} methods. The preferred= way + of decrementing the reference counter and unlocking the domain is usin= g the virDomainObjEndAPI() function. =20 Lock must be held when changing/reading any variable in the virDomainO= bjPtr =20 - If the lock needs to be dropped & then re-acquired for a short period = of - time, the reference count must be incremented first using virDomainObj= Ref(). - There is no need to increase the reference count if qemuDomObjFromDoma= in() - was used for looking up the domain. In this case there is one referen= ce - already added by that function. - This lock must not be held for anything which sleeps/waits (i.e. monit= or commands). =20 =20 - * qemuMonitorPrivatePtr: Job conditions =20 Since virDomainObjPtr lock must not be held during sleeps, the job --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list