From nobody Sun Feb 8 18:10:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1618329457; cv=none; d=zohomail.com; s=zohoarc; b=ZyOZtHa+ngAlLuBmxP5cVVr/pEe2eGiUFXUtgIKxxYFwF/A3uD76OYbmVk0+kCfem4N9TZW024ZyeAPLQFPv4MEyvc2gizTI9qRjbBFUAX10FOAPAl3soNUHmNeMXKY+Q1g+Gy5/lrbiKKARO+AveWBBWZBfPCHUvfydCQ/kfqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618329457; h=Content-Type:Content-Transfer-Encoding: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=LGyj2q24au4Y+KXB1ZoN2hOJHYsLIY+YEZKfShg8Wog=; b=PbmNa8RsW3meEdx3pmX+r7I6CMxFotqYdEHKOfp+i2EIbo2z+w75CT73y8VQcdWTAbRX/+kzEPMvRUfqLm72+c8AWMHwlvUAnaYEMsEVQ4lJ/nLoh71/7j6/DHaXUlEwb9zhXmAvvDKEjJhA8hmHW1gcNbQZcrkuXIJotQIDd34= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1618329457265789.1996028071968; Tue, 13 Apr 2021 08:57:37 -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-311-A3X0qb_MPwKsDtIdPGAUaQ-1; Tue, 13 Apr 2021 11:57:33 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 143B21020C22; Tue, 13 Apr 2021 15:57:28 +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 E5C5D5C26D; Tue, 13 Apr 2021 15:57:27 +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 B16C11806D15; Tue, 13 Apr 2021 15:57:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13DFvMAw014723 for ; Tue, 13 Apr 2021 11:57:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6EA7E39A60; Tue, 13 Apr 2021 15:57:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id E83E56062F for ; Tue, 13 Apr 2021 15:57:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618329456; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=LGyj2q24au4Y+KXB1ZoN2hOJHYsLIY+YEZKfShg8Wog=; b=evI7HZDnUlr3sS3UQuSS9StaeZjvf7CUDhx6FeGGUEvN/cS5w1R7WDkymj2YCcPauq71Yo ExpiPlRq2zglioeM+FrjWAaUGjcc2Nhj7IOH+rFfEV92wZKVHkwnLhUOqKQfmIxWnz2kmL YZfzhzH9wJCsl02F00qGiBqOvUypRs8= X-MC-Unique: A3X0qb_MPwKsDtIdPGAUaQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 2/3] nodedev: Mark device initialization complete even in case of an error Date: Tue, 13 Apr 2021 17:57:14 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.16 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) Content-Type: text/plain; charset="utf-8" To speed up nodedev driver initialization, the device enumeration is done in a separate thread. Once finished, the thread sets a boolean variable that allows public APIs to be called (instead of waiting for the thread to finish). However, if there's an error in the device enumeration thread then the control jumps over at the 'error' label and the boolean is never set. This means, that any virNodeDev*() API is stuck forever. Mark the initialization as complete (the thread is quitting anyway) and let the APIs proceed. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/node_device/node_device_udev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 84785d9e1e..658170a767 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1982,6 +1982,7 @@ nodeStateInitializeEnumerate(void *opaque) if (nodeDeviceUpdateMediatedDevices() !=3D 0) goto error; =20 + cleanup: nodeDeviceLock(); driver->initialized =3D true; virCondBroadcast(&driver->initCond); @@ -1996,6 +1997,8 @@ nodeStateInitializeEnumerate(void *opaque) priv->threadQuit =3D true; virCondSignal(&priv->threadCond); virObjectUnlock(priv); + + goto cleanup; } =20 =20 --=20 2.26.3