From nobody Thu May 15 13:51:50 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1508334813740112.77471306547704; Wed, 18 Oct 2017 06:53:33 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB95B7EAA4; Wed, 18 Oct 2017 13:53:32 +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 84CCA7EE61; Wed, 18 Oct 2017 13:53:32 +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 40E6B1800C9D; Wed, 18 Oct 2017 13:53:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v9IDrUKL009878 for ; Wed, 18 Oct 2017 09:53:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id A071D99E1D; Wed, 18 Oct 2017 13:53:30 +0000 (UTC) Received: from beluga.usersys.redhat.com (unknown [10.43.2.166]) by smtp.corp.redhat.com (Postfix) with ESMTP id A56D197AE4; Wed, 18 Oct 2017 13:53:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AB95B7EAA4 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Erik Skultety To: libvir-list@redhat.com Date: Wed, 18 Oct 2017 15:52:27 +0200 Message-Id: <65eb839bda4c7494d574d72e2c9d5dc35b435907.1508333637.git.eskultet@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Erik Skultety Subject: [libvirt] [PATCH v6 5/9] nodedev: udev: Unlock the private data before setting up 'system' node 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 18 Oct 2017 13:53:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" udevSetupSystemDev only needs the udev data lock to be locked because of calling udevGetDMIData which accesses some protected structure members, but it can do that on its own just fine, no need to hold the lock the whole time. Signed-off-by: Erik Skultety --- src/node_device/node_device_udev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index e0e5ba799..6882517e6 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1719,6 +1719,7 @@ udevGetDMIData(virNodeDevCapSystemPtr syscap) virNodeDevCapSystemHardwarePtr hardware =3D &syscap->hardware; virNodeDevCapSystemFirmwarePtr firmware =3D &syscap->firmware; =20 + virObjectLock(priv); udev =3D udev_monitor_get_udev(priv->udev_monitor); =20 device =3D udev_device_new_from_syspath(udev, DMI_DEVPATH); @@ -1731,6 +1732,7 @@ udevGetDMIData(virNodeDevCapSystemPtr syscap) return; } } + virObjectUnlock(priv); =20 if (udevGetStringSysfsAttr(device, "product_name", &syscap->product_name) < 0) @@ -1898,11 +1900,11 @@ nodeStateInitialize(bool privileged, if (priv->watch =3D=3D -1) goto unlock; =20 + virObjectUnlock(priv); + /* Create a fictional 'computer' device to root the device tree. */ if (udevSetupSystemDev() !=3D 0) - goto unlock; - - virObjectUnlock(priv); + goto cleanup; =20 /* Populate with known devices */ if (udevEnumerateDevices(udev) !=3D 0) --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list