From nobody Mon Feb 9 10:57:21 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=1618244750; cv=none; d=zohomail.com; s=zohoarc; b=GMC7HG9s3a9vIBQW4PaN9KAVGtyTJ4MaA3XZwYU5fIimdJ/SaocgQosVjKMU7xEfLCe2B9ChBs+psdM7k5WX3C5gmB9WRZR2VL+gGiHMRNtR66jjQDwPJzrc2rErjyrraPOGsAIRn++tOagdiVUZxivXz0h9ChQMReFwGffuVg0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618244750; 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=X3hrrLJc9f3KljFBkROsUHE2OAudWrP0S76LqXF8U54=; b=QAGb8qc29zvFGQbg4+5WfI4VuQ1q+x0W+s18LCdTlSzJrfhYpJ+E6eEWmEkOyO+dPBapb7Kg+uNk2PsUzu941e+sq5fi1lyJO2E7rOLZuxbnHZIviWj2wA90AD3do1gtBd5+RXrQJT33821ZBS/Ck8oJRVO18JatQTkUX39uVD4= 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 1618244750797666.9170626917978; Mon, 12 Apr 2021 09:25:50 -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-353-dytpygw_NLq1YTVMPyy_aQ-1; Mon, 12 Apr 2021 12:25:47 -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 6D12B107ACF5; Mon, 12 Apr 2021 16:25:40 +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 3939419D7C; Mon, 12 Apr 2021 16:25:40 +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 EF66A44A6D; Mon, 12 Apr 2021 16:25:39 +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 13CGMYxE004580 for ; Mon, 12 Apr 2021 12:22:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id 050B750DE3; Mon, 12 Apr 2021 16:22:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.200]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7D75E6062F for ; Mon, 12 Apr 2021 16:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618244749; 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=X3hrrLJc9f3KljFBkROsUHE2OAudWrP0S76LqXF8U54=; b=C62wAxLfOTo57T1ioMEdEYKCZymQSFPUBVWOWLxnfyXIoookEdBB1zGqjMeohg/XNzhScN /7c4/5brMcgC416NlcIULZYNUD2I3bmJERlapHyUOM07cNQqqwF/Nb831esgu3YYIbmzAa Ck13W8oN6hy01t+yAGWCXNRgInUVbrw= X-MC-Unique: dytpygw_NLq1YTVMPyy_aQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 5/5] nodedev: Only set up mdevctl monitors if mdevctl.d exist Date: Mon, 12 Apr 2021 18:22:24 +0200 Message-Id: <38b976c5c3d9567b64c1214823de120c15cf5273.1618243050.git.mprivozn@redhat.com> 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.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: 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" During its initialization, the nodedev driver tries to set up monitors for /etc/mdevctl.d directory, so that it can register mdevs as they come and go. However, if the file doesn't exist there is nothing to monitor and therefore we can exit early. In fact, we have to otherwise monitorFileRecursively() fails and whole driver initialization fails with it. Signed-off-by: Michal Privoznik --- src/node_device/node_device_udev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 18219175c5..c4040c2fd6 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -2122,7 +2122,13 @@ monitorFileRecursively(udevEventData *udev, static int mdevctlEnableMonitor(udevEventData *priv) { - g_autoptr(GFile) mdevctlConfigDir =3D g_file_new_for_path("/etc/mdevct= l.d"); + g_autoptr(GFile) mdevctlConfigDir =3D NULL; + const char *mdevctlDir =3D "/etc/mdevctl.d"; + + if (!virFileExists(mdevctlDir)) + return 0; + + mdevctlConfigDir =3D g_file_new_for_path("/etc/mdevctl.d"); =20 /* mdevctl may add notification events in the future: * https://github.com/mdevctl/mdevctl/issues/27. For now, fall back to --=20 2.26.3